Skip to content

Commit

Permalink
Merge pull request #171 from emmanuelle/modif_radon
Browse files Browse the repository at this point in the history
BUG: Division by zero for small arrays in iradon.
  • Loading branch information
stefanv committed Apr 9, 2012
2 parents 76270f0 + 3c9ab47 commit cdb61f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion skimage/transform/radon_transform.py
Expand Up @@ -135,7 +135,7 @@ def iradon(radon_image, theta=None, output_size=None,
img = radon_image.copy()
# resize image to next power of two for fourier analysis
# speeds up fourier and lessens artifacts
order = max(64, 2 ** np.ceil(np.log(2 * n) / np.log(2)))
order = max(64., 2 ** np.ceil(np.log(2 * n) / np.log(2)))
# zero pad input image
img.resize((order, img.shape[1]))
# construct the fourier filter
Expand Down
3 changes: 3 additions & 0 deletions skimage/transform/tests/test_radon_transform.py
Expand Up @@ -30,6 +30,9 @@ def test_radon_iradon():
reconstructed = iradon(radon(image), filter="ramp", interpolation="nearest")
delta = np.mean(abs(image - reconstructed))
assert delta < 0.05
size = 20
image = np.tri(size) + np.tri(size)[::-1]
reconstructed = iradon(radon(image), filter="ramp", interpolation="nearest")

def test_iradon_angles():
"""
Expand Down

0 comments on commit cdb61f8

Please sign in to comment.