Home / Science / Physics / Biophysics and medical physics / CT reconstruction demoTool #972

CT reconstruction demo: sinogram and filtered back-projection with ramp, Shepp-Logan, cosine and Hann filters

See how a CT scanner turns X-ray projections into a slice: make the sinogram of a made-up object, rebuild it by filtered back-projection, and watch what too few angles, a limited angular range, noise and the choice of filter do to the image.

Keep it one tap away for everyday use.

Bookmark CT reconstruction demo?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. Object
  2. Sinogram
  3. Filter
  4. Image
Nothing is uploadedWorks offline once open

Scan

Angles: how many views the scanner takes; a parallel-beam scan needs 180° for a complete set. The filter sharpens the back-projection: the ramp is exact for perfect data, the windowed ones trade a little sharpness for less noise. The grey window sets which values show as black and white (narrow it, for example 0.1 to 0.45 on the head-like object, to see soft details).

Sinogram and reconstruction

Parallel-beam geometry with projections worked out exactly from the ellipse formulas; real scanners use fan or cone beams, X-ray spectra and many corrections. The objects are made up. For study, not a substitute for professional judgement.

Download

What it does

A CT scanner never sees the slice it shows you. It measures how much an X-ray beam is weakened along thousands of straight lines through the body, from many directions. Stacking those projections, one row per angle, gives the sinogram (every point in the body traces a sine wave across it). Turning the sinogram back into an image is called reconstruction, and the classic method is filtered back-projection: sharpen each projection with a filter, then smear it back across the image along the direction it was taken, and add up all the angles.

This page does all of it in your browser. It works out the projections of a made-up object exactly (each part of the object is an ellipse, whose line integrals have a closed formula), reconstructs it with the filter you choose, and compares the result with the true object.

How to use it

  1. Choose an object: a made-up head-like slice, a uniform disc, or pairs of small dots for judging resolution.
  2. Choose the image size, the number of projection angles and the angles covered.
  3. Pick a reconstruction filter and, if you like, add noise to the projections.
  4. Set the grey window: the values shown as black and white. Narrow it to bring out small differences, as radiologists do with CT window settings.
  5. Compare the object, sinogram and reconstruction, the middle-row profile and the filter curves. Download the sinogram or the profile as CSV, or the report as an image, PDF or Word file.

What each option does

  • None (plain back-projection): smearing without filtering blurs every point into a 1/r halo. It shows why the filter is needed.
  • Ramp (Ram-Lak): boosts each frequency in proportion to itself; exact for perfect data but it also boosts noise.
  • Shepp-Logan, cosine, Hann: the ramp multiplied by a window that falls off towards the highest frequency, giving smoother, less noisy images that are slightly less sharp. Hann rolls off most.
  • Number of angles: with N detector bins you need about π/2 × N angles; fewer leaves streaks.
  • Limited angles: without a full 180° some edges are never seen and smear out.

Worked example

With the defaults (head-like object, 128 × 128, 90 angles over 180°, ramp filter, no noise) the page shows an error of 0.0688, that is 6.88 % of the brightest value, mostly at the sharp outer edges. It also says about 202 angles would sample the image fully. Drop to 12 angles and the error rises to 0.232 with obvious streaks. Cover only 0 to 120° and it is 0.198. Now add 5 % noise: the ramp filter gives 0.171, Shepp-Logan 0.145, cosine 0.114 and Hann 0.107, the smoothest window winning once noise dominates.

Tips

  • Narrow the grey window to 0.1 to 0.45 on the head-like object to see the soft inner details and the streaks.
  • Use the small dots with the Hann filter and then the ramp filter to see resolution traded against noise.
  • Every row of the sinogram adds up to almost the same total (the object’s total attenuation), whatever the angle.

FAQ

Is this how real scanners work? The principle is the same. Real scanners use fan or cone beams, a spectrum of X-ray energies, calibration, and often iterative reconstruction. This is parallel-beam, single energy, with exact projections.

Why do the values have no units? The made-up object uses arbitrary attenuation units. Real CT images are shown in Hounsfield units relative to water.

Can I use this for clinical work? No. It is for study, not a substitute for professional judgement.

Where the numbers come from

  • Radon transform, parallel-beam projections of ellipses and filtered back-projection with the discrete ramp kernel: Kak, A. C. and Slaney, M. (1988), Principles of Computerized Tomographic Imaging, chapter 3 (also free from the authors). Window shapes (sinc, cosine, Hann): standard signal processing.
  • Checked against an independent numpy implementation (numeric line integrals of the object, numpy.fft filtering, numpy.interp back-projection) written for the tests; they agree to 1e-13.
  • The test objects are made up for this page.

Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

Last updated 2026-11-09.

Related tools

MRI physics simulator #971 Step the Bloch equations through spin echo, gradient echo and inversion recovery sequences, see how TR, TE, flip angle and TI set the brightness of each tissue, find the Ernst angle and the inversion time that nulls a tissue, and watch an image appear from k-space with a 2D Fourier transform. Radioactive decay and specific activity calculator #99 Activity of F-18, Tc-99m, I-131, C-14, P-32 and 28 more nuclides (or any half-life) at any date and time, a printable decay table, when it falls to a given activity, carrier-free specific and molar activity, and the labelled fraction of your sample. Bq, MBq, GBq, µCi, mCi and Ci. Ultrasound calculator #973 Work out what happens to an ultrasound pulse: acoustic impedance, how much reflects and transmits at a boundary (also at an angle), attenuation and penetration depth, wavelength and axial resolution, near-field length and beam spread, echo timing, and the Doppler shift with its aliasing limit. Optical tweezers calibration #974 Paste a trapped bead's position record and get the trap stiffness two ways: from the corner frequency of a Lorentzian fitted to the power spectrum (with the aliasing correction for sampled data and Faxén's correction near a surface), and from equipartition. Works in volts too, giving the detector's nm per volt. 1D Schrödinger solver #923 Choose a textbook potential, type a formula or draw your own, and get the lowest energy levels and wavefunctions of the one-dimensional Schrödinger equation by the matrix (finite-difference) method, with the exact levels alongside for the box, harmonic oscillator, finite well, Morse, linear and Pöschl–Teller potentials. Adduct and neutral loss calculator #984 Type a formula or a neutral monoisotopic mass and get the m/z of 25 common electrospray adducts in positive and negative mode, the ions left after common neutral losses (water, ammonia, CO2, sugars, phosphate and your own), and match a list of observed m/z values within a ppm tolerance. With no molecule, it turns observed m/z values into candidate neutral masses.