Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yaoyuping
nnDetection
Commits
cbfdb1d8
Commit
cbfdb1d8
authored
Jun 02, 2022
by
Baumgartner, Michael
Browse files
allclose for float comp
parent
fcc1cd64
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
nndet/utils/check.py
nndet/utils/check.py
+8
-8
No files found.
nndet/utils/check.py
View file @
cbfdb1d8
...
@@ -283,15 +283,15 @@ def _check_itk_params(
...
@@ -283,15 +283,15 @@ def _check_itk_params(
ValueError: raised if spacing does not match
ValueError: raised if spacing does not match
"""
"""
for
idx
,
img
in
enumerate
(
img_seq
[
1
:],
start
=
1
):
for
idx
,
img
in
enumerate
(
img_seq
[
1
:],
start
=
1
):
if
not
(
np
.
asarray
(
img_seq
[
0
].
GetDimension
())
==
\
if
not
(
np
.
allclose
(
np
.
asarray
(
img_seq
[
0
].
GetDimension
())
==
\
np
.
asarray
(
img
.
GetDimension
()))
.
all
(
):
np
.
asarray
(
img
.
GetDimension
()))):
raise
ValueError
(
f
"Expected
{
paths
[
idx
]
}
and
{
paths
[
0
]
}
to have same dimensions!"
)
raise
ValueError
(
f
"Expected
{
paths
[
idx
]
}
and
{
paths
[
0
]
}
to have same dimensions!"
)
if
not
(
np
.
asarray
(
img_seq
[
0
].
GetOrigin
())
==
\
if
not
(
np
.
allclose
(
np
.
asarray
(
img_seq
[
0
].
GetOrigin
())
==
\
np
.
asarray
(
img
.
GetOrigin
()))
.
all
(
):
np
.
asarray
(
img
.
GetOrigin
()))):
raise
ValueError
(
f
"Expected
{
paths
[
idx
]
}
and
{
paths
[
0
]
}
to have same origin!"
)
raise
ValueError
(
f
"Expected
{
paths
[
idx
]
}
and
{
paths
[
0
]
}
to have same origin!"
)
if
not
(
np
.
asarray
(
img_seq
[
0
].
GetDirection
())
==
\
if
not
(
np
.
allclose
(
np
.
asarray
(
img_seq
[
0
].
GetDirection
())
==
\
np
.
asarray
(
img
.
GetDirection
()))
.
all
(
):
np
.
asarray
(
img
.
GetDirection
()))):
raise
ValueError
(
f
"Expected
{
paths
[
idx
]
}
and
{
paths
[
0
]
}
to have same direction!"
)
raise
ValueError
(
f
"Expected
{
paths
[
idx
]
}
and
{
paths
[
0
]
}
to have same direction!"
)
if
not
(
np
.
asarray
(
img_seq
[
0
].
GetSpacing
())
==
\
if
not
(
np
.
allclose
(
np
.
asarray
(
img_seq
[
0
].
GetSpacing
())
==
\
np
.
asarray
(
img
.
GetSpacing
()))
.
all
(
):
np
.
asarray
(
img
.
GetSpacing
()))):
raise
ValueError
(
f
"Expected
{
paths
[
idx
]
}
and
{
paths
[
0
]
}
to have same spacing!"
)
raise
ValueError
(
f
"Expected
{
paths
[
idx
]
}
and
{
paths
[
0
]
}
to have same spacing!"
)
Write
Preview
Markdown
is supported
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