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

MNT: move standard_space_roi wrapper into the flirt module

parent 805228a4
No related branches found
No related tags found
No related merge requests found
...@@ -121,7 +121,8 @@ from fsl.wrappers.flirt import (flirt, ...@@ -121,7 +121,8 @@ from fsl.wrappers.flirt import (flirt,
applyxfm4D, applyxfm4D,
concatxfm, concatxfm,
fixscaleskew, fixscaleskew,
mcflirt) mcflirt,
standard_space_roi)
from fsl.wrappers.fnirt import (fnirt, from fsl.wrappers.fnirt import (fnirt,
applywarp, applywarp,
invwarp, invwarp,
...@@ -143,4 +144,8 @@ from fsl.wrappers.misc import (fslreorient2std, ...@@ -143,4 +144,8 @@ from fsl.wrappers.misc import (fslreorient2std,
slicer, slicer,
cluster, cluster,
gps) gps)
from fsl.wrappers.standard_space_roi import standard_space_roi from fsl.wrappers.bianca import (bianca,
bianca_cluster_stats,
bianca_overlap_measures,
bianca_perivent_deep,
make_bianca_mask)
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
# #
# Author: Sean Fitzgibbon <sean.fitzgibbon@ndcn.ox.ac.uk> # Author: Sean Fitzgibbon <sean.fitzgibbon@ndcn.ox.ac.uk>
# Author: Paul McCarthy <pauldmccarthy@gmail.com> # Author: Paul McCarthy <pauldmccarthy@gmail.com>
# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
# #
"""This module provides wrapper functions for the FSL `FLIRT """This module provides wrapper functions for the FSL `FLIRT
<https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FLIRT>`_ tool, and other related <https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FLIRT>`_ tool, and other related
...@@ -17,7 +18,9 @@ tools. ...@@ -17,7 +18,9 @@ tools.
applyxfm4D applyxfm4D
invxfm invxfm
concatxfm concatxfm
fixscaleskew
mcflirt mcflirt
standard_space_roi
""" """
...@@ -175,3 +178,43 @@ def mcflirt(infile, **kwargs): ...@@ -175,3 +178,43 @@ def mcflirt(infile, **kwargs):
cmd += wutils.applyArgStyle('-', argmap=argmap, valmap=valmap, **kwargs) cmd += wutils.applyArgStyle('-', argmap=argmap, valmap=valmap, **kwargs)
return cmd return cmd
@wutils.fileOrImage('input', 'output', 'maskMASK', 'roiMASK',
'ssref', 'altinput')
@wutils.fslwrapper
def standard_space_roi(input, output, **kwargs):
"""Wrapper for the ``standard_space_roi`` command.
Refer to the ``standard_space_roi`` command-line help for details on all
arguments.
"""
asrt.assertIsNifti(input)
argmap = {
'twod' : '2D'
}
valmap = {
'maskFOV' : wutils.SHOW_IF_TRUE,
'maskNONE' : wutils.SHOW_IF_TRUE,
'roiFOV' : wutils.SHOW_IF_TRUE,
'roiNONE' : wutils.SHOW_IF_TRUE,
'd' : wutils.SHOW_IF_TRUE,
'b' : wutils.SHOW_IF_TRUE,
'usesqform' : wutils.SHOW_IF_TRUE,
'displayinit' : wutils.SHOW_IF_TRUE,
'noresample' : wutils.SHOW_IF_TRUE,
'forcescaling' : wutils.SHOW_IF_TRUE,
'applyxfm' : wutils.SHOW_IF_TRUE,
'nosearch' : wutils.SHOW_IF_TRUE,
'noclamp' : wutils.SHOW_IF_TRUE,
'noresampblur' : wutils.SHOW_IF_TRUE,
'2D' : wutils.SHOW_IF_TRUE,
'v' : wutils.SHOW_IF_TRUE
}
cmd = ['standard_space_roi', input, output]
cmd += wutils.applyArgStyle('-', argmap=argmap, valmap=valmap, **kwargs)
return cmd
#!/usr/bin/env python
#
# standard_space_roi.py - Wrapper for the standard_space_roi command.
#
# Author: Fidel Alfaro Almagro
#
"""This module provides the :func:`standard_space_roi` function, a wrapper for
the FSL `standard_space_roi`_ command.
"""
import fsl.utils.assertions as asrt
from . import wrapperutils as wutils
@wutils.fileOrImage('input', 'output', 'maskMASK', 'roiMASK', 'ssref', 'altinput')
@wutils.fslwrapper
def standard_space_roi(input, output, **kwargs):
"""Wrapper for the ``standard_space_roi`` command.
:arg maskFOV: Mask output using transformed standard space FOV (default)
:arg maskMASK: Mask output using transformed standard space mask
:arg maskNONE: Do not mask output
:arg roiFOV: Cut down input FOV using bounding box of the transformed standard space FOV (default)
:arg roiMASK: Cut down input FOV using nonbackground bounding box of the transformed standard space mask
:arg roiNONE: Co not cut down input FOV
:arg ssref Standard space reference image to use (default $FSLDIR/data/standard/MNI152_T1)
:arg altinput Alternative input image to apply the ROI to (instead of the one used to register to the reference)
:arg d Debug (don't delete intermediate files)
:arg b Betpremask, equivalent to: -maskMASK $FSLDIR/data/standard/MNI152_T1_2mm_brain_mask_dil -roiNONE
Refer to the ``standard_space_roi`` command-line help for details on all arguments.
"""
asrt.assertIsNifti(input)
argmap = {
'twod' : '2D'
}
valmap = {
'maskFOV' : wutils.SHOW_IF_TRUE,
'maskNONE' : wutils.SHOW_IF_TRUE,
'roiFOV' : wutils.SHOW_IF_TRUE,
'roiNONE' : wutils.SHOW_IF_TRUE,
'd' : wutils.SHOW_IF_TRUE,
'b' : wutils.SHOW_IF_TRUE,
'usesqform' : wutils.SHOW_IF_TRUE,
'displayinit' : wutils.SHOW_IF_TRUE,
'noresample' : wutils.SHOW_IF_TRUE,
'forcescaling' : wutils.SHOW_IF_TRUE,
'applyxfm' : wutils.SHOW_IF_TRUE,
'nosearch' : wutils.SHOW_IF_TRUE,
'noclamp' : wutils.SHOW_IF_TRUE,
'noresampblur' : wutils.SHOW_IF_TRUE,
'2D' : wutils.SHOW_IF_TRUE,
'v' : wutils.SHOW_IF_TRUE
}
cmd = ['standard_space_roi', input, output]
cmd += wutils.applyArgStyle('-', argmap=argmap, valmap=valmap, **kwargs)
return 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