How to use the clinica.engine.cmdparser.PIPELINE_CATEGORIES function in clinica

To help you get started, we’ve selected a few clinica examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aramis-lab / clinica / clinica / pipelines / t1_freesurfer / t1_freesurfer_cli.py View on Github external
def define_options(self):
        """Define the sub-command arguments."""
        from clinica.engine.cmdparser import PIPELINE_CATEGORIES
        # Clinica compulsory arguments (e.g. BIDS, CAPS, group_id)
        clinica_comp = self._args.add_argument_group(PIPELINE_CATEGORIES['CLINICA_COMPULSORY'])
        clinica_comp.add_argument("bids_directory",
                                  help='Path to the BIDS directory.')
        clinica_comp.add_argument("caps_directory",
                                  help='Path to the CAPS directory.')

        # Optional arguments (e.g. FWHM)
        optional = self._args.add_argument_group(PIPELINE_CATEGORIES['OPTIONAL'])
        optional.add_argument("-raa", "--recon_all_args",
                              metavar='flag(s)', type=str, default="-qcache",
                              help='Additional flags for recon-all command line '
                                   '(default: --recon_all_args="%(default)s"). '
                                   'Please note that = is compulsory after --recon_all_args/-raa flag '
                                   '(this is not the case for other flags).')

        # Clinica standard arguments (e.g. --n_procs)
        self.add_clinica_standard_arguments(add_overwrite_flag=True)
github aramis-lab / clinica / clinica / pipelines / machine_learning_spatial_svm / spatial_svm_cli.py View on Github external
# Clinica compulsory arguments (e.g. BIDS, CAPS, group_id)
        clinica_comp = self._args.add_argument_group(PIPELINE_CATEGORIES['CLINICA_COMPULSORY'])
        clinica_comp.add_argument("caps_directory",
                                  help='Path to the CAPS directory.')
        clinica_comp.add_argument("group_id",
                                  help='User-defined identifier for the provided group of subjects.')
        # Optional arguments
        optional = self._args.add_argument_group(PIPELINE_CATEGORIES['OPTIONAL'])
        optional.add_argument("-it", "--image_type", default='t1',
                              help='Imaging modality. Can be t1 or pet (default: --image_type t1)')
        optional.add_argument("-pt", "--pet_tracer", default='FDG',
                              help='PET tracer. Can be fdg or av45 (default: --pet_tracer fdg)')
        # Clinica standard arguments (e.g. --n_procs)
        self.add_clinica_standard_arguments()
        # Advanced arguments (i.e. tricky parameters)
        advanced = self._args.add_argument_group(PIPELINE_CATEGORIES['ADVANCED'])
        advanced.add_argument("-fwhm", "--full_width_half_maximum", type=float, default=4,
                              help='Amount of regularization (in mm). In practice, we found the default value '
                                   '(--full_width_half_maximum 4) to be optimal. We therefore do not recommend '
                                   'to change it unless you have a specific reason to do so.')
        advanced.add_argument("-no_pvc", "--no_pvc",
                              action='store_true', default='False',
                              help="Force the use of non PVC PET data (by default, PVC PET data are used)")
