Skip to content

[DOC] update FSL preprocess #1881

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 30 additions & 19 deletions nipype/interfaces/fsl/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,17 @@ class BET(FSLCommand):
"""Use FSL BET command for skull stripping.

For complete details, see the `BET Documentation.
<http://www.fmrib.ox.ac.uk/fsl/bet2/index.html>`_
<https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/BET/UserGuide>`_

Examples
--------
>>> from nipype.interfaces import fsl
>>> from nipype.testing import example_data
>>> btr = fsl.BET()
>>> btr.inputs.in_file = example_data('structural.nii')
>>> btr.inputs.in_file = 'structural.nii'
>>> btr.inputs.frac = 0.7
>>> btr.inputs.out_file = 'brain_anat.nii'
>>> btr.cmdline # doctest: +ALLOW_UNICODE
'bet structural.nii brain_anat.nii -f 0.70'
>>> res = btr.run() # doctest: +SKIP

"""
Expand Down Expand Up @@ -275,7 +277,7 @@ class FASTOutputSpec(TraitedSpec):

mixeltype = File(desc="path/name of mixeltype volume file _mixeltype")

partial_volume_map = File(desc="path/name of partial volume file _pveseg")
partial_volume_map = File(desc='path/name of partial volume file _pveseg')
partial_volume_files = OutputMultiPath(File(
desc='path/name of partial volumes files one for each class, _pve_x'))

Expand All @@ -288,18 +290,17 @@ class FAST(FSLCommand):
""" Use FSL FAST for segmenting and bias correction.

For complete details, see the `FAST Documentation.
<http://www.fmrib.ox.ac.uk/fsl/fast4/index.html>`_
<https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FAST>`_

Examples
--------
>>> from nipype.interfaces import fsl
>>> from nipype.testing import example_data

Assign options through the ``inputs`` attribute:

>>> fastr = fsl.FAST()
>>> fastr.inputs.in_files = example_data('structural.nii')
>>> out = fastr.run() #doctest: +SKIP
>>> fastr.inputs.in_files = 'structural.nii'
>>> fastr.inputs.out_basename = 'fast_'
>>> fastr.cmdline # doctest: +ALLOW_UNICODE
'fast -o fast_ -S 1 structural.nii'
>>> out = fastr.run() # doctest: +SKIP

"""
_cmd = 'fast'
Expand All @@ -308,12 +309,12 @@ class FAST(FSLCommand):

def _format_arg(self, name, spec, value):
# first do what should be done in general
formated = super(FAST, self)._format_arg(name, spec, value)
formatted = super(FAST, self)._format_arg(name, spec, value)
if name == 'in_files':
# FAST needs the -S parameter value to correspond to the number
# of input images, otherwise it will ignore all but the first
formated = "-S %d %s" % (len(value), formated)
return formated
formatted = "-S %d %s" % (len(value), formatted)
return formatted

def _list_outputs(self):
outputs = self.output_spec().get()
Expand Down Expand Up @@ -526,7 +527,7 @@ class FLIRT(FSLCommand):
"""Use FSL FLIRT for coregistration.

For complete details, see the `FLIRT Documentation.
<http://www.fmrib.ox.ac.uk/fsl/flirt/index.html>`_
<https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FLIRT>`_

To print out the command line help, use:
fsl.FLIRT().inputs_help()
Expand Down Expand Up @@ -655,14 +656,18 @@ class MCFLIRT(FSLCommand):
"""Use FSL MCFLIRT to do within-modality motion correction.

For complete details, see the `MCFLIRT Documentation.
<http://www.fmrib.ox.ac.uk/fsl/mcflirt/index.html>`_
<https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/MCFLIRT>`_

Examples
--------
>>> from nipype.interfaces import fsl
>>> from nipype.testing import example_data
>>> mcflt = fsl.MCFLIRT(in_file=example_data('functional.nii'), cost='mutualinfo')
>>> res = mcflt.run() # doctest: +SKIP
>>> mcflt = fsl.MCFLIRT()
>>> mcflt.inputs.in_file = 'functional.nii'
>>> mcflt.inputs.cost = 'mutualinfo'
>>> mcflt.inputs.out_file = 'moco.nii'
>>> mcflt.cmdline # doctest: +ALLOW_UNICODE
'mcflirt -in functional.nii -cost mutualinfo -out moco.nii'
>>> res = mcflt.run() # doctest: +SKIP

"""
_cmd = 'mcflirt'
Expand Down Expand Up @@ -908,6 +913,9 @@ class FNIRTOutputSpec(TraitedSpec):
class FNIRT(FSLCommand):
"""Use FSL FNIRT for non-linear registration.

For complete details, see the `FNIRT Documentation.
<https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FNIRT>`_

Examples
--------
>>> from nipype.interfaces import fsl
Expand Down Expand Up @@ -1208,6 +1216,9 @@ class SUSANOutputSpec(TraitedSpec):
class SUSAN(FSLCommand):
""" use FSL SUSAN to perform smoothing

For complete details, see the `SUSAN Documentation.
<https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/SUSAN>`_

Examples
--------

Expand Down