{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Workflows\n", "\n", "Although it would be possible to write analysis scripts using just Nipype [Interfaces](basic_interfaces.ipynb), and this may provide some advantages over directly making command-line calls, the main benefits of Nipype are the workflows.\n", "\n", "A workflow controls the setup and the execution of individual interfaces. Let's assume you want to run multiple interfaces in a specific order, where some have to wait for others to finish while others can be executed in parallel. The nice thing about a nipype workflow is, that the workflow will take care of input and output of each interface and arrange the execution of each interface in the most efficient way.\n", "\n", "A workflow therefore consists of multiple [Nodes](basic_nodes.ipynb), each representing a specific [Interface](basic_interfaces.ipynb) and directed connection between those nodes. Those connections specify which output of which node should be used as an input for another node. To better understand why this is so great, let's look at an example." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Interfaces vs. Workflows\n", "\n", "Interfaces are the building blocks that solve well-defined tasks. We solve more complex tasks by combining interfaces with workflows:\n", "\n", "
Interfaces | \n", "Workflows | \n", " \n", " \n", "
---|---|
Wrap *unitary* tasks | \n", "Wrap *meta*-tasks\n",
" | \n",
"
Keep track of the inputs and outputs, and check their expected types | \n", "Do not have inputs/outputs, but expose them from the interfaces wrapped inside | \n", "
Do not cache results (unless you use [interface caching](advanced_interfaces_caching.ipynb)) | \n", "Cache results | \n", "
Run by a nipype plugin | \n", "Run by a nipype plugin | \n", "