Inheritance diagram for nipype.interfaces.fsl:
digraph inheritance4438b7eaca { rankdir=LR; ratio=compress; fontsize=14; size="6.0, 8.0"; "fsl.Bet" [shape=ellipse,URL="#nipype.interfaces.fsl.Bet",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,fontsize=14,color=dodgerblue1,style=filled,height=0.75]; "fsl.FSLCommand" -> "fsl.Bet" [arrowsize=0.5,style="setlinewidth(0.5)"]; "fsl.Flirt" [shape=ellipse,URL="#nipype.interfaces.fsl.Flirt",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,fontsize=14,color=dodgerblue1,style=filled,height=0.75]; "fsl.FSLCommand" -> "fsl.Flirt" [arrowsize=0.5,style="setlinewidth(0.5)"]; "fsl.Level1Design" [shape=ellipse,URL="#nipype.interfaces.fsl.Level1Design",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,fontsize=14,color=dodgerblue1,style=filled,height=0.75]; "base.Interface" -> "fsl.Level1Design" [arrowsize=0.5,style="setlinewidth(0.5)"]; "fsl.McFlirt" [shape=ellipse,URL="#nipype.interfaces.fsl.McFlirt",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,fontsize=14,color=dodgerblue1,style=filled,height=0.75]; "fsl.FSLCommand" -> "fsl.McFlirt" [arrowsize=0.5,style="setlinewidth(0.5)"]; "fsl.FSLSmooth" [shape=ellipse,URL="#nipype.interfaces.fsl.FSLSmooth",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,fontsize=14,color=dodgerblue1,style=filled,height=0.75]; "fsl.FSLCommand" -> "fsl.FSLSmooth" [arrowsize=0.5,style="setlinewidth(0.5)"]; "fsl.L1FSFmaker" [shape=ellipse,URL="#nipype.interfaces.fsl.L1FSFmaker",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,fontsize=14,color=dodgerblue1,style=filled,height=0.75]; "fsl.FSLCommand" [shape=ellipse,URL="#nipype.interfaces.fsl.FSLCommand",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,fontsize=14,color=dodgerblue1,style=filled,height=0.75]; "base.CommandLine" -> "fsl.FSLCommand" [arrowsize=0.5,style="setlinewidth(0.5)"]; "fsl.Fnirt" [shape=ellipse,URL="#nipype.interfaces.fsl.Fnirt",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,fontsize=14,color=dodgerblue1,style=filled,height=0.75]; "fsl.FSLCommand" -> "fsl.Fnirt" [arrowsize=0.5,style="setlinewidth(0.5)"]; "fsl.FSLInfo" [shape=ellipse,URL="#nipype.interfaces.fsl.FSLInfo",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,fontsize=14,color=dodgerblue1,style=filled,height=0.75]; "fsl.ApplyWarp" [shape=ellipse,URL="#nipype.interfaces.fsl.ApplyWarp",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,fontsize=14,color=dodgerblue1,style=filled,height=0.75]; "fsl.FSLCommand" -> "fsl.ApplyWarp" [arrowsize=0.5,style="setlinewidth(0.5)"]; "fsl.Fast" [shape=ellipse,URL="#nipype.interfaces.fsl.Fast",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,fontsize=14,color=dodgerblue1,style=filled,height=0.75]; "fsl.FSLCommand" -> "fsl.Fast" [arrowsize=0.5,style="setlinewidth(0.5)"]; "fsl.ApplyXFM" [shape=ellipse,URL="#nipype.interfaces.fsl.ApplyXFM",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,fontsize=14,color=dodgerblue1,style=filled,height=0.75]; "fsl.Flirt" -> "fsl.ApplyXFM" [arrowsize=0.5,style="setlinewidth(0.5)"]; "base.CommandLine" [shape=ellipse,URL="nipype.interfaces.base.html#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)"]; "base.Interface" [shape=ellipse,URL="nipype.interfaces.base.html#nipype.interfaces.base.Interface",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,fontsize=14,color=dodgerblue1,style=filled,height=0.75]; }
The fsl module provides classes for interfacing with the FSL command line tools. This was written to work with FSL version 4.1.4.
Currently these tools are supported:
See the docstrings of the individual classes for examples.
Bases: nipype.interfaces.fsl.FSLCommand
Use FSL’s applywarp to apply the results of a Fnirt registration
Note how little actually needs to be done if we have truly order-independent arguments!
Provides information about file inputs to copy or link to cwd.
Notes
see spm.Realign.get_input_info
Returns a bunch structure with outputs
| Parameters: | (all default to None and are unset) :
|
|---|
Bases: nipype.interfaces.fsl.Flirt
Use FSL FLIRT to apply a linear transform matrix.
For complete details, see the FLIRT Documentation.
Note: This class is currently untested. Use at your own risk!
Examples
>>> from nipype.interfaces import fsl
>>> xfm = ApplyXFM(infile='subject.nii', reference='mni152.nii', bins=640)
>>> xfm_applied = xfm.run(inmatrix='xform.mat')
Create a Bunch which contains all possible files generated by running the interface. Some files are always generated, others depending on which inputs options are set.
| Returns: | outputs : Bunch object
|
|---|---|
| Raises: | IOError :
|
Provides information about file inputs to copy or link to cwd.
Notes
see spm.Realign.get_input_info
Returns a bunch structure with outputs
| Parameters: | (all default to None and are unset) :
|
|---|
Run flirt and apply the transformation to the image.
eg. flirt [options] -in <inputvol> -ref <refvol> -applyxfm -init <matrix> -out <outputvol>
| Parameters: | infile : string
reference : string
inmatrix : string
outfile : string, optional
inputs : dict
|
|---|---|
| Returns: | results : InterfaceResult
|
Examples
>>> from nipype.interfaces import fsl
>>> flt = fsl.Flirt(infile='subject.nii', reference='template.nii')
>>> xformed = flt.run(inmatrix='xform.mat', outfile='xfm_subject.nii')
Bases: nipype.interfaces.fsl.FSLCommand
Use FSL BET command for skull stripping.
For complete details, see the BET Documentation.
Examples
Initialize Bet with no options, assigning them when calling run:
>>> from nipype.interfaces import fsl
>>> btr = fsl.Bet()
>>> res = btr.run('infile', 'outfile', frac=0.5) # doctest: +SKIP
Assign options through the inputs attribute:
>>> btr = fsl.Bet()
>>> btr.inputs.infile = 'foo.nii'
>>> btr.inputs.outfile = 'bar.nii'
>>> btr.inputs.frac = 0.7
>>> res = btr.run() # doctest: +SKIP
Specify options when creating a Bet instance:
>>> btr = fsl.Bet(infile='infile', outfile='outfile', frac=0.5)
>>> res = btr.run() # doctest: +SKIP
Loop over many inputs (Note: the snippet below would overwrite the outfile each time):
>>> btr = fsl.Bet(infile='infile', outfile='outfile')
>>> fracvals = [0.3, 0.4, 0.5]
>>> for val in fracvals:
... res = btr.run(frac=val) # doctest: +SKIP
Create a Bunch which contains all possible files generated by running the interface. Some files are always generated, others depending on which inputs options are set.
| Parameters: | cwd : /path/to/outfiles
Returns : ——- : outputs : Bunch object
|
|---|
Provides information about file inputs to copy or link to cwd.
Notes
see spm.Realign.get_input_info
Returns a bunch structure with outputs
| Parameters: | (all default to None and are unset) :
|
|---|
Execute the command.
| Parameters: | infile : string
outfile : string, optional
inputs : dict
|
|---|---|
| Returns: | results : InterfaceResult
|
Examples
To pass command line arguments to bet that are not part of the inputs attribute, pass them in with the flags input.
>>> from nipype.interfaces import fsl
>>> btr = fsl.Bet(infile='foo.nii', outfile='bar.nii', flags='-v')
>>> btr.cmdline
'bet foo.nii bar.nii -v'
Bases: nipype.interfaces.base.CommandLine
General support for FSL commands
Provides information about file inputs to copy or link to cwd.
Notes
see spm.Realign.get_input_info
Execute the command.
| Returns: | results : InterfaceResult
|
|---|
Bases: object
A class to encapsulate stuff we’ll need throughout the
This should probably be a singleton class? or do we want to make it possible to wrap a few versions of FSL? In any case, currently we instantiate an instance here called fsl_info
I’m also not sure this is the best ordering for the various attributes and methods. Please feel free to reorder.
Define a generic mapping for a single outfile
The filename is potentially autogenerated by suffixing inputs.infile
| Parameters: | basename : string (required)
fname : string
cwd : string
suffix : string
check : bool
|
|---|
Check if, given a filename, FSL actually produced it.
The maing thing we’re doing here is adding an appropriate extension while globbing. Note that it returns a single string, not a list (different from glob.glob)
Check and or set the global FSL output file type FSLOUTPUTTYPE
| Parameters: | ftype : string
|
|---|---|
| Returns: | fsl_ftype : string
ext : string
|
Grab an image from the standard location.
Could be made more fancy to allow for more relocatability
Check for fsl version on system
| Parameters: | None : |
|---|---|
| Returns: | version : string
|
Bases: nipype.interfaces.fsl.FSLCommand
Use fslmaths to smooth the image
This is dumb, of course - we should use nipy for such things! But it is a step along the way to get the “standard” FSL pipeline in place.
This is meant to be a throwaway class, so it’s not currently very robust. Effort would be better spent integrating basic numpy into nipype
Provides information about file inputs to copy or link to cwd.
Notes
see spm.Realign.get_input_info
Returns a bunch structure with outputs
| Parameters: | (all default to None and are unset) :
|
|---|
Execute the command.
| Returns: | results : InterfaceResult
|
|---|
Bases: nipype.interfaces.fsl.FSLCommand
Use FSL FAST for segmenting and bias correction.
For complete details, see the FAST Documentation.
Examples
>>> from nipype.interfaces import fsl
>>> faster = fsl.Fast(out_basename='myfasted')
>>> fasted = faster.run(['file1','file2'])
>>> faster = fsl.Fast(infiles=['filea','fileb'], out_basename='myfasted')
>>> fasted = faster.run()
Create a Bunch which contains all possible files generated by running the interface. Some files are always generated, others depending on which inputs options are set.
| Returns: | outputs : Bunch object |
|---|---|
| Raises: | IOError :
|
Notes
For each item in Bunch: If [] empty list, optional file was not generated Else, list contains path,filename of generated outputfile(s)
Provides information about file inputs to copy or link to cwd.
Notes
see spm.Realign.get_input_info
Returns a bunch structure with outputs
| Parameters: | (all default to None and are unset) :
|
|---|
Execute the FSL fast command.
| Parameters: | infiles : string or list of strings
inputs : dict
|
|---|---|
| Returns: | results : InterfaceResult
|
Bases: nipype.interfaces.fsl.FSLCommand
Use FSL FLIRT for coregistration.
For complete details, see the FLIRT Documentation.
Examples
>>> from nipype.interfaces import fsl
>>> flt = fsl.Flirt(bins=640, searchcost='mutualinfo')
>>> flt.inputs.infile = 'subject.nii'
>>> flt.inputs.reference = 'template.nii'
>>> flt.inputs.outfile = 'moved_subject.nii'
>>> flt.inputs.outmatrix = 'subject_to_template.mat'
>>> res = flt.run()
Create a Bunch which contains all possible files generated by running the interface. Some files are always generated, others depending on which inputs options are set.
| Returns: | outputs : Bunch object
|
|---|---|
| Raises: | IOError :
|
Provides information about file inputs to copy or link to cwd.
Notes
see spm.Realign.get_input_info
Returns a bunch containing output parameters
| Parameters: | outfile : string, file
|
|---|
Run the flirt command
| Parameters: | infile : string
reference : string
outfile : string, optional
outmatrix : string, optional
inputs : dict
|
|---|---|
| Returns: | results : InterfaceResult
|
Bases: nipype.interfaces.fsl.FSLCommand
Use FSL FNIRT for non-linear registration.
For complete details, see the FNIRT Documentation.
Examples
>>> from nipype.interfaces import fsl
>>> fnt = fsl.Fnirt(affine='affine.mat')
>>> res = fnt.run(reference='ref.nii', infile='anat.nii') # doctests: +SKIP
Create a Bunch which contains all possible files generated by running the interface. Some files are always generated, others depending on which inputs options are set.
| Returns: | outputs : Bunch object |
|---|---|
| Raises: | IOError :
|
Notes
For each item in the outputs, if it’s value is None then the optional file was not generated. Otherwise it contains the path/filename of generated output file(s).
Provides information about file inputs to copy or link to cwd.
Notes
see spm.Realign.get_input_info
Returns a bunch structure with outputs
| Parameters: | fieldcoeff_file : warpedimage : fieldfile : jacobianfield : modulatedreference : intensitymodulation : logfile : |
|---|
Run the fnirt command
Note: technically, only one of infile OR reference need be specified.
You almost certainly want to start with a config file, such as T1_2_MNI152_2mm
| Parameters: | infile : string
reference : string
inputs : dict
|
|---|---|
| Returns: | results : InterfaceResult
|
Examples
T1 -> Mni153
>>> from nipype.interfaces import fsl
>>> fnirt_mprage = fsl.Fnirt()
>>> fnirt_mprage.inputs.imgfwhm = [8, 4, 2]
>>> fnirt_mprage.inputs.sub_sampling = [4, 2, 1]
Specify the resolution of the warps, currently not part of the fnirt_mprage.inputs:
>>> fnirt_mprage.inputs.flags = '--warpres 6, 6, 6'
>>> res = fnirt_mprage.run(infile='subj.nii', reference='mni.nii')
We can check the command line and confirm that it’s what we expect.
>>> fnirt_mprage.cmdline #doctest: +NORMALIZE_WHITESPACE
'fnirt --warpres 6, 6, 6 --infwhm=8,4,2 --in=subj.nii
--ref=mni.nii --subsamp=4,2,1'
Writes out currently set options to specified config file
| Parameters: | configfile : /path/to/configfile |
|---|
Bases: object
Use the template variables above to construct fsf files for feat.
This doesn’t actually run anything, it just creates the .fsf files.
Examples
Need to put a good example here. See opt_list for a list of acceptable inputs.
Note that we currently do stats + post-stats. This is partly determined by the do_contrasts string substitutions below, and partly by the “6” in the feat_header.tcl.
Bases: nipype.interfaces.base.Interface
Generate Feat specific files
See Level1Design().inputs_help() for more information.
| Parameters: | inputs : mapping key, value pairs that will update the Level1Design.inputs attributes : see self.inputs_help() for a list of Level1Design.inputs attributes : |
|---|---|
| Attributes: | inputs : Bunch a (dictionary-like) bunch of options that can be passed to : spm_smooth via a job structure : cmdline : string string used to call matlab/spm via SpmMatlabCommandLine interface : |
| Parameters: | interscan_interval : float (in secs)
session_info : list of dicts
bases : dict {‘name’:{‘basesparam1’:val,...}}
model_serial_correlations : string
contrasts : list of dicts
|
|---|
Returns a bunch structure with outputs
| Parameters: | (all default to None and are unset) :
|
|---|
Bases: nipype.interfaces.fsl.FSLCommand
Use FSL MCFLIRT to do within-modality motion correction.
For complete details, see the MCFLIRT Documentation.
Examples
>>> from nipype.interfaces import fsl
>>> mcflt = fsl.McFlirt(infile='timeseries.nii', cost='mututalinfo')
>>> res = mcflt.run()
Provides information about file inputs to copy or link to cwd.
Notes
see spm.Realign.get_input_info
Returns a bunch structure with outputs
| Parameters: | (all default to None and are unset) :
|
|---|
Runs mcflirt
| Parameters: | cwd : string
infile : string
inputs : dict
|
|---|---|
| Returns: | results : InterfaceResult
|
Examples
>>> from nipype.interfaces import fsl
>>> mcflrt = fsl.McFlirt(cost='mutualinfo')
>>> mcflrtd = mcflrt.run(infile='timeseries.nii')