Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
fslpy
Commits
3dcfedbf
Commit
3dcfedbf
authored
4 years ago
by
Evan Edmond
Browse files
Options
Downloads
Patches
Plain Diff
ENH: wrapper and test for fsl_prepare_fieldmap
parent
8e6af3ea
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
fsl/wrappers/__init__.py
+2
-1
2 additions, 1 deletion
fsl/wrappers/__init__.py
fsl/wrappers/fugue.py
+14
-0
14 additions, 0 deletions
fsl/wrappers/fugue.py
tests/test_wrappers/test_wrappers.py
+12
-0
12 additions, 0 deletions
tests/test_wrappers/test_wrappers.py
with
28 additions
and
1 deletion
fsl/wrappers/__init__.py
+
2
−
1
View file @
3dcfedbf
...
@@ -101,7 +101,8 @@ from .fslmaths import (fslmaths,) # noqa
...
@@ -101,7 +101,8 @@ from .fslmaths import (fslmaths,) # noqa
from
.fslstats
import
(
fslstats
,)
# noqa
from
.fslstats
import
(
fslstats
,)
# noqa
from
.fugue
import
(
fugue
,
# noqa
from
.fugue
import
(
fugue
,
# noqa
prelude
,
prelude
,
sigloss
)
sigloss
,
fsl_prepare_fieldmap
)
from
.melodic
import
(
melodic
,
# noqa
from
.melodic
import
(
melodic
,
# noqa
fsl_regfilt
)
fsl_regfilt
)
from
.misc
import
(
fslreorient2std
,
# noqa
from
.misc
import
(
fslreorient2std
,
# noqa
...
...
This diff is collapsed.
Click to expand it.
fsl/wrappers/fugue.py
+
14
−
0
View file @
3dcfedbf
...
@@ -83,3 +83,17 @@ def prelude(**kwargs):
...
@@ -83,3 +83,17 @@ def prelude(**kwargs):
**
kwargs
)
**
kwargs
)
return
cmd
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
This diff is collapsed.
Click to expand it.
tests/test_wrappers/test_wrappers.py
+
12
−
0
View file @
3dcfedbf
...
@@ -385,3 +385,15 @@ def test_tbss():
...
@@ -385,3 +385,15 @@ def test_tbss():
assert
fw
.
tbss
.
non_FA
(
'
alt
'
)[
0
]
==
'
'
.
join
([
exes
[
'
non_FA
'
],
'
alt
'
])
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
]
==
\
assert
fw
.
tbss
.
fill
(
'
stat
'
,
0.4
,
'
mean_fa
'
,
'
output
'
,
n
=
True
).
stdout
[
0
]
==
\
'
'
.
join
([
exes
[
'
fill
'
],
'
stat
'
,
'
0.4
'
,
'
mean_fa
'
,
'
output
'
,
'
-n
'
])
'
'
.
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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment