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
tomotools
Nabu
Commits
bc21aca9
Commit
bc21aca9
authored
Nov 18, 2019
by
Pierre Paleo
Browse files
Multi-FBP seems to be OK
parent
8aa27872
Changes
1
Hide whitespace changes
Inline
Side-by-side
nabu/reconstruction/tests/test_fbp.py
View file @
bc21aca9
...
...
@@ -33,7 +33,7 @@ class TestFBP(ParametrizedTestCase):
"""
Simple test of a FBP on a 512x512 slice
"""
B
=
Backprojector
(
512
,
500
)
B
=
Backprojector
(
(
500
,
512
)
)
res
=
B
.
fbp
(
self
.
sino_512
)
delta_clipped
=
self
.
clip_to_inner_circle
(
res
-
self
.
ref_512
)
...
...
@@ -47,7 +47,7 @@ class TestFBP(ParametrizedTestCase):
"""
Test FBP of a 511x511 slice where the rotation axis is at (512-1)/2.0
"""
B
=
Backprojector
(
511
,
500
,
rot_center
=
255.5
)
B
=
Backprojector
(
(
500
,
511
)
,
rot_center
=
255.5
)
res
=
B
.
fbp
(
self
.
sino_511
)
ref
=
self
.
ref_512
[:
-
1
,
:
-
1
]
...
...
@@ -58,6 +58,23 @@ class TestFBP(ParametrizedTestCase):
def
test_multi_fbp
(
self
):
multi_sino
=
np
.
tile
(
self
.
sino_511
,
(
4
,
1
,
1
))
B
=
Backprojector
(
multi_sino
.
shape
,
rot_center
=
255.5
)
res
=
B
.
fbp
(
multi_sino
)
self
.
assertLess
(
np
.
max
(
np
.
abs
(
np
.
std
(
res
,
axis
=
0
))),
1e-5
,
"Something wrong with multi-FBP"
)
ref
=
self
.
ref_512
[:
-
1
,
:
-
1
]
delta_clipped
=
self
.
clip_to_inner_circle
(
res
[
0
]
-
ref
)
err_max
=
np
.
max
(
np
.
abs
(
delta_clipped
))
self
.
assertLess
(
err_max
,
self
.
tol
,
"Max error is too high"
)
...
...
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