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
7054db9d
Commit
7054db9d
authored
7 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Double checking that voxToScaledVox test is working
parent
e2fa21fc
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_image.py
+11
-8
11 additions, 8 deletions
tests/test_image.py
with
11 additions
and
8 deletions
tests/test_image.py
+
11
−
8
View file @
7054db9d
...
...
@@ -12,7 +12,6 @@ import os.path as op
import
itertools
as
it
import
tempfile
import
shutil
import
glob
import
pytest
...
...
@@ -856,9 +855,12 @@ def _test_Image_5D(imgtype):
assert
img
.
ndims
==
5
def
test_Image_voxelsToScaledVoxels
():
def
test_Image_voxToScaledVox_analyze
():
_test_Image_voxToScaledVox
(
0
)
def
test_Image_voxToScaledVox_nifti1
():
_test_Image_voxToScaledVox
(
1
)
def
test_Image_voxToScaledVox_nifti2
():
_test_Image_voxToScaledVox
(
2
)
def
_test_Image_voxToScaledVox
(
imgtype
):
imgTypes
=
[
0
,
1
,
2
]
dims
=
[(
10
,
10
,
10
)]
pixdims
=
[(
-
1
,
1
,
1
),
(
1
,
1
,
1
),
...
...
@@ -879,14 +881,15 @@ def test_Image_voxelsToScaledVoxels():
return
xf
for
imgType
,
dim
,
pixdim
in
it
.
product
(
imgTypes
,
dims
,
pixdims
):
nimg
=
make_image
(
imgtype
=
img
T
ype
,
dims
=
dim
,
pixdims
=
pixdim
)
for
dim
,
pixdim
in
it
.
product
(
dims
,
pixdims
):
nimg
=
make_image
(
imgtype
=
img
t
ype
,
dims
=
dim
,
pixdims
=
pixdim
)
img
=
fslimage
.
Image
(
nimg
)
expected
=
expect
(
img
T
ype
,
dim
,
pixdim
)
result
=
img
.
voxelsToScaledVoxels
(
)
expected
=
expect
(
img
t
ype
,
dim
,
pixdim
)
invexpected
=
npla
.
inv
(
expected
)
assert
np
.
all
(
np
.
isclose
(
result
,
expected
))
assert
np
.
all
(
np
.
isclose
(
expected
,
img
.
voxToScaledVoxMat
))
assert
np
.
all
(
np
.
isclose
(
invexpected
,
img
.
scaledVoxToVoxMat
))
def
test_Image_sameSpace
():
...
...
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