Hi all,
I’m running a fairly simple pipeline on anatomical data to resize and reshape images from different subjects.
I want to do preprocessing on two seperate files in different nodes (file_a.nii (which has an iterable left/right side) and file_b.nii) in two nodes (node a and node b). The outputs would then be resliced together in node c using C3d to be the same size. Node d would then take the output from node a and c again to multiply them to make a mask.
However, I can’t work out how to get two outputs from seperate nodes as inputs to a different node, and I don’t believe that this is a job for a join node based on the docs.
Here’s some code:
node_a = MapNode(C3d(interp = "Sinc", pix_type = 'float', args = 'resample-mm 0.35x0.35x0.35mm pad-to 176x144x128 0 -binarize'),
name='node_a', iterfield=['in_file'])
wf.connect([(selectfiles, node_a, [('file_a','in_file')])])
node_b = MapNode(C3d(interp = "Sinc", pix_type = 'float', args = 'resample-mm 0.35x0.35x0.35mm'),
name='node_b', iterfield=['in_file'])
wf.connect([(selectfiles, node_b, [('file_b','in_file')])])
node_c = MapNode(C3d(interp = "Sinc", pix_type = 'float', args = '-reslice-identity'),
name='node_c')
wf.connect([(node_a, node_c, [('out_file','in_file')])])
wf.connect([(node_b, node_c, [('out_file','in_file')])])
node_d= Node(C3d(interp = "Sinc", pix_type = 'float', args = '-multiply'),
name='umc_tse_reslice_n')
wf.connect([(node_c, node_d, [('out_file','in_file')])])
wf.connect([(node_a, node_d, [('out_file','in_file')])])
The error:
Exception: Trying to connect preprocess.node_b:file_a to preprocess.node_c:in_file but input ‘in_file’ of node ‘preprocess.node_c’ is already connected.
Could anyone help please?