diff --git a/fsl/wrappers/__init__.py b/fsl/wrappers/__init__.py index 3a0297a3ef7af4574087ff3e4f3ace977d1b8d3f..52ca6904f145b26ebc4e4268b699f66b90eb324d 100644 --- a/fsl/wrappers/__init__.py +++ b/fsl/wrappers/__init__.py @@ -82,6 +82,7 @@ from .bet import (bet, # noqa from .eddy import (eddy_cuda, # noqa topup) from .fast import (fast,) # noqa +from .fsl_anat import (fsl_anat,) # noqa from .flirt import (flirt, # noqa invxfm, applyxfm, diff --git a/fsl/wrappers/fsl_anat.py b/fsl/wrappers/fsl_anat.py new file mode 100644 index 0000000000000000000000000000000000000000..b1c2494d496180d2c95a6728d70e9257e1b1d291 --- /dev/null +++ b/fsl/wrappers/fsl_anat.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python +# +# fsl_anat.py - Wrapper for the FSL_ANAT command. +# +# Author: Martin Craig <martin.craig@eng.ox.ac.uk> +# +"""This module provides the :func:`fsl_anat` function, a wrapper for the FSL +`FSL_ANAT <https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/fsl_anat>`_ command. +""" + +import six + +import fsl.utils.assertions as asrt +from . import wrapperutils as wutils + +@wutils.fileOrImage('img', outprefix='out') +@wutils.fslwrapper +def fsl_anat(img, out='fsl_anat', **kwargs): + """Wrapper for the ``fsl_anat`` command. + + :arg img: Input structural image + :arg out: Output directory name + """ + asrt.assertIsNifti(img) + + valmap = { + 'weakbias' : wutils.SHOW_IF_TRUE, + 'noreorient' : wutils.SHOW_IF_TRUE, + 'nocrop' : wutils.SHOW_IF_TRUE, + 'nobias' : wutils.SHOW_IF_TRUE, + 'noreg' : wutils.SHOW_IF_TRUE, + 'nononlinreg' : wutils.SHOW_IF_TRUE, + 'noseg' : wutils.SHOW_IF_TRUE, + 'nosubcortseg' : wutils.SHOW_IF_TRUE, + 'nosearch' : wutils.SHOW_IF_TRUE, + 'betfparam' : wutils.SHOW_IF_TRUE, + 'nocleanup' : wutils.SHOW_IF_TRUE, + } + + argmap = { + 'bias_smoothing' : 's', + 'img_type' : 't', + } + + cmd = ['fsl_anat', '-i', img, '-o', out] + cmd += wutils.applyArgStyle('--=', valmap=valmap, argmap=argmap, singlechar_args=True, **kwargs) + + return cmd