Exemplo n.º 1
0
        def _run_interface(self, runtime):
            if self.inputs.subjects_dir:
                os.environ.update({'SUBJECTS_DIR': self.inputs.subjects_dir})

            if not os.path.exists(op.join(self.inputs.subjects_dir, self.inputs.subject_id)):
                raise Exception
            iflogger.info("ROI_HR_th.nii.gz / fsmask_1mm.nii.gz CREATION")
            iflogger.info("=============================================")
            create_annot_label(self.inputs.subject_id, self.inputs.subjects_dir, self.inputs.freesurfer_dir, self.inputs.parcellation_name)
            create_roi(self.inputs.subject_id, self.inputs.subjects_dir, self.inputs.freesurfer_dir, self.inputs.parcellation_name, self.inputs.dilation)
            create_wm_mask(self.inputs.subject_id, self.inputs.subjects_dir, self.inputs.freesurfer_dir, self.inputs.parcellation_name)
            crop_and_move_datasets(self.inputs.subject_id, self.inputs.subjects_dir, self.inputs.freesurfer_dir, self.inputs.parcellation_name, self.inputs.out_roi_file, self.inputs.dilation)

            return runtime
Exemplo n.º 2
0
    def _run_interface(self, runtime):
        #if self.inputs.subjects_dir:
        #   os.environ.update({'SUBJECTS_DIR': self.inputs.subjects_dir})
        iflogger.info("ROI_HR_th.nii.gz / fsmask_1mm.nii.gz CREATION")
        iflogger.info("=============================================")

        if self.inputs.parcellation_scheme == "Lausanne2008":
            create_T1_and_Brain(self.inputs.subject_id,
                                self.inputs.subjects_dir)
            create_annot_label(self.inputs.subject_id,
                               self.inputs.subjects_dir)
            create_roi(self.inputs.subject_id, self.inputs.subjects_dir)
            create_wm_mask(self.inputs.subject_id, self.inputs.subjects_dir)
            if self.inputs.erode_masks:
                erode_mask(
                    op.join(self.inputs.subjects_dir, self.inputs.subject_id,
                            'mri', 'fsmask_1mm.nii.gz'))
                erode_mask(
                    op.join(self.inputs.subjects_dir, self.inputs.subject_id,
                            'mri', 'csf_mask.nii.gz'))
                erode_mask(
                    op.join(self.inputs.subjects_dir, self.inputs.subject_id,
                            'mri', 'brainmask.nii.gz'))
            crop_and_move_datasets(self.inputs.subject_id,
                                   self.inputs.subjects_dir)
        if self.inputs.parcellation_scheme == "NativeFreesurfer":
            create_T1_and_Brain(self.inputs.subject_id,
                                self.inputs.subjects_dir)
            generate_WM_and_GM_mask(self.inputs.subject_id,
                                    self.inputs.subjects_dir)
            if self.inputs.erode_masks:
                erode_mask(
                    op.join(self.inputs.subjects_dir, self.inputs.subject_id,
                            'mri', 'fsmask_1mm.nii.gz'))
                erode_mask(
                    op.join(self.inputs.subjects_dir, self.inputs.subject_id,
                            'mri', 'csf_mask.nii.gz'))
                erode_mask(
                    op.join(self.inputs.subjects_dir, self.inputs.subject_id,
                            'mri', 'brainmask.nii.gz'))
            crop_and_move_WM_and_GM(self.inputs.subject_id,
                                    self.inputs.subjects_dir)

        return runtime
Exemplo n.º 3
0
 def _run_interface(self, runtime):
     #if self.inputs.subjects_dir:
     #   os.environ.update({'SUBJECTS_DIR': self.inputs.subjects_dir})
     iflogger.info("ROI_HR_th.nii.gz / fsmask_1mm.nii.gz CREATION")
     iflogger.info("=============================================")
     
     if self.inputs.parcellation_scheme == "Lausanne2008":
         create_annot_label(self.inputs.subject_id, self.inputs.subjects_dir)
         create_roi(self.inputs.subject_id, self.inputs.subjects_dir)
         create_wm_mask(self.inputs.subject_id, self.inputs.subjects_dir)
         if self.inputs.erode_masks:
             erode_mask(op.join(self.inputs.subjects_dir,self.inputs.subject_id,'mri','fsmask_1mm.nii.gz'))
             erode_mask(op.join(self.inputs.subjects_dir,self.inputs.subject_id,'mri','csf_mask.nii.gz'))
             erode_mask(op.join(self.inputs.subjects_dir,self.inputs.subject_id,'mri','brainmask.nii.gz'))
         crop_and_move_datasets(self.inputs.subject_id, self.inputs.subjects_dir)
     if self.inputs.parcellation_scheme == "NativeFreesurfer":
         generate_WM_and_GM_mask(self.inputs.subject_id, self.inputs.subjects_dir)
         if self.inputs.erode_masks:
             erode_mask(op.join(self.inputs.subjects_dir,self.inputs.subject_id,'mri','fsmask_1mm.nii.gz'))
             erode_mask(op.join(self.inputs.subjects_dir,self.inputs.subject_id,'mri','csf_mask.nii.gz'))
             erode_mask(op.join(self.inputs.subjects_dir,self.inputs.subject_id,'mri','brainmask.nii.gz'))
         crop_and_move_WM_and_GM(self.inputs.subject_id, self.inputs.subjects_dir)
         
     return runtime