diff --git a/fsl/wrappers/bet.py b/fsl/wrappers/bet.py index c9de633f872d3974b49b98fa1a307966d9b5b632..ab72ea9ca9315235d0aba5bf8a91f0ac415b3666 100644 --- a/fsl/wrappers/bet.py +++ b/fsl/wrappers/bet.py @@ -1,9 +1,12 @@ #!/usr/bin/env python # -# bet.py - +# bet.py - Wrapper for the FSL bet command. # # Author: Paul McCarthy <pauldmccarthy@gmail.com> # +"""This module provides the :func:`bet` function, a wrapper for the FSL +`BET <https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/BET>`_ command. +""" import fsl.utils.assertions as asrt @@ -11,19 +14,17 @@ import fsl.utils.run as run from . import wrapperutils as wutils -def pybet(): # ?? - pass - - @wutils.fileOrImage('input', 'output') def bet(input, output, **kwargs): """Delete non-brain tissue from an image of the whole head. - :arg input: Required - :arg output: Required - :arg mask: - :arg robust: - :arg fracintensity: + :arg input: Image to be brain-extracted + :arg output: Output image + :arg mask: Generate a brain mask + :arg seg: If ``False``, a brain extracted image is not + generated. + :arg robust: Robust brain centre estimation + :arg fracintensity: Fractional intensity threshold Refer to the ``bet`` command-line help for details on all arguments. """ @@ -47,3 +48,23 @@ def bet(input, output, **kwargs): cmd += wutils.applyArgStyle('-', argmap, valmap, **kwargs) return run.runfsl(*cmd) + + +@wutils.fileOrImage('input', 'output') +@wutils.fileOrArray('matrix') +def robustfov(input, output=None, **kwargs): + """Wrapper for the ``robustfov`` command. """ + asrt.assertIsNifti(input) + + if output is not None: + kwargs.update({'output' : output}) + + argmap = { + 'output' : 'r', + 'matrix' : 'm' + } + + cmd = ['robustfov', '-i', input] + cmd += wutils.applyArgStyle('-', argmap=argmap, **kwargs) + + return run.runfsl(cmd)