mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-01 05:08:02 +08:00
iradon_sart: Test clip functionality and add a test for it.
This commit is contained in:
@@ -413,5 +413,5 @@ def iradon_sart(radon_image, theta=None, image=None, projection_shifts=None,
|
||||
projection_shifts[angle_index])
|
||||
image += relaxation * image_update
|
||||
if not clip is None:
|
||||
image = clip(image, clip[0], clip[1])
|
||||
image = np.clip(image, clip[0], clip[1])
|
||||
return image
|
||||
|
||||
@@ -347,6 +347,9 @@ def test_iradon_sart():
|
||||
delta = np.mean(np.abs(reconstructed - image))
|
||||
print('delta (2 iterations) =', delta)
|
||||
assert delta < 0.013 * error_factor
|
||||
reconstructed = iradon_sart(sinogram, theta, clip=(0, 1))
|
||||
print('delta (1 iteration, clip) =', delta)
|
||||
assert delta < 0.013 * error_factor
|
||||
|
||||
np.random.seed(1239867)
|
||||
shifts = np.random.uniform(-3, 3, sinogram.shape[1])
|
||||
|
||||
Reference in New Issue
Block a user