L19 CTReconstruction
L19 CTReconstruction
In this notebook, we will reconstruct a CT image from its sinogram using the Radon Transform
and Filtered Backprojection algorithm. The notebook uses the following steps:
In the next step, we will generate a phantom image (Shepp-Logan Phantom) to simulate a test
object for our CT scan.
image = shepp_logan_phantom()
Next, we will generate the sinogram (a series of projections from different angles) using the
Radon transform.
In the next step, we will reconstruct the image from this sinogram using the Filtered
Backprojection (FBP) algorithm.
Radon Transform and Inverse Radon Transform
Radon Transform:
The Radon Transform is a fundamental tool in medical imaging and computed tomography (CT)
that represents the projection of an image along various directions. For a 2D image f ( x , y ), the
Radon transform R f ( θ , t ) is defined as the integral of the image intensity along a line at angle θ
and distance t from the origin.
Where:
• x ′ and y ′ are the coordinates rotated by an angle θ , which are given by:
x ′=x cos ( θ ) + y sin ( θ )
y ′=− x sin ( θ )+ y cos ( θ )
• t is the perpendicular distance from the origin to the projection line.
In essence, the Radon transform sums the image values along lines at different angles,
producing what is called a sinogram (a 2D array of projections).
The formula for the inverse Radon transform can be written as:
π ∞
f ( x , y )=∫ ∫ R f ( θ , t )|t ) d t d θ
0 −∞
This integral reconstructs the original image from the Radon-transformed data, with
appropriate filtering applied to reduce artifacts aSummary Pointshe image quality.
Key Concepts:
• The Radon transform produces projections of an image at various angles.
• The Inverse Radon transform is used to reconstruct the original image from these
projections.
• Filtered Back Projection (FBP) is a widely used algorithm for reconstructing images
from Radon transform data in CT imaging.
Inverse Radon Transform and the Filtered Back Projection
(FBP) Algorithm
The iradon function from the skimage.transform module in Python implements the
Filtered Back Projection (FBP) algorithm to reconstruct an image from its sinogram. The FBP
algorithm is widely used in medical imaging, especially for computed tomography (CT)
reconstruction. The key idea behind FBP is to reconstruct the original image by reversing the
Radon transform through backprojection, combined with a filtering process to reduce blurring
and improve accuracy.
Here, the backprojection process distributes the filtered projection data back over
the image grid.
4. Reconstruction Output:
– After summing the contributions from all projection angles, the resulting image is
the reconstructed version of the original object.
– The result of this process is an approximation of the original image that was
projected into the sinogram.
In iradon, you can specify the filter using the filter_name parameter, and by default, it uses
the ramp filter.
In the next step, we will compare the original and reconstructed images to observe the
reconstruction quality.
ax1.imshow(image, cmap='gray')
ax1.set_title('Original Image')
ax1.axis('off')
ax2.imshow(reconstruction_fbp, cmap='gray')
ax2.set_title('Reconstructed Image')
ax2.axis('off')
plt.show()
return reconstructed_image
ax1.imshow(image, cmap='gray')
ax1.set_title('Original Image')
ax1.axis('off')
ax2.imshow(reconstructed_image, cmap='gray')
ax2.set_title('Reconstructed Image (Optimized FBP)')
ax2.axis('off')
plt.show()
Explanation of the Filtered Back Projection (FBP) Code
1. Mid Index (mid_index):
• mid_index = reconstructed_image.shape[0] // 2
• This variable represents the center of the reconstructed image. It is used to ensure that
the filtered projections are centered correctly in the image grid during the backprojection
process.
• Since the image grid is symmetric (square), dividing the number of pixels by 2 gives the
middle index. This is important when you are rotating and placing projections back onto
the grid, so they are aligned properly around the center.
This approach should execute much faster and produce an accurate reconstruction using the
Filtered Back Projection (FBP) method.