NIPY logo

Table Of Contents

Previous topic

nipype.interfaces.spm.preprocess

Next topic

Developer Guide

This Page

nipype.interfaces.utility

IdentityInterface

Merge

Basic interface class to merge inputs into a single list

Examples

>>> from nipype.interfaces.utility import Merge
>>> mi = Merge(3)
>>> mi.inputs.in1 = 1
>>> mi.inputs.in2 = [2,5]
>>> mi.inputs.in3 = 3
>>> out = mi.run()
>>> out.outputs.out
[1, 2, 5, 3]

Inputs:

[Optional]
axis : ('vstack' or 'hstack')
        direction in which to merge, hstack requires same number of elements in each input

Outputs:

out : (a list of items which are any value)
        Merged output

Select

Basic interface class to select specific elements from a list

Examples

>>> from nipype.interfaces.utility import Select
>>> sl = Select()
>>> _ = sl.inputs.set(inlist=[1,2,3,4,5],index=[3])
>>> out = sl.run()
>>> out.outputs.out
~
>>> _ = sl.inputs.set(inlist=[1,2,3,4,5],index=[3,4])
>>> out = sl.run()
>>> out.outputs.out
[4, 5]

Inputs:

[Mandatory]
index : (a list of items which are an integer)
        0-based indices of values to choose
inlist : (a list of items which are any value)
        list of values to choose from

Outputs:

out     list of selected values

Split

Basic interface class to split lists into multiple outputs

Examples

>>> from nipype.interfaces.utility import Split
>>> sp = Split()
>>> _ = sp.inputs.set(inlist=[1,2,3],splits=[2,1])
>>> out = sp.run()
>>> out.outputs.out1
[1, 2]

Inputs:

[Mandatory]
inlist : (a list of items which are any value)
        list of values to split
splits : (a list of items which are an integer)
        Number of outputs in each split - should add to number of inputs

SubstringMatch