Pick one or many of iterables downstream

I calculated, for example the realignment within runs, and I want to pick the first mean image to use it as a coregistration reference for the other runs. How can I do this? Is it even possible?

I think this should be possible with a combination of JoinNode and Select. See http://nipype.readthedocs.io/en/latest/users/joinnode_and_itersource.html for more details.

Here’s how I did it.

from nipype.interfaces.utility import Select
select_first_mean = Node(Select(index=[0]), name="select_first_mean")
select_remaining_mean = Node(Select(index=[1, 2, 3, 4]), name="select_remaining_mean")
select_remaining_real = Node(Select(index=[1, 2, 3, 4]), name="select_remaining_real")
1 Like