fsl.wrappers.fslmaths
¶
This module provides the fslmaths
class, which acts as a wrapper
for the fslmaths
command-line tool.
-
class
fsl.wrappers.fslmaths.
fslmaths
(input)[source]¶ Bases:
object
Perform mathematical manipulation of images.
fslmaths
is unlike the other FSL wrapper tools in that it provides an object-oriented method-chaining interface, which is hopefully easier to use than constructing afslmaths
command-line call. For example, the following call to thefslmaths
wrapper function:fslmaths('input.nii').thr(0.25).mul(-1).run('output.nii')
will be translated into the following command-line call:
fslmaths input.nii -thr 0.25 -mul -1 output.nii
The
fslmaths
wrapper function can also be used with in-memory images. If no output file name is passed to therun()
method, the result is loaded into memory and returned as anibabel
image. For example:import nibabel as nib input = nib.load('input.nii') output = fslmaths(input).thr(0.25).mul(-1).run()
-
fillh
()[source]¶ fill holes in a binary mask (holes are internal - i.e. do not touch the edge of the FOV).
-
uthr
(image)[source]¶ use image number to upper-threshold current image (zero anything above the number).
-