Skip to content
Snippets Groups Projects
Commit 468ac028 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

Cleaned up bet module

parent dc380d50
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python #!/usr/bin/env python
# #
# bet.py - # bet.py - Wrapper for the FSL bet command.
# #
# Author: Paul McCarthy <pauldmccarthy@gmail.com> # 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 import fsl.utils.assertions as asrt
...@@ -11,19 +14,17 @@ import fsl.utils.run as run ...@@ -11,19 +14,17 @@ import fsl.utils.run as run
from . import wrapperutils as wutils from . import wrapperutils as wutils
def pybet(): # ??
pass
@wutils.fileOrImage('input', 'output') @wutils.fileOrImage('input', 'output')
def bet(input, output, **kwargs): def bet(input, output, **kwargs):
"""Delete non-brain tissue from an image of the whole head. """Delete non-brain tissue from an image of the whole head.
:arg input: Required :arg input: Image to be brain-extracted
:arg output: Required :arg output: Output image
:arg mask: :arg mask: Generate a brain mask
:arg robust: :arg seg: If ``False``, a brain extracted image is not
:arg fracintensity: generated.
:arg robust: Robust brain centre estimation
:arg fracintensity: Fractional intensity threshold
Refer to the ``bet`` command-line help for details on all arguments. Refer to the ``bet`` command-line help for details on all arguments.
""" """
...@@ -47,3 +48,23 @@ def bet(input, output, **kwargs): ...@@ -47,3 +48,23 @@ def bet(input, output, **kwargs):
cmd += wutils.applyArgStyle('-', argmap, valmap, **kwargs) cmd += wutils.applyArgStyle('-', argmap, valmap, **kwargs)
return run.runfsl(*cmd) 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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment