Hi,
I'm wondering when the output of a node is not a simple output, how I can go about connecting the node to the next. So as an example in ANTs Atropos there are 3 outputs for posterior images, but only one output has been defined in Nipype:
segment = pe.Node(interface = ants.Atropos(),
name = 'segment')
segment.inputs.initialization = 'KMeans'
segment.inputs.number_of_tissue_classes = 3
segment.inputs.dimension = 3
segment.inputs.out_classified_image_name = 'out_classified.nii.gz'
segment.inputs.save_posteriors = True
segment.inputs.posterior_formulation = 'POSTERIOR_%02d.nii.gz'
From Nipype Atropos help we will have the following outputs:
classified_image: (an existing file name)
posteriors: (a file name)
Now, say I want to pass only white matter segmentation, which is 'POSTERIOR_3.nii.gz' to the next node, what would you recommend to do in the following workflow connection:
workflow.connect([( segment, next_node,
[('posteriors', 'next_input)]
])
maybe this
'posteriors %(3)'
But then I get:
Module segment has no output called posteriors %(3)
All the best,
Arman