github aramis-lab / clinica / clinica / pipelines / fmri_preprocessing / fmri_preprocessing_cli.py View on Github external
def define_options(self):
        """Define the sub-command arguments."""
        from clinica.engine.cmdparser import PIPELINE_CATEGORIES
        # Clinica compulsory arguments (e.g. BIDS, CAPS, group_id)
        clinica_comp = self._args.add_argument_group(PIPELINE_CATEGORIES['CLINICA_COMPULSORY'])
        clinica_comp.add_argument("bids_directory",
                                  help='Path to the BIDS directory.')
        clinica_comp.add_argument("caps_directory",
                                  help='Path to the CAPS directory.')

        # Optional arguments (e.g. FWHM)
        optional = self._args.add_argument_group(PIPELINE_CATEGORIES['OPTIONAL'])
        optional.add_argument("-fwhm", "--full_width_at_half_maximum",
                              metavar="FWHM",
                              nargs=3, type=int, default=[8, 8, 8],
                              help="A list of integers specifying the full width at half maximum (FWHM) filter size "
                                   "in the three directions x y z, in millimeters, used to smooth the images "
                                   "(default: --full_width_at_half_maximum 8 8 8).")
        optional.add_argument("-t1s", "--t1_native_space", action='store_true',
                              help="When specified, the corrected fMRI data registered to the native T1 space "
                                   "of each subject are saved. This might be useful when dealing with "
github aramis-lab / clinica / clinica / pipelines / dwi_processing_noddi / dwi_processing_noddi_cli.py View on Github external
def define_options(self):
        """Define the sub-command arguments
        """

        from clinica.engine.cmdparser import PIPELINE_CATEGORIES

        clinica_comp = self._args.add_argument_group(PIPELINE_CATEGORIES['CLINICA_COMPULSORY'])

        clinica_comp.add_argument("caps_directory",
                                help='Path to the CAPS directory.')
        clinica_comp.add_argument("list_bvalues", type=str,
                                help='String listing all the shells (i.e. the b-values) in the corrected DWI datasets comma separated (e.g, 0,300,700,2200)')
        # Optional arguments
        clinica_opt = self._args.add_argument_group(PIPELINE_CATEGORIES['CLINICA_OPTIONAL'])

        clinica_opt.add_argument("-wd", "--working_directory",
                                help='Temporary directory to store pipeline intermediate results')
        clinica_opt.add_argument("-np", "--n_procs", type=int, default=4,
                                help='Number of cores used to run in parallel')
        clinica_opt.add_argument("-tsv", "--subjects_sessions_tsv",
                                 help='TSV file containing a list of subjects with their sessions.')
github aramis-lab / clinica / clinica / pipelines / dwi_preprocessing_noddi / dwi_preprocessing_noddi_cli.py View on Github external
help='Path to the BIDS directory.')
        clinica_comp.add_argument("caps_directory",
                                help='Path to the CAPS directory.')
        clinica_comp.add_argument("echo_spacing", type=float,
                                help='The echo spacing such that EffectiveEchoSpacing=echo_spacing/acceleration_factor (see BIDS specifications and https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/topup/Faq for details).')
        clinica_comp.add_argument("acceleration_factor", type=int,
                                help='Acceleration factor such that EffectiveEchoSpacing=echo_spacing/acceleration_factor (see BIDS specifications and https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/topup/Faq for details).')
        clinica_comp.add_argument("phase_encoding_direction", type=str,
                                help='Phase encoding direction using FSL convention (e.g. y- or y). Be careful, this is currently not the BIDS convention (i.e. j- or j).')
        clinica_comp.add_argument("phase_encoding_direction_alternative", type=str,
                                help='The opposite phase encoding direction (e.g. if phase_encoding_direction is y- then phase_encoding_direction_alternative will be y).')
        clinica_comp.add_argument("epi_factor", type=int,
                                help='EPI factor (e.g. 128) used for the computation of the TotalReadoutTime (see https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/eddy/Faq for details)')

        # Optional arguments
        clinica_opt = self._args.add_argument_group(PIPELINE_CATEGORIES['CLINICA_OPTIONAL'])
        clinica_opt.add_argument("-wd", "--working_directory",
                                help='Temporary directory to store pipeline intermediate results')
        clinica_opt.add_argument("-np", "--n_procs", type=int,
                                help='Number of cores used to run in parallel')
        clinica_opt.add_argument("-tsv", "--subjects_sessions_tsv",
                                help='TSV file containing a list of subjects with their sessions.')
github aramis-lab / clinica / clinica / pipelines / t1_volume_existing_dartel / t1_volume_existing_dartel_cli.py View on Github external
def define_options(self):
        """Define the sub-command arguments."""
        from clinica.engine.cmdparser import PIPELINE_CATEGORIES
        # Clinica compulsory arguments (e.g. BIDS, CAPS, group_id)
        clinica_comp = self._args.add_argument_group(PIPELINE_CATEGORIES['CLINICA_COMPULSORY'])
        clinica_comp.add_argument("bids_directory",
                                  help='Path to the BIDS directory.')
        clinica_comp.add_argument("caps_directory",
                                  help='Path to the CAPS directory.')
        clinica_comp.add_argument("group_id",
                                  help='User-defined identifier for the provided group of subjects.')
        # Optional arguments (e.g. FWHM)
        optional = self._args.add_argument_group(PIPELINE_CATEGORIES['OPTIONAL'])
        optional.add_argument("-s", "--smooth",
                              nargs='+', type=int, default=[8],
                              help="A list of integers specifying the different isomorphic FWHM in millimeters "
                                   "to smooth the image (default: --smooth 8).")
        # Clinica standard arguments (e.g. --n_procs)
        self.add_clinica_standard_arguments()
        # Advanced arguments (i.e. tricky parameters)
        advanced = self._args.add_argument_group(PIPELINE_CATEGORIES['ADVANCED'])
        advanced.add_argument("-t", "--tissues", nargs='+', type=int, default=[1, 2, 3], choices=range(1, 7),
                              help='Tissues to create flow fields to DARTEL template '
                                   '(default: GM, WM and CSF i.e. --tissues 1 2 3).')
