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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Evan Edmond
fslpy
Commits
4d06ec8e
Commit
4d06ec8e
authored
5 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
TEST: Extra test for resample_image script
parent
aafa8133
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_scripts/test_resample_image.py
+12
-0
12 additions, 0 deletions
tests/test_scripts/test_resample_image.py
with
12 additions
and
0 deletions
tests/test_scripts/test_resample_image.py
+
12
−
0
View file @
4d06ec8e
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
import
numpy
as
np
import
numpy
as
np
import
pytest
import
fsl.scripts.resample_image
as
resample_image
import
fsl.scripts.resample_image
as
resample_image
...
@@ -67,3 +69,13 @@ def test_resample_image_ref():
...
@@ -67,3 +69,13 @@ def test_resample_image_ref():
assert
np
.
all
(
np
.
isclose
(
res
.
shape
,
(
20
,
20
,
20
)))
assert
np
.
all
(
np
.
isclose
(
res
.
shape
,
(
20
,
20
,
20
)))
assert
np
.
all
(
np
.
isclose
(
res
.
pixdim
,
(
0.5
,
0.5
,
0.5
)))
assert
np
.
all
(
np
.
isclose
(
res
.
pixdim
,
(
0.5
,
0.5
,
0.5
)))
assert
np
.
all
(
np
.
isclose
(
res
.
voxToWorldMat
,
expv2w
))
assert
np
.
all
(
np
.
isclose
(
res
.
voxToWorldMat
,
expv2w
))
def
test_resample_image_bad_options
():
with
tempdir
():
img
=
Image
(
make_random_image
(
'
image.nii.gz
'
,
dims
=
(
10
,
10
,
10
)))
with
pytest
.
raises
(
SystemExit
)
as
e
:
resample_image
.
main
(
'
image resampled -d 0.5 0.5 0.5
'
'
-s 20 20 20
'
.
split
())
assert
e
.
value
.
code
!=
0
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