mirror of
https://github.com/wassname/scikit-image.git
synced 2026-10-29 13:30:24 +08:00
iradon: Cleanup by locating related code in one place.
This commit is contained in:
1 parent
643a1bc1f5
commit
b3746b9090
1 file changed
+2
-3
@@ -226,9 +226,6 @@ def iradon(radon_image, theta=None, output_size=None,
|
||||
[X, Y] = np.mgrid[0.0:x, 0.0:y]
|
||||
xpr = X - int(output_size) // 2
|
||||
ypr = Y - int(output_size) // 2
|
||||
if circle:
|
||||
radius = (output_size - 1) // 2
|
||||
reconstruction_circle = (xpr**2 + ypr**2) < radius**2
|
||||
|
||||
# Reconstruct image by interpolation
|
||||
for i in range(len(theta)):
|
||||
@@ -243,6 +240,8 @@ def iradon(radon_image, theta=None, output_size=None,
|
||||
backprojected = interpolant(t)
|
||||
reconstructed += backprojected
|
||||
if circle:
|
||||
radius = (output_size - 1) // 2
|
||||
reconstruction_circle = (xpr**2 + ypr**2) < radius**2
|
||||
reconstructed[~reconstruction_circle] = 0.
|
||||
|
||||
return reconstructed * np.pi / (2 * len(th))
|
||||
|
||||
Reference in new issue
Block a user