Пример #1
0
    def setup_options(self):
        helpString="""
twolevel_model_building

A pydpiper application designed to work with longitudinal data. LSQ12
and nonlinear registration is used to create a consensus average of
every subject. A second level of LSQ12 and nonlinear registrations is 
then used to bring all the consensus averages from each subject into
their own consensus average.

Some assumptions:
* at least two timepoints per subject 
  * future work should be able to extend this to allow single timepoint subjects
* all images must be similar enough to allow registration

The last point is particularly important: the consensus average building process
aligns every image from each subject to every other image from that subject. Early
developmental data or tumour data, where the first image in the series might not be
alignable to the last image in the series, is thus not suited for this approach.

Data is passed to the application through a CSV file. This file has one line per subject,
with each scan per subject listed on the same line and separated by a comma.
"""
        
        # own options go here
        lsq6.addLSQ6ArgumentGroup(self.parser)
        lsq12.addLSQ12ArgumentGroup(self.parser)
        nl.addNlinRegArgumentGroup(self.parser)
        rf.addGenRegArgumentGroup(self.parser)
        st.addStatsArguments(self.parser)
        
        # set help - note that the format is messed up, something that can be fixed if we upgrade
        # from optparse to argparse.
        self.parser.description = helpString
Пример #2
0
    def setup_options(self):
        helpString="""
twolevel_model_building

A pydpiper application designed to work with longitudinal data. LSQ12
and nonlinear registration is used to create a consensus average of
every subject. A second level of LSQ12 and nonlinear registrations is 
then used to bring all the consensus averages from each subject into
their own consensus average.

Some assumptions:
* at least two timepoints per subject 
  * future work should be able to extend this to allow single timepoint subjects
* all images must be similar enough to allow registration

The last point is particularly important: the consensus average building process
aligns every image from each subject to every other image from that subject. Early
developmental data or tumour data, where the first image in the series might not be
alignable to the last image in the series, is thus not suited for this approach.

Data is passed to the application through a CSV file. This file has one line per subject,
with each scan per subject listed on the same line and separated by a comma.
"""
        
        # own options go here
        lsq6.addLSQ6ArgumentGroup(self.parser)
        lsq12.addLSQ12ArgumentGroup(self.parser)
        nl.addNlinRegArgumentGroup(self.parser)
        rf.addGenRegArgumentGroup(self.parser)
        st.addStatsArguments(self.parser)
        
        # set help - note that the format is messed up, something that can be fixed if we upgrade
        # from optparse to argparse.
        self.parser.description = helpString
Пример #3
0
 def setup_options(self):
     """Add option groups from specific modules"""
     addMBMGroup(self.parser)
     rf.addGenRegArgumentGroup(self.parser)
     lsq6.addLSQ6ArgumentGroup(self.parser)
     lsq12.addLSQ12ArgumentGroup(self.parser)
     nlin.addNlinRegArgumentGroup(self.parser)
     st.addStatsArguments(self.parser)
Пример #4
0
 def setup_options(self):
     """Add option groups from specific modules"""
     addMBMGroup(self.parser)
     rf.addGenRegArgumentGroup(self.parser)
     lsq6.addLSQ6ArgumentGroup(self.parser)
     lsq12.addLSQ12ArgumentGroup(self.parser)
     nlin.addNlinRegArgumentGroup(self.parser)
     st.addStatsArguments(self.parser)
Пример #5
0
 def setup_options(self):
     group = self.parser.add_argument_group("Pairwise non-linear options", 
                           "Options for pairwise non-linear registration of lsq6 or lsq12 aligned brains.")
     group.add_argument("--input-space", dest="input_space",
                   type=str, default="lsq6", 
                   help="Option to specify space of input-files. Can be lsq6 (default), lsq12 or native.")
     self.parser.add_argument_group(group)
     """Add option groups from specific modules"""
     rf.addGenRegArgumentGroup(self.parser)
     og.tmpLongitudinalArgumentGroup(self.parser)
     st.addStatsArguments(self.parser)
