Commit dd3e2c8b by arnaud.marcoux

Fix bug in t1-volume-parcellation : pipeline now working

parent 4ea4993e
Pipeline #1378 failed with stages
in 2 minutes 14 seconds
......@@ -28,7 +28,7 @@
},
{
"name": "modulation",
"pattern":".*\/.*T1w_segm-graymatter_space-Ixi549Space_modulated-on_probability.nii.*"
"pattern":".*\/.*T1w_segm-graymatter_space-Ixi549Space_modulated-(.*)_probability.nii.*"
}
]
......
......@@ -33,6 +33,8 @@ class T1VolumeParcellationCLI(ce.CmdParser):
help='Path to the CAPS directory.')
self._args.add_argument("group_id",
help='User-defined identifier for the provided group of subjects.')
self._args.add_argument("-m", "--modulation",
help='Specify if modulation must be enabled. Default : on', default='on')
self._args.add_argument("-tsv", "--subjects_sessions_tsv",
help='TSV file containing a list of subjects with their sessions.')
#self._args.add_argument("-im_type", "--image_type", type = str, default = 'T1',
......@@ -60,7 +62,7 @@ class T1VolumeParcellationCLI(ce.CmdParser):
bids_directory='./4',
caps_directory=self.absolute_path(args.caps_directory),
tsv_file=self.absolute_path(args.subjects_sessions_tsv))
#pipeline = spm_parcellation()
assert args.modulation in ['on', 'off']
pipeline.parameters = {
# Add your own pipeline parameters here to use them inside your
# pipeline. See the file `spm_parcellation_pipeline.py` to
......@@ -68,7 +70,8 @@ class T1VolumeParcellationCLI(ce.CmdParser):
'group_id': args.group_id,
'atlases': args.atlases,
'wd': self.absolute_path(args.working_directory),
'n_procs': args.n_procs
'n_procs': args.n_procs,
'modulate': args.modulation
}
if args.working_directory is None:
......
......@@ -87,8 +87,10 @@ class T1VolumeParcellation(cpe.Pipeline):
caps_file = caps_layout.get(return_type='file',
subject=subjects_regex,
session=sessions_regex,
group_id = self.parameters['group_id'],
modulation = self.parameters['modulate'])
group_id=self.parameters['group_id'],
modulation=self.parameters['modulate'])
if len(caps_file) != len(self.subjects):
raise IOError(str(len(caps_file)) + ' file(s) grabbed, but there is ' + str(len(self.subjects)) + ' sessions')
read_parameters_node.inputs.file_list = caps_file
......@@ -125,8 +127,8 @@ class T1VolumeParcellation(cpe.Pipeline):
name='atlas_stats_node',
iterfield=['file_list'])
outputnode = npe.Node(nutil.IdentityInterface(fields=['atlas_statistics']),
name='outputnode',
mandatory_inputs=True)
name='outputnode',
mandatory_inputs=True)
datasink = npe.Node(nio.DataSink(),
name='datasink')
......
......@@ -36,8 +36,5 @@ def atlas_statistics(file_list, atlas_list):
cprint(out_atlas_statistics)
statistics_on_atlas(file_list, atlas_class(), out_atlas_statistics)
atlas_statistics_list.append(out_atlas_statistics)
break
return atlas_statistics_list
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment