NIPY logo

Table Of Contents

Previous topic

pipeline.engine

Next topic

testing.utils

This Page

pipeline.node_wrapper

Module: pipeline.node_wrapper

Inheritance diagram for nipype.pipeline.node_wrapper:

digraph inheritance7ee9e2572a { rankdir=LR; ratio=compress; fontsize=14; size="6.0, 8.0"; "node_wrapper.NodeWrapper" [shape=ellipse,URL="#nipype.pipeline.node_wrapper.NodeWrapper",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,fontsize=14,color=dodgerblue1,style=filled,height=0.75]; }

Wraps interfaces modules to work with pipeline engine

NodeWrapper

class nipype.pipeline.node_wrapper.NodeWrapper(interface=None, iterables={}, iterfield=[], diskbased=False, base_directory=None, overwrite=False, name=None)

Bases: object

Base class wrapper for interface objects to create nodes that can be used in the pipeline engine.

Parameters:

interface : interface object

node specific interface (fsl.Bet(), spm.Coregister())

iterables : generator

key and items to iterate using the pipeline engine for example to iterate over different frac values in fsl.Bet() node.iterables = dict(frac=lambda:[0.5,0.6,0.7])

iterfield : 1-element list

key over which to repeatedly call the function. for example, to iterate FSL.Bet over multiple files, one can set node.iterfield = [‘infile’]

base_directory : directory

base output directory (will be hashed before creations) default=None, which results in the use of mkdtemp

diskbased : Boolean

Whether the underlying object requires disk space for operation and storage of output

overwrite : Boolean

Whether to overwrite contents of output directory if it already exists. If directory exists and hash matches it assumes that process has been executed

name : string

Name of this node. By default node is named modulename.classname. But when the same class is being used several times, a different name ensures that output directory is not overwritten each time the same functionality is run.

Notes

creates output directory copies/discovers files to work with saves a hash.json file to indicate that a process has been completed

Examples

>>> import nipype.interfaces.spm as spm
>>> realign = NodeWrapper(interface=spm.Realign(), base_directory='test2',             diskbased=True)
>>> realign.inputs.infile = os.path.abspath('data/funcrun.nii')
>>> realign.inputs.register_to_mean = True
>>> realign.run() # doctest: +SKIP
__init__(interface=None, iterables={}, iterfield=[], diskbased=False, base_directory=None, overwrite=False, name=None)
get_output(parameter)
hash_inputs()
Computes a hash of the input fields of the underlying interface.
inputs
interface
result
run(updatehash=None)
Executes an interface within a directory.
set_input(parameter, val, *args, **kwargs)
update(**opts)