Hello everyone,
Iām currently setting up my first nipype script and would like to ask a question wrt file selection and flow:
I have a data set with 2 functional runs per participant and would like to realign them together (corresponding to two sessions within the realignment module in a classic SPM batch), resulting in one mean image. When running the node in my current set up, using IdentityInterface and SelectFiles to get and pass the run corresponding files to the realign node like this:
infosource = Node(IdentityInterface(fields=['subject_id',
'session_id'],
name="infosource")
infosource.iterables = [('subject_id', subject_list),
('session_id', session_list)]
templates = {'func': 'fMRI/{subject_id}/{session_id}/func_*.nii',
'struct':'fMRI/{subject_id}/{session_id}/struc.nii'}
selectfiles = Node(SelectFiles(templates,
base_directory=experiment_dir),
name="selectfiles")
mypipeline.connect([(infosource, selectfiles, [('subject_id', 'subject_id'),
('session_id', 'session_id')]),
(selectfiles, realign, [('func', 'in_files')]),
etc...
realignment is done run wise and not across runs, also resulting in two mean images.
This continues of course throughout my pipeline (e.g. coregistration, etc.).
I guess this happens, because I use Iterables for both, participants and sessions, whereas I
should probably use a MapNode/ Iterfield for the sessions.
Could someone give me a hint / or has an idea on how to exactly do that, as Iām not quite sure!?
Regards, Peer