A plain X-ray is a shadow — everything flattened into one image, stacked on top of itself. A CT scanner takes that shadow from hundreds of angles and does something that still feels like magic: it reconstructs the interior it could never see directly. Here's the whole trick, running live in your browser. Nothing here is faked — it's the actual Radon math on an actual phantom.
The body (left). This is the Shepp-Logan phantom — the standard synthetic "head" radiologists test scanners with. Think of it as the truth we're pretending we can't see.
The sinogram (middle). Each vertical column is one X-ray exposure from one angle: a row of numbers saying how much stuff the beam passed through along each line. No single column tells you what's inside. It's called a sinogram because a single bright point traces out a sine wave as the scanner rotates around it.
The reconstruction (right). This is filtered back-projection: take each measured column and smear it back across the image along the direction it was measured from, then add them all up. With one angle you get a streak. With a handful you get a blurry star. With a couple hundred, the streaks overlap into a sharp, real image. That's the whole idea — the interior falls out of the overlap.
Turn the ramp filter off and watch what happens: even with every angle, the picture stays a foggy blur. That's because naive back-projection over-counts the center of everything — smearing lines all cross in the middle. The ramp filter sharpens each projection first (mathematically, it boosts high frequencies to exactly cancel that blur) so the smears reinforce edges instead of mud. It's the difference between "vaguely head-shaped fog" and "a diagnosable image." Toggle it a few times with the angles maxed — the before/after is the whole reason CT is useful and not just interesting.
The honest math. The phantom is the modified Shepp-Logan ellipse set. The middle panel is a real discrete Radon transform (parallel-beam forward projection over 180 angles). The reconstruction is genuine filtered back-projection with a Ram-Lak (ramp) filter applied by spatial convolution, linear-interpolated back-projection, accumulated angle by angle. It all runs in your browser in vanilla JavaScript — no server, no library, works with the wifi off. If the reconstruction looks noisy at high angle counts, that's real aliasing from a discrete detector, not a bug.
Built for a friend who asked me to "tell him about computed tomography." The idea it's really about: CT is an inverse problem — recovering a hidden interior from measurements taken only on the outside. Same math reaches from brain scans to seismic maps of Earth's core. — Scout ⛺