Пример #6
0
 def setup_options(self):
     addGenRegArgumentGroup(self.parser)
     addMAGeTArgumentGroup(self.parser)
     addLSQ12ArgumentGroup(self.parser)
     addNlinRegArgumentGroup(self.parser)
     # make sure that the default non linear registration tool for MAGeT is set to minctracc
     # this is what MAGeT was optimized for, and it's a lot faster than mincANTS
     self.parser.set_defaults(reg_method="minctracc")
     # similarly set the default linear and non linear protocols. 
     # TODO: ugly hard coded path? Yes...
     self.parser.set_defaults(nlin_protocol="/projects/mice/share/arch/linux-3_2_0-36-generic-x86_64-eglibc-2_15/src/pydpiper/applications_testing/test_data/default_nlin_MAGeT_minctracc_prot.csv")
     self.parser.set_defaults(lsq12_protocol="/projects/mice/share/arch/linux-3_2_0-36-generic-x86_64-eglibc-2_15/src/pydpiper/applications_testing/test_data/default_linear_MAGeT_prot.csv")
Пример #7
0
 def setup_options(self):
     addGenRegArgumentGroup(self.parser)
     addMAGeTArgumentGroup(self.parser)
     addLSQ12ArgumentGroup(self.parser)
     addNlinRegArgumentGroup(self.parser)
     # make sure that the default non linear registration tool for MAGeT is set to minctracc
     # this is what MAGeT was optimized for, and it's a lot faster than mincANTS
     self.parser.set_defaults(reg_method="minctracc")
     # similarly set the default linear and non linear protocols.
     # TODO: ugly hard coded path? Yes...
     self.parser.set_defaults(
         nlin_protocol=
         "/projects/mice/share/arch/linux-3_2_0-36-generic-x86_64-eglibc-2_15/src/pydpiper/applications_testing/test_data/default_nlin_MAGeT_minctracc_prot.csv"
     )
     self.parser.set_defaults(
         lsq12_protocol=
         "/projects/mice/share/arch/linux-3_2_0-36-generic-x86_64-eglibc-2_15/src/pydpiper/applications_testing/test_data/default_linear_MAGeT_prot.csv"
     )
Пример #8
0
if __name__ == "__main__":

    # command line option handling
    # use an environment variable to look for a default config file
    # Alternately, we could use a default location for the file
    # (say `files = ['/etc/pydpiper.cfg', '~/pydpiper.cfg', './pydpiper.cfg']`)
    # TODO this logic is duplicated in application.py
    default_config_file = os.getenv("PYDPIPER_CONFIG_FILE")
    if default_config_file is not None:
        files = [default_config_file]
    else:
        files = []
    parser = ArgParser(default_config_files=files)

    rf.addGenRegArgumentGroup(parser)  # just to get --pipeline-name
    addExecutorArgumentGroup(parser)

    # using parse_known_args instead of parse_args is a hack since we
    # currently send ALL arguments from the main program to the executor
    # on PBS queues (FIXME not yet true on SGE queues, but this is
    # not the best solution anyway).
    # Alternately, we could keep a copy of the executor parser around
    # when constructing the executor shell command
    options = parser.parse_known_args()[0]

    #Check to make sure some executors have been specified.
    noExecSpecified(options.num_exec)

    def local_launch(options):
        pe = pipelineExecutor(options)
Пример #9
0
 def setup_options(self):
     """Add option groups from specific modules"""
     rf.addGenRegArgumentGroup(self.parser)
     addNlinRegArgumentGroup(self.parser)
     addStatsArguments(self.parser)
Пример #10
0
if __name__ == "__main__":

    # command line option handling
    # use an environment variable to look for a default config file
    # Alternately, we could use a default location for the file
    # (say `files = ['/etc/pydpiper.cfg', '~/pydpiper.cfg', './pydpiper.cfg']`)
    # TODO this logic is duplicated in application.py
    default_config_file = os.getenv("PYDPIPER_CONFIG_FILE")
    if default_config_file is not None:
        files = [default_config_file]
    else:
        files = []
    parser = ArgParser(default_config_files=files)    

    rf.addGenRegArgumentGroup(parser) # just to get --pipeline-name
    addExecutorArgumentGroup(parser)

    # using parse_known_args instead of parse_args is a hack since we
    # currently send ALL arguments from the main program to the executor
    # on PBS queues (FIXME not yet true on SGE queues, but this is
    # not the best solution anyway).
    # Alternately, we could keep a copy of the executor parser around
    # when constructing the executor shell command
    options = parser.parse_known_args()[0]

    #Check to make sure some executors have been specified. 
    noExecSpecified(options.num_exec)

    def local_launch(options):
        pe = pipelineExecutor(options)
Пример #11
0
 def setup_options(self):
     """Add option groups from specific modules"""
     rf.addGenRegArgumentGroup(self.parser)
     addLSQ12ArgumentGroup(self.parser)