github aramis-lab / clinica / clinica / pipelines / t1_volume_dartel2mni / t1_volume_dartel2mni_cli.py View on Github external
def define_options(self):
        """Define the sub-command arguments."""
        from clinica.engine.cmdparser import PIPELINE_CATEGORIES
        # Clinica compulsory arguments (e.g. BIDS, CAPS, group_id)
        clinica_comp = self._args.add_argument_group(PIPELINE_CATEGORIES['CLINICA_COMPULSORY'])
        clinica_comp.add_argument("bids_directory",
                                  help='Path to the BIDS directory.')
        clinica_comp.add_argument("caps_directory",
                                  help='Path to the CAPS directory.')
        clinica_comp.add_argument("group_id",
                                  help='User-defined identifier for the provided group of subjects.')
        # Optional arguments (e.g. FWHM)
        optional = self._args.add_argument_group(PIPELINE_CATEGORIES['OPTIONAL'])
        optional.add_argument("-s", "--smooth",
                              nargs='+', type=int, default=[8],
                              help="A list of integers specifying the different isomorphic FWHM in millimeters "
                                   "to smooth the image (default: --smooth 8).")
        # Clinica standard arguments (e.g. --n_procs)
        self.add_clinica_standard_arguments()
        # Advanced arguments (i.e. tricky parameters)
        advanced = self._args.add_argument_group(PIPELINE_CATEGORIES['ADVANCED'])
        advanced.add_argument("-t", "--tissues", nargs='+', type=int, default=[1, 2, 3], choices=range(1, 7),
                              help='Tissues to create flow fields to DARTEL template '
                                   '(default: GM, WM and CSF i.e. --tissues 1 2 3).')
        advanced.add_argument("-m", "--modulate",
                              type=bool, default=True,
                              metavar=('True/False'),
                              help='A boolean. Modulate output images - no modulation preserves concentrations '
                                   '(default: --modulate True).')
github aramis-lab / clinica / clinica / pipelines / t1_volume_create_dartel / t1_volume_create_dartel_cli.py View on Github external
def define_options(self):
        """Define the sub-command arguments."""
        from clinica.engine.cmdparser import PIPELINE_CATEGORIES
        # Clinica compulsory arguments (e.g. BIDS, CAPS, group_id)
        clinica_comp = self._args.add_argument_group(PIPELINE_CATEGORIES['CLINICA_COMPULSORY'])
        clinica_comp.add_argument("bids_directory",
                                  help='Path to the BIDS directory.')
        clinica_comp.add_argument("caps_directory",
                                  help='Path to the CAPS directory.')
        clinica_comp.add_argument("group_id",
                                  help='User-defined identifier for the provided group of subjects.')
        # Clinica standard arguments (e.g. --n_procs)
        self.add_clinica_standard_arguments()
        # Advanced arguments (i.e. tricky parameters)
        advanced = self._args.add_argument_group(PIPELINE_CATEGORIES['ADVANCED'])
        advanced.add_argument("-dt", "--dartel_tissues",
                              metavar='', nargs='+', type=int, default=[1, 2, 3], choices=range(1, 7),
                              help='Tissues to use for DARTEL template calculation '
                                   '(default: GM, WM and CSF i.e. --dartel_tissues 1 2 3).')
github aramis-lab / clinica / clinica / pipelines / t1_volume_existing_template / t1_volume_existing_template_cli.py View on Github external
def define_options(self):
        """Define the sub-command arguments."""
        from clinica.engine.cmdparser import PIPELINE_CATEGORIES
        # Clinica compulsory arguments (e.g. BIDS, CAPS, group_id)
        clinica_comp = self._args.add_argument_group(PIPELINE_CATEGORIES['CLINICA_COMPULSORY'])
        clinica_comp.add_argument("bids_directory",
                                  help='Path to the BIDS directory.')
        clinica_comp.add_argument("caps_directory",
                                  help='Path to the CAPS directory.')
        clinica_comp.add_argument("group_id",
                                  help='User-defined identifier for the provided group of subjects.')
        # Optional arguments (e.g. FWHM)
        optional = self._args.add_argument_group(PIPELINE_CATEGORIES['OPTIONAL'])
        optional.add_argument("-s", "--smooth",
                              nargs='+', type=int, default=[8],
                              help="A list of integers specifying the different isomorphic FWHM in millimeters "
                                   "to smooth the image (default: --smooth 8).")
        # Clinica standard arguments (e.g. --n_procs)
        self.add_clinica_standard_arguments()
        # Advanced arguments (i.e. tricky parameters)
        advanced = self._args.add_argument_group(PIPELINE_CATEGORIES['ADVANCED'])
github aramis-lab / clinica / clinica / pipelines / dwi_preprocessing_using_phasediff_fieldmap / dwi_preprocessing_using_phasediff_fieldmap_cli.py View on Github external
def define_options(self):
        """Define the sub-command arguments."""
        from clinica.engine.cmdparser import PIPELINE_CATEGORIES
        # Clinica compulsory arguments (e.g. BIDS, CAPS, group_id)
        clinica_comp = self._args.add_argument_group(PIPELINE_CATEGORIES['CLINICA_COMPULSORY'])
        clinica_comp.add_argument("bids_directory",
                                  help='Path to the BIDS directory.')
        clinica_comp.add_argument("caps_directory",
                                  help='Path to the CAPS directory.')
        # Optional arguments (e.g. FWHM)
        optional = self._args.add_argument_group(PIPELINE_CATEGORIES['OPTIONAL'])
        optional.add_argument("--low_bval",
                              metavar=('N'), type=int, default=5,
                              help='Define the b0 volumes as all volume bval <= lowbval. (default: --low_bval 5)')
        # Clinica standard arguments (e.g. --n_procs)
        self.add_clinica_standard_arguments()