|
| 1 | +.. _nipypecmd: |
| 2 | + |
| 3 | +============================================================ |
| 4 | +Running Nipype Interfaces from the command line (nipype_cmd) |
| 5 | +============================================================ |
| 6 | + |
| 7 | +The primary use of Nipype_ is to build automated non-interactive pipelines. |
| 8 | +However, sometimes there is a need to run some interfaces quickly from the command line. |
| 9 | +This is especially useful when running Interfaces wrapping code that does not have |
| 10 | +command line equivalents (nipy or SPM). Being able to run Nipype interfaces opens new |
| 11 | +possibilities such as inclusion of SPM processing steps in bash scripts. |
| 12 | + |
| 13 | +To run Nipype Interafces you need to use the nipype_cmd tool that should already be installed. |
| 14 | +The tool allows you to list Interfaces available in a certain package: |
| 15 | + |
| 16 | +.. testcode:: |
| 17 | + |
| 18 | + |
| 19 | + $nipype_cmd nipype.interfaces.nipy |
| 20 | + |
| 21 | + Available Interfaces: |
| 22 | + SpaceTimeRealigner |
| 23 | + Similarity |
| 24 | + ComputeMask |
| 25 | + FitGLM |
| 26 | + EstimateContrast |
| 27 | + FmriRealign4d |
| 28 | + |
| 29 | +After selecting a particular Interface you can learn what inputs it requires: |
| 30 | + |
| 31 | +.. testcode:: |
| 32 | + |
| 33 | + |
| 34 | + $nipype_cmd nipype.interfaces.nipy ComputeMask --help |
| 35 | + |
| 36 | + usage:nipype_cmd nipype.interfaces.nipy ComputeMask [-h] [--M M] [--cc CC] |
| 37 | + [--ignore_exception IGNORE_EXCEPTION] |
| 38 | + [--m M] |
| 39 | + [--reference_volume REFERENCE_VOLUME] |
| 40 | + mean_volume |
| 41 | + |
| 42 | + Run ComputeMask |
| 43 | + |
| 44 | + positional arguments: |
| 45 | + mean_volume mean EPI image, used to compute the threshold for the |
| 46 | + mask |
| 47 | + |
| 48 | + optional arguments: |
| 49 | + -h, --help show this help message and exit |
| 50 | + --M M upper fraction of the histogram to be discarded |
| 51 | + --cc CC Keep only the largest connected component |
| 52 | + --ignore_exception IGNORE_EXCEPTION |
| 53 | + Print an error message instead of throwing an |
| 54 | + exception in case the interface fails to run |
| 55 | + --m M lower fraction of the histogram to be discarded |
| 56 | + --reference_volume REFERENCE_VOLUME |
| 57 | + reference volume used to compute the mask. If none is |
| 58 | + give, the mean volume is used. |
| 59 | + |
| 60 | +Finally you can run run the Interface: |
| 61 | + |
| 62 | +.. testcode:: |
| 63 | + |
| 64 | + $nipype_cmd nipype.interfaces.nipy ComputeMask mean.nii.gz |
| 65 | + |
| 66 | +All that from the command line without having to start python interpreter manually. |
| 67 | + |
| 68 | +.. include:: ../links_names.txt |
0 commit comments