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
FSL
fslpy
Commits
387da90e
Commit
387da90e
authored
Jun 02, 2022
by
Paul McCarthy
🚵
Browse files
TEST: Another wrapper+pathlib test
parent
c3e50e94
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/test_wrappers/test_wrapperutils.py
View file @
387da90e
...
...
@@ -476,6 +476,22 @@ def test_fileOrThing_outprefix():
def
test_fileOrThing_pathlib
():
@
wutils
.
fileOrImage
(
'img'
,
'out'
)
def
basefunc
(
img
,
out
):
img
=
np
.
asanyarray
(
nib
.
load
(
img
).
dataobj
)
outimg
=
nib
.
nifti1
.
Nifti1Image
(
img
*
5
,
np
.
eye
(
4
))
nib
.
save
(
outimg
,
out
)
with
tempdir
.
tempdir
()
as
td
:
img
=
nib
.
nifti1
.
Nifti1Image
(
np
.
array
([[
1
,
2
],
[
3
,
4
]]),
np
.
eye
(
4
))
exp
=
np
.
asanyarray
(
img
.
dataobj
)
*
5
nib
.
save
(
img
,
'img.nii'
)
basefunc
(
pathlib
.
Path
(
'img.nii'
),
pathlib
.
Path
(
'output.nii'
))
assert
np
.
all
(
np
.
asanyarray
(
nib
.
load
(
'output.nii'
)
.
dataobj
)
==
exp
)
def
test_fileOrThing_outprefix_pathlib
():
@
wutils
.
fileOrImage
(
'img'
,
outprefix
=
'output_base'
)
def
basefunc
(
img
,
output_base
):
img
=
np
.
asanyarray
(
nib
.
load
(
img
).
dataobj
)
...
...
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