From 643a1bc1f58dc6015446d97a63977c5f4d5a4c2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jostein=20B=C3=B8=20Fl=C3=B8ystad?= Date: Sat, 6 Jul 2013 18:29:05 +0200 Subject: [PATCH] iradon: Add test for cubic interpolation. --- skimage/transform/tests/test_radon_transform.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/skimage/transform/tests/test_radon_transform.py b/skimage/transform/tests/test_radon_transform.py index 333c298d..1d82b29a 100644 --- a/skimage/transform/tests/test_radon_transform.py +++ b/skimage/transform/tests/test_radon_transform.py @@ -124,11 +124,11 @@ def check_radon_iradon(interpolation_type, filter_type): print('\n\tmean error:', delta) if debug: _debug_plot(image, reconstructed) - if filter_type == 'ramp': - if interpolation_type == 'linear': - allowed_delta = 0.02 - else: + if filter_type in ('ramp', 'shepp-logan'): + if interpolation_type == 'nearest': allowed_delta = 0.03 + else: + allowed_delta = 0.02 else: allowed_delta = 0.05 assert delta < allowed_delta @@ -136,11 +136,12 @@ def check_radon_iradon(interpolation_type, filter_type): def test_radon_iradon(): filter_types = ["ramp", "shepp-logan", "cosine", "hamming", "hann"] - interpolation_types = ["linear", "nearest"] + interpolation_types = ['linear', 'nearest'] for interpolation_type, filter_type in \ itertools.product(interpolation_types, filter_types): yield check_radon_iradon, interpolation_type, filter_type - + # cubic interpolation is slow; only run one test for it + yield check_radon_iradon, 'cubic', 'shepp-logan' def test_iradon_angles(): """