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
7e2594c9
Commit
7e2594c9
authored
6 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
TEST: Unit test for expectedShape
parent
75fa408e
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_imagewrapper.py
+49
-0
49 additions, 0 deletions
tests/test_imagewrapper.py
with
49 additions
and
0 deletions
tests/test_imagewrapper.py
+
49
−
0
View file @
7e2594c9
...
@@ -257,6 +257,55 @@ def coverageDataRange(data, coverage, slices=None):
...
@@ -257,6 +257,55 @@ def coverageDataRange(data, coverage, slices=None):
return
np
.
min
(
volmin
),
np
.
max
(
volmax
)
return
np
.
min
(
volmin
),
np
.
max
(
volmax
)
def
test_expectedShape
():
tests
=
[
((
slice
(
None
),
),
(
10
,),
(
1
,
(
10
,
))),
((
slice
(
None
),
slice
(
None
)),
(
10
,
10
),
(
2
,
(
10
,
10
))),
((
slice
(
None
),
slice
(
None
),
slice
(
None
)),
(
10
,
10
,
10
),
(
3
,
(
10
,
10
,
10
))),
((
slice
(
None
),
slice
(
None
),
slice
(
None
)),
(
10
,
10
,
10
),
(
3
,
(
10
,
10
,
10
))),
((
slice
(
None
),
slice
(
None
),
slice
(
None
),
slice
(
None
)),
(
10
,
10
,
10
,
10
),
(
4
,
(
10
,
10
,
10
,
10
))),
((
1
,
slice
(
None
),
slice
(
None
)),
(
10
,
10
,
10
),
(
2
,
(
10
,
10
))),
((
slice
(
1
,
3
),
slice
(
None
),
slice
(
None
)),
(
10
,
10
,
10
),
(
3
,
(
2
,
10
,
10
))),
((
slice
(
None
),
1
,
slice
(
None
)),
(
10
,
10
,
10
),
(
2
,
(
10
,
10
))),
((
slice
(
None
),
slice
(
1
,
3
),
slice
(
None
)),
(
10
,
10
,
10
),
(
3
,
(
10
,
2
,
10
))),
((
slice
(
None
),
slice
(
None
),
1
),
(
10
,
10
,
10
),
(
2
,
(
10
,
10
))),
((
slice
(
None
),
slice
(
None
),
slice
(
1
,
3
),
),
(
10
,
10
,
10
),
(
3
,
(
10
,
10
,
2
))),
((
slice
(
None
),
slice
(
None
),
slice
(
1
,
20
),
),
(
10
,
10
,
10
),
(
3
,
(
10
,
10
,
9
))),
]
for
slc
,
shape
,
exp
in
tests
:
explen
,
exp
=
exp
gotlen
,
got
=
imagewrap
.
expectedShape
(
slc
,
shape
)
assert
explen
==
gotlen
assert
tuple
(
exp
)
==
tuple
(
got
)
def
test_sliceObjToSliceTuple
():
def
test_sliceObjToSliceTuple
():
func
=
imagewrap
.
sliceObjToSliceTuple
func
=
imagewrap
.
sliceObjToSliceTuple
...
...
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