Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
fslpy
Commits
2f1eb997
Commit
2f1eb997
authored
Aug 09, 2017
by
Paul McCarthy
🚵
Browse files
Test case was broken
parent
8f8ce1bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/test_image.py
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
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment