Iterable example

This example pipeline adjusts the previous example of a simple skullstripping pipeline such that it allows iteration (“looping”) over different subjects.

An example of a skullstripping pipeline iterated over different subjects.

Using Nipype-interfaces again, we added an IdentityInterface node that contains an input-port sub_id that contains a list ["sub-01", "sub-02"]. This input-port is set as an “iterable” (see our docs for more info on iterables in Porcupine), such that it “feeds” each value in the sub_id input-port one-by-one into the skullstripping pipeline, effectively creating a skullstripping pipeline looped across the T1-weighted structural scans of two subjects.

"The sub-id input-port is here set as an iterable, allowing looping over the two sub-id values."

Note that the value of sub_id (which “updates” after every iteration) is also connected to the container input-port from the DataSink node, which makes sure that each skullstripping result is written to a subject-specific sub-directory.

Check out the Porcupine-generated Python-script, Porcupine-pipeline, and associated Dockerfile in our Github repository or download the files directly below.

Download .pork-file Download .py-file Download Dockerfile