How to use the clinica.engine.CmdParser 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 / machine_learning_spatial_svm / spatial_svm_cli.py View on Github external
# coding: utf8

import clinica.engine as ce


class SpatialSVMCLI(ce.CmdParser):

    def define_name(self):
        """Define the sub-command name to run this pipeline."""
        self._name = 'machinelearning-prepare-spatial-svm'

    def define_description(self):
        """Define a description of this pipeline."""
        self._description = ('Prepare input data for SVM with spatial and anatomical regularization:\n'
                             'http://clinica.run/doc/MachineLeaning_PrepareSpatialSVM')

    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("caps_directory",
github aramis-lab / clinica / clinica / pipelines / statistics_surface / statistics_surface_cli.py View on Github external
# coding: utf8

import clinica.engine as ce


class StatisticsSurfaceCLI(ce.CmdParser):

    def define_name(self):
        """Define the sub-command name to run this pipeline."""
        self._name = 'statistics-surface'

    def define_description(self):
        """Define a description of this pipeline."""
        self._description = ('Surface-based mass-univariate analysis with SurfStat:\n'
                             'http://clinica.run/doc/Pipelines/Stats_Surface/')

    def define_options(self):
        """Define the sub-command arguments."""
        from clinica.engine.cmdparser import PIPELINE_CATEGORIES
        from colorama import Fore
        # Clinica compulsory arguments (e.g. BIDS, CAPS, group_id)
        clinica_comp = self._args.add_argument_group('%sMandatory arguments%s' % (Fore.BLUE , Fore.RESET))
github aramis-lab / clinica / clinica / pipelines / machine_learning / machinelearning_svm_cli.py View on Github external
self.absolute_path(args.diagnoses_tsv),
            prefix=args.prefix,
            mask_zeros=args.mask_zeros,
            balanced=args.balanced,
            outer_folds=args.cv_folds,
            inner_folds=args.folds_c,
            n_threads=args.n_procs,
            c_range=c_range,
            save_gram_matrix=args.save_gram_matrix,
            save_subject_classification=args.save_subject_classification,
            save_original_weights=args.save_original_weights,
            save_features_image=args.save_features_image
        )


class CmdParserMachineLearningSVMRB(ce.CmdParser):

    def define_name(self):
        self._name = 'machinelearning-svm-region'

    def define_description(self):
        self._description = 'Classification based on machine learning (Region-based)\n: http://clinica.run/doc/Pipelines/MachineLearning_Classification/'

    def define_options(self):
        self._args.add_argument("image_type",
                                help='it can assume two values: pet/t1, according to the images used')  # noqa
        self._args.add_argument("caps_directory",
                                help='Directory where the input NIFTI images are stored')  # noqa
        self._args.add_argument("group_id",
                                help='Current group name')  # noqa
        self._args.add_argument("diagnosis_tsv",
                                help='TSV file with subjects diagnosis')  # noqa
github aramis-lab / clinica / clinica / pipelines / t1_freesurfer / t1_freesurfer_visualizer.py View on Github external
# coding: utf8

import clinica.engine as ce


class T1FreeSurferVisualizer(ce.CmdParser):

    def define_name(self):
        """Define the sub-command name to run this pipelines.
        """
        self._name = 't1-freesurfer'

    def define_description(self):
        """Define a description of this pipeline.
        """
        self._description = 'Cross-sectional pre-processing of T1w images with FreeSurfer:\nhttp://clinica.run/doc/Pipelines/T1_FreeSurfer/'

    def define_options(self):
        """Define the sub-command arguments
        """
        from clinica.engine.cmdparser import PIPELINE_CATEGORIES
github aramis-lab / clinica / clinica / pipelines / fmri_preprocessing / fmri_preprocessing_cli.py View on Github external
# coding: utf8

import clinica.engine as ce


class fMRIPreprocessingCLI(ce.CmdParser):

    def define_name(self):
        """Define the sub-command name to run this pipeline."""
        self._name = 'fmri-preprocessing'

    def define_description(self):
        """Define a description of this pipeline."""
        self._description = ('Preprocessing of raw fMRI datasets:\n'
                             'http://clinica.run/doc/Pipelines/fMRI_Preprocessing/')

    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",