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)

    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_fmri_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 get_parser():

    # initialize parameters
    param_default = ParamMoco(is_diffusion=True,
                              group_size=3,
                              metric='MI',
                              smooth='1')

    # Initialize the parser
    parser = Parser(__file__)
    parser.usage.set_description(
        '  Motion correction of dMRI data. Some of the features to improve robustness were proposed in Xu et al. (http://dx.doi.org/10.1016/j.neuroimage.2012.11.014) and include:\n'
        '- group-wise (-g)\n'
        '- slice-wise regularized along z using polynomial function (-param). For more info about the method, type: isct_antsSliceRegularizedRegistration\n'
        '- masking (-m)\n'
        '- iterative averaging of target volume\n')
    parser.add_option(name='-i',
                      type_value='file',
                      description='Diffusion data',
                      mandatory=True,
                      example='dmri.nii.gz')
    parser.add_option(name='-bvec',
                      type_value='file',
                      description='Bvecs file',
                      mandatory=True,
                      example='bvecs.nii.gz')
    parser.add_option(name='-bval',
                      type_value='file',
                      description='Bvals file',
                      mandatory=False,
                      example='bvals.nii.gz')
    parser.add_option(
        name='-bvalmin',
        type_value='float',
        description=
        'B-value threshold (in s/mm2) below which data is considered as b=0.',
        mandatory=False,
        example='50')
    parser.add_option(
        name='-g',
        type_value='int',
        description='Group nvols successive dMRI volumes for more robustness.',
        mandatory=False,
        default_value=param_default.group_size,
        example=['2'])
    parser.add_option(
        name='-m',
        type_value='file',
        description=
        'Binary mask to limit voxels considered by the registration metric.',
        mandatory=False,
        example=['dmri_mask.nii.gz'])
    parser.add_option(
        name='-param',
        type_value=[[','], 'str'],
        description=
        "Advanced parameters. Assign value with \"=\"; Separate arguments with \",\"\n"
        "poly [int]: Degree of polynomial function used for regularization along Z. For no regularization set to 0. Default="
        + param_default.poly + ".\n"
        "smooth [mm]: Smoothing kernel. Default=" + param_default.smooth +
        ".\n"
        "metric {MI, MeanSquares, CC}: Metric used for registration. Default="
        + param_default.metric + ".\n"
        "gradStep [float]: Searching step used by registration algorithm. The higher the more deformation allowed. Default="
        + param_default.gradStep + ".\n"
        "sample [None or 0-1]: Sampling rate used for registration metric. Default="
        + param_default.sampling + ".\n",
        mandatory=False)
    parser.add_option(name='-x',
                      type_value='multiple_choice',
                      description='Final Interpolation.',
                      mandatory=False,
                      default_value=param_default.interp,
                      example=['nn', 'linear', 'spline'])
    parser.add_option(name='-ofolder',
                      type_value='folder_creation',
                      description='Output folder',
                      mandatory=False,
                      default_value=param_default.path_out,
                      example='dmri_moco_results/')
    parser.usage.addSection('MISC')
    parser.add_option(name="-r",
                      type_value="multiple_choice",
                      description='Remove temporary files.',
                      mandatory=False,
                      default_value='1',
                      example=['0', '1'])
    parser.add_option(
        name="-v",
        type_value='multiple_choice',
        description="verbose: 0 = nothing, 1 = classic, 2 = expended",
        mandatory=False,
        example=['0', '1', '2'],
        default_value='1')
    return parser
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 get_parser():
    # initialize parameters
    # TODO: create a class ParamFmriMoco which inheritates from ParamMoco
    param_default = ParamMoco(group_size=1, metric='MeanSquares', smooth='0')

    # parser initialisation
    parser = SCTArgumentParser(
        description=
        "Motion correction of fMRI data. Some robust features include:\n"
        "  - group-wise (-g)\n"
        "  - slice-wise regularized along z using polynomial function (-p)\n"
        "    (For more info about the method, type: isct_antsSliceRegularizedRegistration)\n"
        "  - masking (-m)\n"
        "  - iterative averaging of target volume\n"
        "\n"
        "The outputs of the motion correction process are:\n"
        "  - the motion-corrected fMRI volumes\n"
        "  - the time average of the corrected fMRI volumes\n"
        "  - a time-series with 1 voxel in the XY plane, for the X and Y motion direction (two separate "
        "files), as required for FSL analysis.\n"
        "  - a TSV file with the slice-wise average of the motion correction for XY (one file), that "
        "can be used for Quality Control.\n")

    mandatory = parser.add_argument_group("\nMANDATORY ARGUMENTS")
    mandatory.add_argument('-i',
                           metavar=Metavar.file,
                           required=True,
                           help="Input data (4D). Example: fmri.nii.gz")
    optional = parser.add_argument_group("\nOPTIONAL ARGUMENTS")
    optional.add_argument("-h",
                          "--help",
                          action="help",
                          help="Show this help message and exit.")
    optional.add_argument(
        '-g',
        metavar=Metavar.int,
        type=int,
        help="Group nvols successive fMRI volumes for more robustness.")
    optional.add_argument(
        '-m',
        metavar=Metavar.file,
        help=
        "Binary mask to limit voxels considered by the registration metric.")
    optional.add_argument(
        '-param',
        metavar=Metavar.list,
        type=list_type(',', str),
        help=
        f"Advanced parameters. Assign value with \"=\"; Separate arguments with \",\".\n"
        f"  - poly [int]: Degree of polynomial function used for regularization along Z. For no regularization "
        f"set to 0. Default={param_default.poly}.\n"
        f"  - smooth [mm]: Smoothing kernel. Default={param_default.smooth}.\n"
        f"  - iter [int]: Number of iterations. Default={param_default.iter}.\n"
        f"  - metric {{MI, MeanSquares, CC}}: Metric used for registration. Default={param_default.metric}.\n"
        f"  - gradStep [float]: Searching step used by registration algorithm. The higher the more deformation "
        f"allowed. Default={param_default.gradStep}.\n"
        f"  - sampling [None or 0-1]: Sampling rate used for registration metric. "
        f"Default={param_default.sampling}.\n"
        f"  - numTarget [int]: Target volume or group (starting with 0). Default={param_default.num_target}.\n"
        f"  - iterAvg [int]: Iterative averaging: Target volume is a weighted average of the "
        f"previously-registered volumes. Default={param_default.iterAvg}.\n")
    optional.add_argument('-ofolder',
                          metavar=Metavar.folder,
                          action=ActionCreateFolder,
                          default='.',
                          help="Output path.")
    optional.add_argument('-x',
                          choices=['nn', 'linear', 'spline'],
                          default='linear',
                          help="Final interpolation.")
    optional.add_argument('-r',
                          metavar=Metavar.int,
                          type=int,
                          choices=[0, 1],
                          default=1,
                          help="Remove temporary files. O = no, 1 = yes")
    optional.add_argument(
        '-v',
        metavar=Metavar.int,
        type=int,
        choices=[0, 1, 2],
        default=1,
        # Values [0, 1, 2] map to logging levels [WARNING, INFO, DEBUG], but are also used as "if verbose == #" in API
        help=
        "Verbosity. 0: Display only errors/warnings, 1: Errors/warnings + info messages, 2: Debug mode"
    )
    optional.add_argument(
        '-qc',
        metavar=Metavar.folder,
        action=ActionCreateFolder,
        help=
        "The path where the quality control generated content will be saved. (Note: "
        "Both '-qc' and '-qc-seg' are required in order to generate a QC report.)"
    )
    optional.add_argument(
        '-qc-seg',
        metavar=Metavar.file,
        help=
        "Segmentation of spinal cord to improve cropping in qc report. (Note: "
        "Both '-qc' and '-qc-seg' are required in order to generate a QC report.)"
    )
    optional.add_argument(
        '-qc-fps',
        metavar=Metavar.float,
        type=float,
        default=3,
        help=
        "This float number is the number of frames per second for the output gif images."
    )
    optional.add_argument(
        '-qc-dataset',
        metavar=Metavar.str,
        help=
        "If provided, this string will be mentioned in the QC report as the dataset the process was run on."
    )
    optional.add_argument(
        '-qc-subject',
        metavar=Metavar.str,
        help=
        "If provided, this string will be mentioned in the QC report as the subject the process was run on."
    )

    return parser
