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
4567198b
Commit
4567198b
authored
5 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
TEST: rudimentary test for adjust
parent
d92f8e0f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_image.py
+25
-0
25 additions, 0 deletions
tests/test_image.py
with
25 additions
and
0 deletions
tests/test_image.py
+
25
−
0
View file @
4567198b
...
...
@@ -1430,3 +1430,28 @@ def test_loadMetadata():
gotmeta
=
fslimage
.
loadMetadata
(
img
)
assert
gotmeta
==
meta
def
test_adjust
():
with
tempdir
():
make_image
(
'
image.nii
'
,
dims
=
(
10
,
10
,
10
),
pixdims
=
(
1
,
1
,
1
))
img
=
fslimage
.
Image
(
'
image.nii
'
)
assert
img
.
sameSpace
(
img
.
adjust
(
pixdim
=
(
1
,
1
,
1
)))
assert
img
.
sameSpace
(
img
.
adjust
(
shape
=
(
10
,
10
,
10
)))
adj
=
img
.
adjust
(
shape
=
(
20
,
20
,
20
))
assert
adj
.
shape
==
(
20
,
20
,
20
)
assert
adj
.
pixdim
==
(
0.5
,
0.5
,
0.5
)
adj
=
img
.
adjust
(
pixdim
=
(
0.5
,
0.5
,
0.5
))
assert
adj
.
shape
==
(
20
,
20
,
20
)
assert
adj
.
pixdim
==
(
0.5
,
0.5
,
0.5
)
adj
=
img
.
adjust
(
shape
=
(
8
,
7
,
11
),
origin
=
'
corner
'
)
imgb
=
affine
.
axisBounds
(
img
.
shape
,
img
.
voxToWorldMat
)
adjb
=
affine
.
axisBounds
(
adj
.
shape
,
adj
.
voxToWorldMat
)
assert
np
.
all
(
np
.
isclose
(
imgb
,
adjb
,
rtol
=
1e-5
,
atol
=
1e-5
))
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