CT Reconstruction with Filtered Back-Projection

CT Reconstruction with Filtered Back-Projection

Objective

Rebuild a cross-section from its shadows

A CT scanner measures how much X-ray energy is absorbed along thousands of lines through the body, from many angles. The image has to be computed from those projections.

In this experiment I implemented Filtered Back-Projection (FBP) — the algorithm behind decades of clinical CT — from first principles in Python, without a reconstruction library, and measured how faithfully it recovers a known test object.

Tools & Data

Language Python
Numerics NumPy
Signal processing SciPy FFT (fft, ifft, fftshift)
Imaging Pillow — bicubic rotation, padding, image difference
Visualisation Matplotlib
Test object Shepp-Logan head phantom

Algorithm, Implemented from Scratch

One function per stage of the CT pipeline

  1. padImage()

    Zero-pads the image to a square the length of its diagonal so nothing is truncated when it rotates.

  2. getProj() — Radon transform

    Rotates the object through 0–180° in 1° steps and sums along columns, simulating detector readings and building the 181-angle sinogram.

  3. projFilter() — ramp filter

    Filters every projection in the frequency domain with a windowed ramp (Ram-Lak) filter to undo the blur of plain back-projection.

  4. backproject()

    Smears each filtered projection back across the image plane at its angle and accumulates the result.

  5. Normalise, crop, compare

    Rescales to 8-bit, crops to the original field of view and computes an absolute error map against the ground truth.

Phantom and Sinogram

Phantom and Sinogram

Key Concepts Demonstrated

Radon Transform

How a 2D object becomes a sinogram — each row a detector position, each column a projection angle.

Frequency-Domain Filtering

Why unfiltered back-projection blurs (1/r), and how a ramp filter in Fourier space corrects it.

Back-Projection

Reconstructing the image by distributing filtered projections back along their acquisition lines.

Quantitative Validation

Using a phantom with known ground truth and a difference image to judge reconstruction accuracy.

Why It Matters

Understanding the algorithm, not just calling it

FBP is still the reference against which iterative and deep-learning CT reconstruction is measured, and low-dose CT research is largely about improving on it. Implementing the Radon transform, the filter and back-projection by hand builds the intuition needed to tune reconstruction kernels, diagnose artefacts and evaluate learned reconstructions honestly.

Coursework for the Medical Imaging Laboratory (BME-3202), B.Sc. Biomedical Engineering, Islamic University.

Want something like this?

Let's talk about your project requirements.

Start a Project