test_radon_transform: Change test criterion for sinogram_circle.

This commit is contained in:
Jostein Bø Fløystad
2013-06-19 11:32:38 +02:00
parent 934f1040ad
commit df0b060c69
@@ -241,11 +241,17 @@ def check_sinogram_circle_to_square(size):
image = _random_circle((size, size))
theta = np.linspace(0., 180., size, False)
sinogram_circle = radon(image, theta, circle=True)
argmax_shape = lambda a: np.unravel_index(np.argmax(a), a.shape)
print('\n\targmax of circle:', argmax_shape(sinogram_circle))
sinogram_square = radon(image, theta, circle=False)
print('\targmax of square:', argmax_shape(sinogram_square))
sinogram_circle_to_square = _sinogram_circle_to_square(sinogram_circle)
print('\targmax of circle to square:',
argmax_shape(sinogram_circle_to_square))
error = abs(sinogram_square - sinogram_circle_to_square)
print(np.mean(error), np.max(error))
assert np.allclose(sinogram_square, sinogram_circle_to_square)
assert (argmax_shape(sinogram_square)
== argmax_shape(sinogram_circle_to_square))
def test_sinogram_circle_to_square():