Beispiel #6
0
def get_parser():
    # parser initialisation
    parser = Parser(__file__)

    # initialize parameters
    # TODO: create a class ParamFmriMoco which inheritates from ParamMoco
    param_default = ParamMoco(group_size=1, metric='MeanSquares', smooth='0')

    parser.usage.set_description(
        """Motion correction of fMRI data. Some robust features include:
  - group-wise (-g)
  - slice-wise regularized along z using polynomial function (-p)
    For more info about the method, type: isct_antsSliceRegularizedRegistration
  - masking (-m)
  - iterative averaging of target volume
The outputs of the motion correction process are:
  - the motion-corrected fMRI volumes
  - the time average of the corrected fMRI volumes
  - a time-series with 1 voxel in the XY plane, for the X and Y motion direction (two separate files), as required for FSL analysis.
  - a TSV file with the slice-wise average of the motion correction for XY (one file), that can be used for Quality Control."""
    )
    parser.add_option(name='-i',
                      type_value='image_nifti',
                      description='4D data',
                      mandatory=True,
                      example='fmri.nii.gz')
    parser.add_option(
        name='-g',
        type_value='int',
        description='Group nvols successive fMRI volumes for more robustness.',
        mandatory=False,
        default_value=param_default.group_size)
    parser.add_option(
        name='-m',
        type_value='image_nifti',
        description=
        'Binary mask to limit voxels considered by the registration metric.',
        mandatory=False)
    parser.add_option(
        name='-param',
        type_value=[[','], 'str'],
        description=
        "Advanced parameters. Assign value with \"=\"; Separate arguments with \",\"\n"
        "poly [int]: Degree of polynomial function used for regularization along Z. For no regularization set to 0. Default="
        + param_default.poly + ".\n"
        "smooth [mm]: Smoothing kernel. Default=" + param_default.smooth +
        ".\n"
        "iter [int]: Number of iterations. Default=" + param_default.iter +
        ".\n"
        "metric {MI, MeanSquares, CC}: Metric used for registration. Default="
        + param_default.metric + ".\n"
        "gradStep [float]: Searching step used by registration algorithm. The higher the more deformation allowed. Default="
        + param_default.gradStep + ".\n"
        "sampling [None or 0-1]: Sampling rate used for registration metric. Default="
        + param_default.sampling + ".\n"
        "numTarget [int]: Target volume or group (starting with 0). Default=" +
        param_default.num_target + ".\n"
        "iterAvg [int]: Iterative averaging: Target volume is a weighted average of the previously-registered volumes. Default="
        + str(param_default.iterAvg) + ".\n",
        mandatory=False)
    parser.add_option(name='-ofolder',
                      type_value='folder_creation',
                      description='Output path.',
                      mandatory=False,
                      default_value='./')
    parser.add_option(name="-x",
                      type_value="multiple_choice",
                      description="""Final interpolation.""",
                      mandatory=False,
                      default_value='linear',
                      example=['nn', 'linear', 'spline'])
    parser.add_option(name="-r",
                      type_value="multiple_choice",
                      description="""Remove temporary files.""",
                      mandatory=False,
                      default_value='1',
                      example=['0', '1'])
    parser.add_option(name="-v",
                      type_value="multiple_choice",
                      description="""Verbose.""",
                      mandatory=False,
                      default_value='1',
                      example=['0', '1', '2'])

    return parser
