Inheritance diagram for nipype.interfaces.base:
digraph inheritancebf445f24e6 { rankdir=LR; ratio=compress; fontsize=14; size="6.0, 8.0"; "base.InterfaceResult" [shape=ellipse,URL="#nipype.interfaces.base.InterfaceResult",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,fontsize=14,color=dodgerblue1,style=filled,height=0.75]; "base.Bunch" [shape=ellipse,URL="#nipype.interfaces.base.Bunch",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,fontsize=14,color=dodgerblue1,style=filled,height=0.75]; "base.Interface" [shape=ellipse,URL="#nipype.interfaces.base.Interface",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,fontsize=14,color=dodgerblue1,style=filled,height=0.75]; "base.CommandLine" [shape=ellipse,URL="#nipype.interfaces.base.CommandLine",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,fontsize=14,color=dodgerblue1,style=filled,height=0.75]; "base.Interface" -> "base.CommandLine" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
Package contains interfaces for using existing functionality in other packages
Exaples FSL, matlab/SPM , afni
Requires Packages to be installed
Bases: object
Dictionary-like class that provides attribute-style access to it’s items.
A Bunch is a simple container that stores it’s items as class attributes. Internally all items are stored in a dictionary and the class exposes several of the dictionary methods.
Notes
The Bunch pattern came from the Python Cookbook:
| [1] | A. Martelli, D. Hudgeon, “Collecting a Bunch of Named Items”, Python Cookbook, 2nd Ed, Chapter 4.18, 2005. |
Examples
>>> from nipype.interfaces.base import Bunch
>>> inputs = Bunch(infile='subj.nii', fwhm=6.0, register_to_mean=True)
>>> inputs
Bunch(fwhm=6.0, infile='subj.nii', register_to_mean=True)
>>> inputs.register_to_mean = False
>>> inputs
Bunch(fwhm=6.0, infile='subj.nii', register_to_mean=False)
update existing attribute, or create new attribute
Note: update is very much like HasTraits.set
Bases: nipype.interfaces.base.Interface
Encapsulate a command-line function along with the arguments and options.
Provides a convenient mechanism to build a command line with it’s arguments and options incrementally. A CommandLine object can be reused, and it’s arguments and options updated. The CommandLine class is the base class for all nipype.interfaces classes.
| Parameters: | args : string
inputs : mapping
|
|---|---|
| Attributes: | args : list
inputs : Bunch of key,value inputs
Returns : ——- : cmd : CommandLine
|
Notes
Also quite possibly __init__ but generally not _runner
Examples
>>> from nipype.interfaces.base import CommandLine
>>> cmd = CommandLine('echo')
>>> cmd.cmdline
'echo'
>>> res = cmd.run(None, 'foo')
>>> print res.runtime.stdout
foo
<BLANKLINE>
You could pass arguments in the following ways and all result in the same command. >>> lscmd = CommandLine(‘ls’, ‘-l’, ‘-t’) >>> lscmd.cmdline ‘ls -l -t’ >>> lscmd = CommandLine(‘ls -l -t’) >>> lscmd.cmdline ‘ls -l -t’ >>> lscmd = CommandLine(args=[‘ls’, ‘-l’, ‘-t’]) >>> lscmd.cmdline ‘ls -l -t’
Called to populate outputs
Currently, search for discussion of this on private e-mails between Dav and Satra (ugh!). This needs to get in here!
Provides information about file inputs to copy or link to cwd.
Notes
see spm.Realign.get_input_info
Execute the command.
| Parameters: | cwd : path
args : list
inputs : mapping
|
|---|---|
| Returns: | results : InterfaceResult Object
|
Bases: object
This is the template for Interface objects.
It provides no functionality. It defines the necessary attributes and methods all Interface objects should have.
Everything in inputs should also be a possible (explicit?) argument to .__init__()
Called to populate outputs
Currently, search for discussion of this on private e-mails between Dav and Satra (ugh!). This needs to get in here!
Bases: object
Object that contains the results of running a particular Interface.
| Attributes: | interface : object
outputs : Bunch
runtime : Bunch
|
|---|