Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Michiel Cottaar
fslpy
Commits
dca6233b
Commit
dca6233b
authored
7 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
unit test for canonicalShape function
parent
97fb4b59
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
+28
-1
28 additions, 1 deletion
tests/test_image.py
with
28 additions
and
1 deletion
tests/test_image.py
+
28
−
1
View file @
dca6233b
...
...
@@ -284,7 +284,7 @@ def _test_Image_atts(imgtype):
dims
,
pixdims
,
dtype
=
atts
expdims
=
image
wrapper
.
canonicalShape
(
dims
)
expdims
=
fsl
image
.
canonicalShape
(
dims
)
expndims
=
len
(
expdims
)
ndims
=
len
(
dims
)
pixdims
=
pixdims
[:
ndims
]
...
...
@@ -340,6 +340,33 @@ def _test_Image_atts2(imgtype):
assert
img
.
intent
==
intent
def
test_canonicalShape
():
# (input, expected)
tests
=
[
((
10
,),
(
10
,
1
,
1
)),
((
10
,
1
),
(
10
,
1
,
1
)),
((
10
,
1
,
1
),
(
10
,
1
,
1
)),
((
10
,
1
,
1
,
1
),
(
10
,
1
,
1
)),
((
10
,
1
,
1
,
1
,
1
),
(
10
,
1
,
1
)),
((
10
,
10
),
(
10
,
10
,
1
)),
((
10
,
10
,
1
),
(
10
,
10
,
1
)),
((
10
,
10
,
1
,
1
),
(
10
,
10
,
1
)),
((
10
,
10
,
1
,
1
,
1
),
(
10
,
10
,
1
)),
((
10
,
10
,
10
),
(
10
,
10
,
10
)),
((
10
,
10
,
10
,
1
),
(
10
,
10
,
10
)),
((
10
,
10
,
10
,
1
,
1
),
(
10
,
10
,
10
)),
((
10
,
10
,
10
,
10
),
(
10
,
10
,
10
,
10
)),
((
10
,
10
,
10
,
10
,
1
),
(
10
,
10
,
10
,
10
)),
((
10
,
10
,
10
,
10
,
1
,
1
),
(
10
,
10
,
10
,
10
)),
((
10
,
10
,
10
,
10
,
10
),
(
10
,
10
,
10
,
10
,
10
)),
((
10
,
10
,
10
,
10
,
10
,
1
),
(
10
,
10
,
10
,
10
,
10
)),
]
for
input
,
expected
in
tests
:
assert
tuple
(
fslimage
.
canonicalShape
(
input
))
==
expected
def
test_looksLikeImage
():
"""
Test the looksLikeImage function.
"""
...
...
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