@@ -444,7 +444,7 @@ def create_wm_mask(subject_id, subjects_dir, fs_dir, parcellation_name):
444
444
nb .save (img , wm_out )
445
445
446
446
447
- def crop_and_move_datasets (subject_id , subjects_dir , fs_dir , parcellation_name , out_roi_file ):
447
+ def crop_and_move_datasets (subject_id , subjects_dir , fs_dir , parcellation_name , out_roi_file , dilation ):
448
448
fs_dir = op .join (subjects_dir , subject_id )
449
449
cmp_config = cmp .configuration .PipelineConfiguration ()
450
450
cmp_config .parcellation_scheme = "Lausanne2008"
@@ -468,7 +468,8 @@ def crop_and_move_datasets(subject_id, subjects_dir, fs_dir, parcellation_name,
468
468
469
469
ds .append ((op .join (op .curdir , 'ROI_%s.nii.gz' % parcellation_name ),
470
470
op .join (op .curdir , 'ROI_HR_th.nii.gz' )))
471
- ds .append ((op .join (op .curdir , 'ROIv_%s.nii.gz' %
471
+ if (dilation == True ):
472
+ ds .append ((op .join (op .curdir , 'ROIv_%s.nii.gz' %
472
473
parcellation_name ), op .join (op .curdir , 'ROIv_HR_th.nii.gz' )))
473
474
orig = op .join (fs_dir , 'mri' , 'orig' , '001.mgz' )
474
475
for d in ds :
@@ -531,7 +532,7 @@ class ParcellateInputSpec(BaseInterfaceInputSpec):
531
532
class ParcellateOutputSpec (TraitedSpec ):
532
533
roi_file = File (
533
534
exists = True , desc = 'Region of Interest file for connectivity mapping' )
534
- roiv_file = File (exists = True , desc = 'Region of Interest file for fMRI connectivity mapping' )
535
+ roiv_file = File (exists = False , desc = 'Region of Interest file for fMRI connectivity mapping' )
535
536
white_matter_mask_file = File (exists = True , desc = 'White matter mask file' )
536
537
cc_unknown_file = File (
537
538
desc = 'Image file with regions labelled as unknown cortical structures' ,
@@ -583,7 +584,7 @@ def _run_interface(self, runtime):
583
584
create_annot_label (self .inputs .subject_id , self .inputs .subjects_dir , self .inputs .freesurfer_dir , self .inputs .parcellation_name )
584
585
create_roi (self .inputs .subject_id , self .inputs .subjects_dir , self .inputs .freesurfer_dir , self .inputs .parcellation_name , self .inputs .dilation )
585
586
create_wm_mask (self .inputs .subject_id , self .inputs .subjects_dir , self .inputs .freesurfer_dir , self .inputs .parcellation_name )
586
- 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 )
587
+ 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 )
587
588
return runtime
588
589
589
590
def _list_outputs (self ):
@@ -602,7 +603,7 @@ def _list_outputs(self):
602
603
outputs ['roi_file_in_structural_space' ] = op .abspath (
603
604
'ROI_HR_th.nii.gz' )
604
605
outputs ['dilated_roi_file_in_structural_space' ] = op .abspath (
605
- 'ROI_HR_th .nii.gz' )
606
+ 'ROIv_HR_th .nii.gz' )
606
607
return outputs
607
608
608
609
def _gen_outfilename (self , ext , prefix = 'ROI' ):
0 commit comments