From df0b060c696da4fe03322b40931833a3beabb5ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jostein=20B=C3=B8=20Fl=C3=B8ystad?= Date: Wed, 19 Jun 2013 11:32:38 +0200 Subject: [PATCH] test_radon_transform: Change test criterion for sinogram_circle. --- skimage/transform/tests/test_radon_transform.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/skimage/transform/tests/test_radon_transform.py b/skimage/transform/tests/test_radon_transform.py index 7f517801..5eef1e1c 100644 --- a/skimage/transform/tests/test_radon_transform.py +++ b/skimage/transform/tests/test_radon_transform.py @@ -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():