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
2f1eb997
Commit
2f1eb997
authored
7 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Test case was broken
parent
8f8ce1bd
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
+15
-9
15 additions, 9 deletions
tests/test_image.py
with
15 additions
and
9 deletions
tests/test_image.py
+
15
−
9
View file @
2f1eb997
...
...
@@ -723,9 +723,9 @@ def _test_Image_changeData(imgtype):
assert
img
.
saveState
assert
np
.
all
(
np
.
isclose
(
img
.
dataRange
,
(
dmin
,
dmax
)))
rand
val
=
dmin
+
np
.
random
.
random
()
*
d
range
r
x
,
ry
,
rz
=
randvox
()
#
rand
om value within the existing data
range
r
andval
=
dmin
+
np
.
random
.
random
()
*
drange
rx
,
ry
,
rz
=
randvox
()
img
[
rx
,
ry
,
rz
]
=
randval
assert
np
.
isclose
(
img
[
rx
,
ry
,
rz
],
randval
)
...
...
@@ -738,23 +738,29 @@ def _test_Image_changeData(imgtype):
newdmin
=
dmin
-
100
newdmax
=
dmax
+
100
rx
,
ry
,
rz
=
randvox
()
img
[
rx
,
ry
,
rz
]
=
newdmin
# random value below the data range
minx
,
miny
,
minz
=
randvox
()
img
[
minx
,
miny
,
minz
]
=
newdmin
assert
notified
.
get
(
'
data
'
,
False
)
assert
notified
.
get
(
'
dataRange
'
,
False
)
assert
np
.
isclose
(
img
[
rx
,
ry
,
r
z
],
newdmin
)
assert
np
.
isclose
(
img
[
minx
,
miny
,
min
z
],
newdmin
)
assert
np
.
all
(
np
.
isclose
(
img
.
dataRange
,
(
newdmin
,
dmax
)))
notified
.
pop
(
'
data
'
)
notified
.
pop
(
'
dataRange
'
)
rx
,
ry
,
rz
=
randvox
()
img
[
rx
,
ry
,
rz
]
=
newdmax
# random value above the data range
maxx
,
maxy
,
maxz
=
randvox
()
while
(
maxx
,
maxy
,
maxz
)
==
(
minx
,
miny
,
minz
):
maxx
,
maxy
,
maxz
=
randvox
()
img
[
maxx
,
maxy
,
maxz
]
=
newdmax
assert
notified
.
get
(
'
data
'
,
False
)
assert
notified
.
get
(
'
dataRange
'
,
False
)
assert
np
.
isclose
(
img
[
rx
,
ry
,
r
z
],
newdmax
)
assert
np
.
isclose
(
img
[
maxx
,
maxy
,
max
z
],
newdmax
)
assert
np
.
all
(
np
.
isclose
(
img
.
dataRange
,
(
newdmin
,
newdmax
)))
finally
:
...
...
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