Commit 9db1e57e authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

Merge branch 'evan-patch-fmap' into 'master'

ENH: wrapper and test for fsl_prepare_fieldmap

See merge request fsl/fslpy!265
parents 3cf668d1 d57adba3
Pipeline #6137 passed with stages
in 15 minutes and 30 seconds
......@@ -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,19 @@ def prelude(**kwargs):
**kwargs)
return cmd
@wutils.fileOrImage('phase_image', 'magnitude_image', 'out_image')
@wutils.fslwrapper
def fsl_prepare_fieldmap(phase_image, magnitude_image, out_image, deltaTE, scanner=None, **kwargs):
"""Wrapper for the ``fsl_prepare_fieldmap`` command. <scanner> defaults to 'SIEMENS'"""
if scanner is None:
scanner = 'SIEMENS'
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,14 @@ 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(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