How can I tell nipype to finish a node for all subjects before moving on to the next node of the workflow?
For example with the workflow below, how can I force nipype to run the gunzip
node for all three subjects, before running flirt
?
subjects = ['001','002', '003']
infosource = Node(IdentityInterface(fields=['sub']), name="infosource")
infosource.iterables = [('sub', subjects)]
wf = Workflow(name="wf", base_dir='\data\')
templates = {'func': os.path.join('{sub}', 'func.nii.gz')}
select_files = Node(SelectFiles(templates), name='select_files')
gunzip = Node(Gunzip(), name='gunzip')
wf.connect([\
(infosource, select_files, [('sub', 'sub')]),
(select_files, gunzip, [('func', 'infile'))],
######run gunzip node for all subjects before continuing#######
(gunzip, flirt, [('out_file','in_file')]),
...
])
wf.run('MultiProc')