diff --git a/fsl/wrappers/__init__.py b/fsl/wrappers/__init__.py index 55a3b14dd37cf12c9e9717ea7415f9fe9ee25e97..c86358e4f65dff5eaec95fcbbfa31d7dd0058fa9 100644 --- a/fsl/wrappers/__init__.py +++ b/fsl/wrappers/__init__.py @@ -6,16 +6,42 @@ # """This package contains wrappers for various FSL command line tools, allowing them to be called from Python. + + +Most of these wrapper functions strive to provide as-close an interface to the +command-line tool as possible. Most functions use positional arguments for +required options, and keyword arguments for all other options, with argument +names equivalent to command line option names. + + +For options where this is not possible (e.g. ``flirt -2D``),an alias is used +instead. Aliases may also be used to provide a more readable interface (e.g. +the :func:`.bet` function uses ``mask`` instead of ``m``). + + +Wrapper functions for commands which accept NIfTI image or numeric text files +will for the most part accept either in-memory ``nibabel`` images/Numpy arrays +or file names as inputs. For commands which produce image or numeric text file +outputs, the special :data:`.LOAD` value can be used to indicate that the file +should be loaded and returned in-memory from the wrapper function. For example, +if we want to FLIRT two images and get the result, we can do this:: + + import nibabel as nib + from fsl.wrappers import flirt, LOAD + + src = nib.load('src.nii') + ref = nib.load('ref.nii') + aligned = flirt(src, ref, out=LOAD)['out'] + + +If you are writing wrapper functions, read through the :mod:`.wrapperutils` +module - it contains several useful functions and decorators. """ -from .wrapperutils import (applyArgStyle, # noqa - required, - fileOrImage, - fileOrArray, - LOAD, - SHOW_IF_TRUE, - HIDE_IF_TRUE) -from .bet import (bet,) # noqa + +from .wrapperutils import (LOAD,) # noqa +from .bet import (bet, # noqa + robustfov) from .eddy import (eddy_cuda, # noqa topup) from .flirt import (flirt, # noqa