Beispiel #1
0
    def __init__(self, project_info):
        self.stages = {
            'Segmentation': SegmentationStage(),
            'Parcellation': ParcellationStage(pipeline_mode="Diffusion"),
            'Preprocessing': PreprocessingStage(),
            'Registration': RegistrationStage(pipeline_mode="Diffusion"),
            'Diffusion': DiffusionStage(),
            'MRTrixConnectome': MRTrixConnectomeStage()
        }

        Pipeline.__init__(self, project_info)

        self.diffusion_imaging_model = project_info.diffusion_imaging_model
        self.subject = project_info.subject

        self.global_conf.subjects = project_info.subjects
        self.global_conf.subject = self.subject

        self.subject_directory = os.path.join(self.base_directory,
                                              self.subject)
        self.derivatives_directory = os.path.join(self.base_directory,
                                                  'derivatives')

        self.stages['Segmentation'].config.on_trait_change(
            self.update_parcellation, 'seg_tool')
        self.stages['Parcellation'].config.on_trait_change(
            self.update_segmentation, 'parcellation_scheme')
    def __init__(self, bids_dir, output_dir):
        """Constructor of the SegmentationStageUI class.

        Parameters
        -----------
        bids_dir : path
            BIDS root directory

        output_dir : path
            Output directory

        See also
        ---------
        cmp.stages.segmentation.segmentation.SegmentationStage.__init_
        cmp.cmpbidsappmanager.stages.segmentation.segmentation.SegmentationStageUI
        """
        SegmentationStage.__init__(self, bids_dir, output_dir)
        self.config = SegmentationConfigUI()
Beispiel #3
0
    def __init__(self, project_info):
        self.stages = {
            'Preprocessing': PreprocessingStage(),
            'Segmentation': SegmentationStage(),
            'Parcellation': ParcellationStage(pipeline_mode="Diffusion"),
            'Registration': RegistrationStage(pipeline_mode="Diffusion"),
            'Diffusion': DiffusionStage(),
            'Connectome': ConnectomeStage()
        }

        Pipeline.__init__(self, project_info)

        self.stages['Segmentation'].config.on_trait_change(
            self.update_parcellation, 'seg_tool')
        self.stages['Parcellation'].config.on_trait_change(
            self.update_segmentation, 'parcellation_scheme')
    def __init__(self, project_info):
        """Constructor of an `AnatomicalPipeline` object.

        Parameters
        ----------
        project_info : cmp.project.CMP_Project_Info
            Instance of `CMP_Project_Info` object.

        See Also
        --------
        cmp.project.CMP_Project_Info
        """
        self.global_conf.subjects = project_info.subjects
        self.global_conf.subject = self.subject

        if len(project_info.subject_sessions) > 0:
            self.global_conf.subject_session = project_info.subject_session
            self.subject_directory = os.path.join(project_info.base_directory,
                                                  project_info.subject,
                                                  project_info.subject_session)
            subject_id = "_".join((self.subject, self.global_conf.subject_session))
        else:
            self.global_conf.subject_session = ''
            self.subject_directory = os.path.join(project_info.base_directory, project_info.subject)
            subject_id = self.subject

        self.derivatives_directory = os.path.abspath(project_info.output_directory)
        self.output_directory = os.path.abspath(project_info.output_directory)

        self.stages = {'Segmentation': SegmentationStage(bids_dir=project_info.base_directory,
                                                         output_dir=self.output_directory),
                       'Parcellation': ParcellationStage(pipeline_mode="Diffusion",
                                                         bids_dir=project_info.base_directory,
                                                         output_dir=self.output_directory)}
        cmp_common.Pipeline.__init__(self, project_info)

        self.subject = project_info.subject

        self.stages['Segmentation'].config.freesurfer_subjects_dir = os.path.join(self.output_directory,
                                                                                  'freesurfer')
        self.stages['Segmentation'].config.freesurfer_subject_id = os.path.join(self.output_directory,
                                                                                'freesurfer', subject_id)
        self.stages['Segmentation'].config.on_trait_change(self.update_parcellation, 'seg_tool')
        self.stages['Parcellation'].config.on_trait_change(self.update_segmentation, 'parcellation_scheme')
        self.stages['Parcellation'].config.on_trait_change(self.update_parcellation_scheme, 'parcellation_scheme')
    def __init__(self, project_info):
        # super(Pipeline, self).__init__(project_info)

        self.subject = project_info.subject
        self.last_date_processed = project_info.anat_last_date_processed

        self.global_conf.subjects = project_info.subjects
        self.global_conf.subject = self.subject

        if len(project_info.subject_sessions) > 0:
            self.global_conf.subject_session = project_info.subject_session
            self.subject_directory = os.path.join(
                self.base_directory, self.subject,
                self.global_conf.subject_session)
        else:
            self.global_conf.subject_session = ''
            self.subject_directory = os.path.join(self.base_directory,
                                                  self.subject)

        self.derivatives_directory = os.path.abspath(
            project_info.output_directory)
        self.output_directory = os.path.abspath(project_info.output_directory)

        self.stages = {
            'Segmentation':
            SegmentationStage(bids_dir=project_info.base_directory,
                              output_dir=self.output_directory),
            'Parcellation':
            ParcellationStage(pipeline_mode="Diffusion",
                              bids_dir=project_info.base_directory,
                              output_dir=self.output_directory)
        }
        cmp_common.Pipeline.__init__(self, project_info)

        self.stages['Segmentation'].config.on_trait_change(
            self.update_parcellation, 'seg_tool')
        self.stages['Parcellation'].config.on_trait_change(
            self.update_segmentation, 'parcellation_scheme')

        self.stages['Parcellation'].config.on_trait_change(
            self.update_parcellation_scheme, 'parcellation_scheme')
