From e63a1fb341052019991b62aff0ea5b1cf414b4cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jostein=20B=C3=B8=20Fl=C3=B8ystad?= Date: Wed, 19 Jun 2013 00:19:31 +0200 Subject: [PATCH] test_radon_transform: debug option for test_iradon_minimal. --- skimage/transform/tests/test_radon_transform.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/skimage/transform/tests/test_radon_transform.py b/skimage/transform/tests/test_radon_transform.py index bc938da8..1c580a4a 100644 --- a/skimage/transform/tests/test_radon_transform.py +++ b/skimage/transform/tests/test_radon_transform.py @@ -172,6 +172,7 @@ def test_radon_minimal(): """ Test for small images for various angles """ + debug = False thetas = [np.arange(180)] for theta in thetas: a = np.zeros((3, 3)) @@ -179,6 +180,8 @@ def test_radon_minimal(): p = radon(a, theta) reconstructed = iradon(p, theta) reconstructed /= np.max(reconstructed) + if debug: + _debug_plot(a, reconstructed) assert np.all(abs(a - reconstructed) < 0.4) b = np.zeros((4, 4)) @@ -186,6 +189,8 @@ def test_radon_minimal(): p = radon(b, theta) reconstructed = iradon(p, theta) reconstructed /= np.max(reconstructed) + if debug: + _debug_plot(b, reconstructed) assert np.all(abs(b - reconstructed) < 0.4) c = np.zeros((5, 5)) @@ -193,6 +198,8 @@ def test_radon_minimal(): p = radon(c, theta) reconstructed = iradon(p, theta) reconstructed /= np.max(reconstructed) + if debug: + _debug_plot(c, reconstructed) assert np.all(abs(c - reconstructed) < 0.4)