Exemplo n.º 1
0
def main(args):
    p = CompoundParser([
        execution_parser, application_parser, registration_parser,
        AnnotatedParser(parser=mk_mbm_parser(), namespace="mbm")
    ])

    options = parse(p, args[1:])
    stages = asymmetry_pipeline(options).stages
    execute(stages, options)
Exemplo n.º 2
0
def main(args):
    p = CompoundParser(
          [execution_parser,
           application_parser,
           registration_parser,
           AnnotatedParser(parser=mbm_parser, namespace="mbm")])

    options = parse(p, args[1:])
    stages = asymmetry_pipeline(options).stages
    execute(stages, options)
Exemplo n.º 3
0
def main(args):
    # TODO rewrite using `mk_application`
    p = CompoundParser([
        execution_parser, application_parser, registration_parser,
        tamarack_parser,
        AnnotatedParser(parser=mbm_parser, namespace="mbm")
    ])

    options = parse(p, args[1:])
    stages = tamarack_pipeline(options).stages
    execute(stages, options)
Exemplo n.º 4
0
def main(args):
    # this is probably too much heavy machinery since the options aren't tree-shaped; could just use previous style
    p = CompoundParser(
          [execution_parser,
           application_parser,
           registration_parser,  #cast=RegistrationConf),
           lsq12_parser])

    options = parse(p, args[1:])
    stages = LSQ12_pipeline(options).stages
    execute(stages, options)
def main(args):
    # TODO rewrite using `mk_application`
    p = CompoundParser(
          [execution_parser,
           application_parser,
           registration_parser,
           tamarack_parser,
           AnnotatedParser(parser=mbm_parser, namespace="mbm")])

    options = parse(p, args[1:])
    stages = tamarack_pipeline(options).stages
    execute(stages, options)
Exemplo n.º 6
0
def main(args):
    # this is probably too much heavy machinery since the options aren't tree-shaped; could just use previous style
    p = CompoundParser([
        execution_parser,
        application_parser,
        registration_parser,  #cast=RegistrationConf),
        lsq12_parser
    ])

    options = parse(p, args[1:])
    stages = LSQ12_pipeline(options).stages
    execute(stages, options)
Exemplo n.º 7
0
def main(args):
    p = CompoundParser(
          [execution_parser,
           application_parser,
           registration_parser,
           #twolevel_parser,
           AnnotatedParser(parser=mk_mbm_parser(with_common_space=False), namespace="mbm"),   # TODO use this before 1st-/2nd-level args
           # TODO to combine the information from all three MBM parsers,
           # could use `ConfigArgParse`r `_source_to_settings` (others?) to check whether an option was defaulted
           # or user-specified, allowing the first/second-level options to override the general mbm settings
           #AnnotatedParser(parser=mbm_parser, namespace="first_level", prefix="first-level"),
           #AnnotatedParser(parser=mbm_parser, namespace="second_level", prefix="second-level"),
           #stats_parser
           #segmentation_parser
           ])  # TODO add more stats parsers?

    options = parse(p, args[1:])

    execute(two_level_pipeline(options).stages, options)
def main(args):
    p = CompoundParser([
        execution_parser,
        application_parser,
        registration_parser,
        #twolevel_parser,
        AnnotatedParser(
            parser=mk_mbm_parser(with_common_space=False),
            namespace="mbm"),  # TODO use this before 1st-/2nd-level args
        # TODO to combine the information from all three MBM parsers,
        # could use `ConfigArgParse`r `_source_to_settings` (others?) to check whether an option was defaulted
        # or user-specified, allowing the first/second-level options to override the general mbm settings
        #AnnotatedParser(parser=mbm_parser, namespace="first_level", prefix="first-level"),
        #AnnotatedParser(parser=mbm_parser, namespace="second_level", prefix="second-level"),
        #stats_parser
        #segmentation_parser
    ])  # TODO add more stats parsers?

    options = parse(p, args[1:])

    execute(two_level_pipeline(options).stages, options)
Exemplo n.º 9
0
          "log_det_relative_first_level", file=analysis_csv)
    for subj_id, subject in chain_output.determinants_from_common_avg_to_subject.items():
        for timept, img in subject.time_pt_dict.items():
            # these rows contain full_det, fwhm, inv_xfm, log_full_det, log_nlin_det,... (some more)
            for i, row in img.iterrows():
                #import pdb; pdb.set_trace()
                if timept != subject.intersubject_registration_time_pt:
                    # TODO: this is not really the proper way of dealing with things. If
                    # the code above changes (i.e., if the filenames change) this won't work anymore...
                    from_subject_common_absolute = os.path.realpath(re.sub(".mnc", "_resampled_to_common.mnc", chain_output.determinants_from_subject_common_to_subject[subj_id].time_pt_dict[timept].ix[i].log_full_det.path))
                    from_subject_common_relative = os.path.realpath(re.sub(".mnc", "_resampled_to_common.mnc", chain_output.determinants_from_subject_common_to_subject[subj_id].time_pt_dict[timept].ix[i].log_nlin_det.path))
                else:
                    from_subject_common_absolute = "NA"
                    from_subject_common_relative = "NA"
                print(",".join([str(subj_id), str(timept), str(row.fwhm), os.path.realpath(row.log_full_det.path),
                               os.path.realpath(row.log_nlin_det.path), from_subject_common_absolute, from_subject_common_relative]),file=analysis_csv)
                      #, ",",
                      #chain_output.determinants_from_subject_common_to_subject[subj_id].time_pt_dict[timept].ix[i].log_full_det.path, ",",
                      #chain_output.determinants_from_subject_common_to_subject[subj_id].time_pt_dict[timept].ix[i].log_nlin_det.path
                      #)
    analysis_csv.close()
    #import pdb; pdb.set_trace()

#Namespace(non_rigid_xfms_to_common=non_rigid_xfms_to_common_avg,
#                                             determinants_from_common_avg_to_subject=determinants_from_common_avg_to_subject,
#                                             determinants_from_subject_common_to_subject

    #chain_stages = chain(options).stages

    execute(chain_result.stages, options)