Beispiel #6
0
 def __init__(self, project_info):
     self.stages = {
         'Preprocessing': PreprocessingStage(),
         'Segmentation': SegmentationStage(),
         'Parcellation': ParcellationStage(pipeline_mode="fMRI"),
         'Registration': RegistrationStage(pipeline_mode="fMRI"),
         'Functional': FunctionalStage(),
         'Connectome': ConnectomeStage()
     }
     Pipeline.__init__(self, project_info)
     self.stages['Segmentation'].config.on_trait_change(
         self.update_parcellation, 'seg_tool')
     self.stages['Parcellation'].config.on_trait_change(
         self.update_segmentation, 'parcellation_scheme')
     self.stages['Functional'].config.on_trait_change(
         self.update_nuisance_requirements, 'global_nuisance')
     self.stages['Functional'].config.on_trait_change(
         self.update_nuisance_requirements, 'csf')
     self.stages['Functional'].config.on_trait_change(
         self.update_nuisance_requirements, 'wm')
     self.stages['Connectome'].config.on_trait_change(
         self.update_scrubbing, 'apply_scrubbing')
 def __init__(self, bids_dir, output_dir):
     SegmentationStage.__init__(self, bids_dir, output_dir)
     self.config = SegmentationConfigUI()
    def __init__(self, project_info):
        """Constructor of an `AnatomicalPipeline` object.

        Parameters
        ----------
        project_info : cmp.project.ProjectInfo
            Instance of `CMP_Project_Info` object.

        See Also
        --------
        cmp.project.CMP_Project_Info
        """
        self.global_conf.subjects = project_info.subjects
        self.global_conf.subject = project_info.subject

        if len(project_info.subject_sessions) > 0:
            self.global_conf.subject_session = project_info.subject_session
            self.subject_directory = os.path.join(
                project_info.base_directory,
                project_info.subject,
                project_info.subject_session,
            )
            subject_id = "_".join(
                (self.global_conf.subject, self.global_conf.subject_session))
        else:
            self.global_conf.subject_session = ""
            self.subject_directory = os.path.join(project_info.base_directory,
                                                  self.global_conf.subject)
            subject_id = self.global_conf.subject

        self.derivatives_directory = os.path.abspath(
            project_info.output_directory)
        self.output_directory = os.path.abspath(project_info.output_directory)

        self.stages = {
            "Segmentation":
            SegmentationStage(subject=self.global_conf.subject,
                              session=self.global_conf.subject_session,
                              bids_dir=project_info.base_directory,
                              output_dir=self.output_directory),
            "Parcellation":
            ParcellationStage(
                pipeline_mode="Diffusion",
                subject=self.global_conf.subject,
                session=self.global_conf.subject_session,
                bids_dir=project_info.base_directory,
                output_dir=self.output_directory,
            ),
        }
        cmp_common.Pipeline.__init__(self, project_info)

        self.subject = project_info.subject

        self.stages[
            "Segmentation"].config.freesurfer_subjects_dir = os.path.join(
                self.output_directory, __freesurfer_directory__)
        self.stages[
            "Segmentation"].config.freesurfer_subject_id = os.path.join(
                self.output_directory, __freesurfer_directory__, subject_id)

        self.stages["Parcellation"].config.on_trait_change(
            self._update_parcellation_scheme, "parcellation_scheme")