Commit 3dcfedbf authored by Evan Edmond's avatar Evan Edmond
Browse files

ENH: wrapper and test for fsl_prepare_fieldmap

parent 8e6af3ea
......@@ -101,7 +101,8 @@ from .fslmaths import (fslmaths,) # noqa
from .fslstats import (fslstats,) # noqa
from .fugue import (fugue, # noqa
prelude,
sigloss)
sigloss,
fsl_prepare_fieldmap)
from .melodic import (melodic, # noqa
fsl_regfilt)
from .misc import (fslreorient2std, # noqa
......
......@@ -83,3 +83,17 @@ def prelude(**kwargs):
**kwargs)
return cmd
@wutils.fileOrImage('phase_image', 'magnitude_image', 'out_image')
@wutils.fslwrapper
def fsl_prepare_fieldmap(scanner, phase_image, magnitude_image, out_image, deltaTE, **kwargs):
"""Wrapper for the ``fsl_prepare_fieldmap`` command."""
valmap = {
'nocheck' : wutils.SHOW_IF_TRUE,
}
cmd = ['fsl_prepare_fieldmap', scanner, phase_image, magnitude_image, out_image, str(deltaTE)]
cmd += wutils.applyArgStyle('--=', valmap=valmap, **kwargs)
return cmd
......@@ -385,3 +385,15 @@ def test_tbss():
assert fw.tbss.non_FA('alt')[0] == ' '.join([exes['non_FA'], 'alt'])
assert fw.tbss.fill('stat', 0.4, 'mean_fa', 'output', n=True).stdout[0] == \
' '.join([exes['fill'], 'stat', '0.4', 'mean_fa', 'output', '-n'])
def test_fsl_prepare_fieldmap():
with asrt.disabled(), run.dryrun(), mockFSLDIR(bin=('fsl_prepare_fieldmap',)) as fsldir:
fpf = op.join(fsldir, 'bin', 'fsl_prepare_fieldmap')
result = fw.fsl_prepare_fieldmap(scanner='SIEMENS',
phase_image='ph',
magnitude_image='mag',
out_image='out',
deltaTE=2.46,
nocheck=True)
expected = (fpf, ('SIEMENS', 'ph', 'mag', 'out', '2.46', '--nocheck'))
assert checkResult(result.stdout[0], *expected)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment