Suppose I don’t want to use a chain of MapNodes (it is a bit too long of a story to go into here) and so the first step in my workflow is to setup an node that iterates over all the sessions I am processing. However, I now need to run a tool that normalizes my datasets to a population average, so I need the inverse of a MapNode (maybe you could call it a ReduceNode), i.e. something that implicitly creates many-to-one-to-many nodes instead of one-to-many-to-one nodes.
So my question is, is there an clean way to do this with NiPype? The many-to-one part can be done easily with a JoinNode but it is the expanding back out to many and connecting with along side other inputs that haven’t been through the “reduce node” that I am unsure about. I am thinking that I will need to create a custom interface that takes the original iterable I started with and the list output of the “reduced” node and selects the corresponding element from the list. But this seems a bit hacky. Would this be the recommended way to do it?