My design is as follows:
-
Nodeatakes an iterfield withninput files and produces 1 output file -
MapNodebtakes an iterfield withninput files and producesnoutput files -
MapNodectakes the 1 output file fromaand processes it with thenoutput files ofbto producennew output files
Here is a minimal code example:
a = MapNode(..., iterfield=['in_file']) # output: 'out_files' (xn)
b = Node(..., iterfield=['in_file']) # output: 'out_file' (x1)
c = MapNode(..., iterfield=['in_files', 'in_file'])
wf.connect([
(a, b, [('out_files', 'in_file']),
(b, c, [('out_file', 'in_file']),
(a, c, [('out_files', 'in_files'])
])
This results in the following error:
ValueError: All iterfields of a MapNode have to have the same length.
in_file = ['/hidden-location1/file.nii']
in_files = ['/hidden-location2/file1.nii', '/hidden-location2/file2.nii', '/hidden-location2/file3.nii', '/hidden-location2/file4.nii', '/hidden-location2/file5.nii', '/hidden-location2/file6.nii', '/hidden-location2/file7.nii', '/hidden-location2/file8.nii', '/hidden-location2/file9.nii', '/hidden-location2/file10.nii']
I understand the problem, and that of course the lengths of the iterfields must match. I imagine the solution is to somehow repeat the contents of the in_file list in c so that its length matches the in_files list (where each index is just a duplicate).
Any assistance would be greatly appreciated! 