Beispiel #7
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 get_parser():
    # initialize parameters
    # TODO: create a class ParamFmriMoco which inheritates from ParamMoco
    param_default = ParamMoco(group_size=1, metric='MeanSquares', smooth='0')

    # parser initialisation
    parser = argparse.ArgumentParser(
        description=
        "Motion correction of fMRI data. Some robust features include:\n"
        "  - group-wise (-g)\n"
        "  - slice-wise regularized along z using polynomial function (-p)\n"
        "    (For more info about the method, type: isct_antsSliceRegularizedRegistration)\n"
        "  - masking (-m)\n"
        "  - iterative averaging of target volume\n"
        "\n"
        "The outputs of the motion correction process are:\n"
        "  - the motion-corrected fMRI volumes\n"
        "  - the time average of the corrected fMRI volumes\n"
        "  - a time-series with 1 voxel in the XY plane, for the X and Y motion direction (two separate "
        "files), as required for FSL analysis.\n"
        "  - a TSV file with the slice-wise average of the motion correction for XY (one file), that "
        "can be used for Quality Control.\n",
        formatter_class=SmartFormatter,
        add_help=None,
        prog=os.path.basename(__file__).strip(".py"))

    mandatory = parser.add_argument_group("\nMANDATORY ARGUMENTS")
    mandatory.add_argument('-i',
                           metavar=Metavar.file,
                           required=True,
                           help="Input data (4D). Example: fmri.nii.gz")
    optional = parser.add_argument_group("\nOPTIONAL ARGUMENTS")
    optional.add_argument("-h",
                          "--help",
                          action="help",
                          help="Show this help message and exit.")
    optional.add_argument(
        '-g',
        metavar=Metavar.int,
        type=int,
        help="Group nvols successive fMRI volumes for more robustness.")
    optional.add_argument(
        '-m',
        metavar=Metavar.file,
        help=
        "Binary mask to limit voxels considered by the registration metric.")
    optional.add_argument(
        '-param',
        metavar=Metavar.list,
        type=list_type(',', str),
        help=
        f"R|Advanced parameters. Assign value with \"=\"; Separate arguments with \",\".\n"
        f"  - poly [int]: Degree of polynomial function used for regularization along Z. For no regularization "
        f"set to 0. Default={param_default.poly}.\n"
        f"  - smooth [mm]: Smoothing kernel. Default={param_default.smooth}.\n"
        f"  - iter [int]: Number of iterations. Default={param_default.iter}.\n"
        f"  - metric {{MI, MeanSquares, CC}}: Metric used for registration. Default={param_default.metric}.\n"
        f"  - gradStep [float]: Searching step used by registration algorithm. The higher the more deformation "
        f"allowed. Default={param_default.gradStep}.\n"
        f"  - sampling [None or 0-1]: Sampling rate used for registration metric. "
        f"Default={param_default.sampling}.\n"
        f"  - numTarget [int]: Target volume or group (starting with 0). Default={param_default.num_target}.\n"
        f"  - iterAvg [int]: Iterative averaging: Target volume is a weighted average of the "
        f"previously-registered volumes. Default={param_default.iterAvg}.\n")
    optional.add_argument('-ofolder',
                          metavar=Metavar.folder,
                          action=ActionCreateFolder,
                          default='./',
                          help="Output path.")
    optional.add_argument('-x',
                          choices=['nn', 'linear', 'spline'],
                          default='linear',
                          help="Final interpolation.")
    optional.add_argument('-r',
                          metavar=Metavar.int,
                          type=int,
                          choices=[0, 1],
                          default=1,
                          help="Remove temporary files. O = no, 1 = yes")
    optional.add_argument(
        '-v',
        choices=['0', '1', '2'],
        default='1',
        help="Verbose: 0 = nothing, 1 = basic, 2 = extended.")

    return parser
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 get_parser():

    # initialize parameters
    param_default = ParamMoco(is_diffusion=True,
                              group_size=3,
                              metric='MI',
                              smooth='1')

    parser = SCTArgumentParser(
        description=
        "Motion correction of dMRI data. Some of the features to improve robustness were proposed in Xu et "
        "al. (http://dx.doi.org/10.1016/j.neuroimage.2012.11.014) and include:\n"
        "  - group-wise (-g)\n"
        "  - slice-wise regularized along z using polynomial function (-param). For more info about the "
        "method, type: isct_antsSliceRegularizedRegistration\n"
        "  - masking (-m)\n"
        "  - iterative averaging of target volume\n")

    mandatory = parser.add_argument_group("\nMANDATORY ARGUMENTS")
    mandatory.add_argument('-i',
                           metavar=Metavar.file,
                           required=True,
                           help="Diffusion data. Example: dmri.nii.gz")
    mandatory.add_argument('-bvec',
                           metavar=Metavar.file,
                           required=True,
                           help='Bvecs file. Example: bvecs.txt')

    optional = parser.add_argument_group("\nOPTIONAL ARGUMENTS")
    optional.add_argument("-h",
                          "--help",
                          action="help",
                          help="Show this help message and exit.")
    optional.add_argument(
        '-bval',
        metavar=Metavar.file,
        default=param_default.fname_bvals,
        help='Bvals file. Example: bvals.nii.gz',
    )
    optional.add_argument(
        '-bvalmin',
        type=float,
        metavar=Metavar.float,
        default=param_default.bval_min,
        help=
        'B-value threshold (in s/mm2) below which data is considered as b=0. Example: 50.0',
    )
    optional.add_argument(
        '-g',
        type=int,
        metavar=Metavar.int,
        default=param_default.group_size,
        help=
        'Group nvols successive dMRI volumes for more robustness. Example: 2',
    )
    optional.add_argument(
        '-m',
        metavar=Metavar.file,
        default=param_default.fname_mask,
        help=
        'Binary mask to limit voxels considered by the registration metric. Example: dmri_mask.nii.gz',
    )
    optional.add_argument(
        '-param',
        metavar=Metavar.list,
        type=list_type(',', str),
        help=
        f"R|Advanced parameters. Assign value with \"=\", and separate arguments with \",\".\n"
        f"  - poly [int]: Degree of polynomial function used for regularization along Z. For no regularization "
        f"set to 0. Default={param_default.poly}.\n"
        f"  - smooth [mm]: Smoothing kernel. Default={param_default.smooth}.\n"
        f"  - metric {{MI, MeanSquares, CC}}: Metric used for registration. Default={param_default.metric}.\n"
        f"  - gradStep [float]: Searching step used by registration algorithm. The higher the more deformation "
        f"allowed. Default={param_default.gradStep}.\n"
        f"  - sample [None or 0-1]: Sampling rate used for registration metric. "
        f"Default={param_default.sampling}.\n")
    optional.add_argument('-x',
                          choices=['nn', 'linear', 'spline'],
                          default=param_default.interp,
                          help="Final interpolation.")
    optional.add_argument('-ofolder',
                          metavar=Metavar.folder,
                          action=ActionCreateFolder,
                          default=param_default.path_out,
                          help="Output folder. Example: dmri_moco_results/")
    optional.add_argument("-r",
                          choices=('0', '1'),
                          default=param_default.remove_temp_files,
                          help="Remove temporary files. 0 = no, 1 = yes")
    optional.add_argument(
        '-v',
        metavar=Metavar.int,
        type=int,
        choices=[0, 1, 2],
        default=1,
        # Values [0, 1, 2] map to logging levels [WARNING, INFO, DEBUG], but are also used as "if verbose == #" in API
        help=
        "Verbosity. 0: Display only errors/warnings, 1: Errors/warnings + info messages, 2: Debug mode"
    )
    return parser
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)
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)