Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Christoph Arthofer
fslpy
Commits
3dcfedbf
Commit
3dcfedbf
authored
Nov 25, 2020
by
Evan Edmond
Browse files
ENH: wrapper and test for fsl_prepare_fieldmap
parent
8e6af3ea
Changes
3
Hide whitespace changes
Inline
Side-by-side
fsl/wrappers/__init__.py
View file @
3dcfedbf
...
...
@@ -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
...
...
fsl/wrappers/fugue.py
View file @
3dcfedbf
...
...
@@ -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
tests/test_wrappers/test_wrappers.py
View file @
3dcfedbf
...
...
@@ -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
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment