Esempio n. 1
0
def main():

    # initialization
    param = ParamMoco(group_size=1, metric='MeanSquares', smooth='0')

    # Fetch user arguments
    parser = get_parser()
    arguments = parser.parse(sys.argv[1:])
    param.fname_data = arguments['-i']
    if '-g' in arguments:
        param.group_size = arguments['-g']
    if '-m' in arguments:
        param.fname_mask = arguments['-m']
    if '-param' in arguments:
        param.update(arguments['-param'])
    if '-x' in arguments:
        param.interp = arguments['-x']
    if '-ofolder' in arguments:
        param.path_out = arguments['-ofolder']
    if '-r' in arguments:
        param.remove_temp_files = int(arguments['-r'])
    param.verbose = int(arguments.get('-v'))

    # Update log level
    sct.init_sct(log_level=param.verbose, update=True)

    # run moco
    moco_wrapper(param)
def main():

    # initialization
    param = ParamMoco(is_diffusion=True, group_size=3, metric='MI', smooth='1')

    # Fetch user arguments
    parser = get_parser()
    arguments = parser.parse(sys.argv[1:])
    param.fname_data = arguments['-i']
    param.fname_bvecs = os.path.abspath(arguments['-bvec'])
    if '-bval' in arguments:
        param.fname_bvals = os.path.abspath(arguments['-bval'])
    if '-bvalmin' in arguments:
        param.bval_min = arguments['-bvalmin']
    if '-g' in arguments:
        param.group_size = arguments['-g']
    if '-m' in arguments:
        param.fname_mask = arguments['-m']
    if '-param' in arguments:
        param.update(arguments['-param'])
    if '-x' in arguments:
        param.interp = arguments['-x']
    if '-ofolder' in arguments:
        param.path_out = arguments['-ofolder']
    if '-r' in arguments:
        param.remove_temp_files = int(arguments['-r'])
    param.verbose = int(arguments.get('-v'))

    # Update log level
    sct.init_sct(log_level=param.verbose, update=True)

    # run moco
    moco_wrapper(param)
def main():

    # initialization
    param = ParamMoco(group_size=1, metric='MeanSquares', smooth='0')

    # Fetch user arguments
    parser = get_parser()
    arguments = parser.parse_args(args=None if sys.argv[1:] else ['--help'])
    param.fname_data = arguments.i
    param.path_out = arguments.ofolder
    param.remove_temp_files = arguments.r
    param.interp = arguments.x
    if arguments.g is not None:
        param.group_size = arguments.g
    if arguments.m is not None:
        param.fname_mask = arguments.m
    if arguments.param is not None:
        param.update(arguments.param)
    param.verbose = int(arguments.v)

    # Update log level
    init_sct(log_level=param.verbose, update=True)

    # run moco
    moco_wrapper(param)
def main():

    # initialization
    param = ParamMoco(is_diffusion=True, group_size=3, metric='MI', smooth='1')

    # Fetch user arguments
    parser = get_parser()
    arguments = parser.parse_args(args=None if sys.argv[1:] else ['--help'])
    param.fname_data = arguments.i
    param.fname_bvecs = os.path.abspath(arguments.bvec)
    param.fname_bvals = arguments.bval
    param.bval_min = arguments.bvalmin
    param.group_size = arguments.g
    param.fname_mask = arguments.m
    param.interp = arguments.x
    param.path_out = arguments.ofolder
    param.remove_temp_files = arguments.r
    if arguments.param is not None:
        param.update(arguments.param)
    param.verbose = int(arguments.v)

    # Update log level
    init_sct(log_level=param.verbose, update=True)

    # run moco
    moco_wrapper(param)
Esempio n. 5
0
def main(argv=None):
    parser = get_parser()
    arguments = parser.parse_args(argv)
    verbose = arguments.v
    set_global_loglevel(verbose=verbose)

    # initialization
    param = ParamMoco(is_diffusion=True, group_size=3, metric='MI', smooth='1')

    # Fetch user arguments
    param.fname_data = arguments.i
    param.fname_bvecs = arguments.bvec
    param.fname_bvals = arguments.bval
    param.bval_min = arguments.bvalmin
    param.group_size = arguments.g
    param.fname_mask = arguments.m
    param.interp = arguments.x
    param.path_out = arguments.ofolder
    param.remove_temp_files = arguments.r
    if arguments.param is not None:
        param.update(arguments.param)

    path_qc = arguments.qc
    qc_fps = arguments.qc_fps
    qc_dataset = arguments.qc_dataset
    qc_subject = arguments.qc_subject
    qc_seg = arguments.qc_seg

    mutually_inclusive_args = (path_qc, qc_seg)
    is_qc_none, is_seg_none = [arg is None for arg in mutually_inclusive_args]
    if not (is_qc_none == is_seg_none):
        raise parser.error(
            "Both '-qc' and '-qc-seg' are required in order to generate a QC report."
        )

    # run moco
    fname_output_image = moco_wrapper(param)

    set_global_loglevel(
        verbose)  # moco_wrapper changes verbose to 0, see issue #3341

    # QC report
    if path_qc is not None:
        generate_qc(fname_in1=fname_output_image,
                    fname_in2=param.fname_data,
                    fname_seg=qc_seg,
                    args=sys.argv[1:],
                    path_qc=os.path.abspath(path_qc),
                    fps=qc_fps,
                    dataset=qc_dataset,
                    subject=qc_subject,
                    process='sct_dmri_moco')

    display_viewer_syntax([fname_output_image, param.fname_data],
                          mode='ortho,ortho')
def main(argv=None):
    parser = get_parser()
    arguments = parser.parse_args(argv)
    verbose = arguments.v
    set_global_loglevel(verbose=verbose)

    # initialization
    param = ParamMoco(group_size=1, metric='MeanSquares', smooth='0')

    # Fetch user arguments
    param.fname_data = arguments.i
    param.path_out = arguments.ofolder
    param.remove_temp_files = arguments.r
    param.interp = arguments.x
    if arguments.g is not None:
        param.group_size = arguments.g
    if arguments.m is not None:
        param.fname_mask = arguments.m
    if arguments.param is not None:
        param.update(arguments.param)

    # run moco
    moco_wrapper(param)
def main(argv=None):
    parser = get_parser()
    arguments = parser.parse_args(argv)
    verbose = arguments.v
    set_global_loglevel(verbose=verbose)

    # initialization
    param = ParamMoco(is_diffusion=True, group_size=3, metric='MI', smooth='1')

    # Fetch user arguments
    param.fname_data = arguments.i
    param.fname_bvecs = os.path.abspath(arguments.bvec)
    param.fname_bvals = arguments.bval
    param.bval_min = arguments.bvalmin
    param.group_size = arguments.g
    param.fname_mask = arguments.m
    param.interp = arguments.x
    param.path_out = arguments.ofolder
    param.remove_temp_files = arguments.r
    if arguments.param is not None:
        param.update(arguments.param)

    # run moco
    moco_wrapper(param)