3333
3434"""
3535
36- # Set the way matlab should be called
36+ # Set the way Matlab should be called
3737mlab .MatlabCommand .set_default_matlab_cmd ("matlab -nodesktop -nosplash" )
3838
3939"""
4040
4141Setting up workflows
4242--------------------
43- In this tutorial we will be setting up a hierarchical workflow for spm
44- analysis. This will demonstrate how pre-defined workflows can be setup
43+ In this tutorial we will be setting up a hierarchical workflow for SPM
44+ analysis. This will demonstrate how predefined workflows can be setup
4545and shared across users, projects and labs.
4646
4747Setup preprocessing workflow
5151"""
5252
5353preproc = pe .Workflow (name = 'preproc' )
54- """We strongly encourage to use 4D files insteead of series of 3D for fMRI analyses
54+ """We strongly encourage to use 4D files instead of series of 3D for fMRI analyses
5555for many reasons (cleanness and saving and filesystem inodes are among them). However,
5656the the workflow presented in the SPM8 manual which this tutorial is based on
5757uses 3D files. Therefore we leave converting to 4D as an option. We are using ``merge_to_4d``
58- variable, because switching between 3d and 4d requires some additional steps (explauned later on).
58+ variable, because switching between 3D and 4dD requires some additional steps (explained later on).
5959Use :ref:`nipype.interfaces.fsl.utils.Merge` to merge a series
6060of 3D files along the time dimension creating a 4D file.
6161"""
@@ -118,8 +118,8 @@ def get_vox_dims(volume):
118118
119119"""Here we are connecting all the nodes together.
120120Notice that we add the merge node only if you choose to use 4D.
121- Also ``get_vox_dims`` function is passed along the input volume of normalise to set the optimal
122- voxel sizes.
121+ Also, the ``get_vox_dims`` function is passed along the input volume of
122+ :ref:`nipype.interfaces.spm.preprocess.Normalize` to set the optimal voxel sizes.
123123"""
124124
125125if merge_to_4d :
@@ -185,8 +185,8 @@ def get_vox_dims(volume):
185185 ('spmT_images' , 'stat_image' )]),
186186])
187187"""
188- Preproc + Analysis pipeline
189- ---------------------------
188+ Preprocessing and analysis pipeline
189+ -----------------------------------
190190"""
191191
192192l1pipeline = pe .Workflow (name = 'firstlevel' )
@@ -195,7 +195,7 @@ def get_vox_dims(volume):
195195 'modelspec.realignment_parameters' )])])
196196
197197"""
198- Pluging in ``functional_runs`` is a bit more complicated,
198+ Plugging in ``functional_runs`` is a bit more complicated,
199199because model spec expects a list of ``runs``.
200200Every run can be a 4D file or a list of 3D files.
201201Therefore for 3D analysis we need a list of lists and to make one we need a helper function.
@@ -252,10 +252,7 @@ def makelist(item):
252252
253253"""
254254Now we create a :ref:`nipype.interfaces.io.DataGrabber`
255- object and fill in the information from above about the layout of our data. The
256- :class:`nipype.pipeline.NodeWrapper` module wraps the interface object
257- and provides additional housekeeping and pipeline specific
258- functionality.
255+ object and fill in the information from above about the layout of our data.
259256"""
260257
261258datasource = pe .Node (
@@ -317,18 +314,26 @@ def makelist(item):
317314setup the connections between the nodes such that appropriate outputs
318315from nodes are piped into appropriate inputs of other nodes.
319316
320- Use the :class:`nipype.pipeline.engine.Pipeline` to create a
321- graph-based execution pipeline for first level analysis. The config
322- options tells the pipeline engine to use `workdir` as the disk
323- location to use when running the processes and keeping their
324- outputs. The `use_parameterized_dirs` tells the engine to create
325- sub-directories under `workdir` corresponding to the iterables in the
326- pipeline. Thus for this pipeline there will be subject specific
327- sub-directories.
317+ Use the :class:`~nipype.pipeline.engine.workflows.Workflow` to create a
318+ graph-based execution pipeline for first level analysis.
319+ Set the :py:attr:`~nipype.pipeline.engine.workflows.Workflow.base_dir`
320+ option to instruct the pipeline engine to use ``spm_auditory_tutorial/workingdir``
321+ as the filesystem location to use when running the processes and keeping their
322+ outputs.
323+ Other options can be set via `the configuration file
324+ <https://miykael.github.io/nipype_tutorial/notebooks/basic_execution_configuration.html>`__.
325+ For example, ``use_parameterized_dirs`` tells the engine to create
326+ sub-directories under :py:attr:`~nipype.pipeline.engine.workflows.Workflow.base_dir`,
327+ corresponding to the iterables in the pipeline.
328+ Thus, for this pipeline there will be subject specific sub-directories.
329+
330+ When building a workflow, interface objects are wrapped within
331+ a :class:`~nipype.pipeline.engine.nodes.Node` so that they can be inserted
332+ in the workflow.
328333
329334The :func:`~nipype.pipeline.engine.workflows.Workflow.connect` method creates the
330- links between the processes , i.e., how data should flow in and out of
331- the processing nodes.
335+ links between :class:`~nipype.pipeline.engine.nodes.Node` instances , i.e.,
336+ how data should flow in and out of the processing nodes.
332337"""
333338
334339level1 = pe .Workflow (name = "level1" )
0 commit comments