ViewWiki

The world, a little closer

Medical imaging.

An X-ray squashes the whole body into one shadow. A CT scanner takes hundreds from all around and works out a single slice. How?

Explore the scene Interactive article

01 / The experiment

Many shadows. One slice.

Move the slice along the body, change how many angles the scanner measures from, then choose Slice to see the image it rebuilds.

Still of the Medical imaging 3D scene, which explores: How can a computer see a slice of you that no camera ever photographed?
Interactive scene

Loading the interactive version…

The explanation below is available while the scene loads.

A patient in a hospital gown lies face up on the table. Inside, the body is modelled as a phantom of overlapping ellipses of bone, muscle, fat, blood, lung and gas, with X-ray attenuation for about 70 keV. Every view is calculated exactly, each detector reading averaged across its width, and the slice is rebuilt on a 256 × 256 grid (192 × 192 on phones).The drum turns about twenty times slower than a real one, the X-ray fan is drawn although X-rays are invisible, and the rebuild treats the rays as parallel, as scanners do after re-sorting their fan. There is no photon noise, scatter or beam hardening.

02 / Three slices

One body, three windows.

The scanner measures the same thing in every slice. What changes from head to abdomen is the tissue, so each region is shown through its own window: the range of HU spread from black to white.

Through the eyes01
A slice through a head at the level of the eyes, a centimetre thick, lying cut face up on a dark backdrop: dark red muscle across the front with the two eyes as grey discs, a pale ring of skull round a thin dark line of fluid, then a band of pinkish-grey brain round a large pale core of white matter.

Head

Grey and white matter differ by only about 15 HU, so the brain window is narrow: 80 HU from black to white, centred on 40. Small differences in the brain become clear shades of grey.

Window
Brain, 80 / 40 HU
Shows well
Grey and white matter, the eyes in front
Hides
The skull: all bone is one white
Through the heart02
A slice through a chest, a centimetre thick, lying cut face up between slices of the two upper arms: a yellow layer of fat under the skin, dark red muscle with pale rib ends round the edge, two spongy pink lungs filling each side, flecked with dark vessels that are larger near the middle and smaller towards the ribs, a dark red heart ringed with fat between them, two round vessels behind it and the spine at the back. Each arm shows a round bone in red muscle.

Chest

A lung filled by a held breath is mostly air, about −850 HU. A wide window set low shows the lungs dark and the vessels inside them bright, while bone stays white and the heart a single grey.

Window
Lung, 1500 / −600 HU
Shows well
Air-filled lungs and the vessels inside them
Hides
Heart, blood and muscle: one grey
Liver and kidneys03
A slice through an upper abdomen, a centimetre thick, lying cut face up between slices of the two forearms: a yellow layer of fat under the skin round dark red muscle, a large, darker liver on the left, the stomach as a pale pink disc on the right with the dark spleen below it, two dark vessels in front of the spine, and two kidneys ringed with fat either side of it. Each forearm shows its two bones.

Abdomen

Liver, kidneys and muscle differ by a few tens of HU. A window 400 HU wide, centred just above water, tells the organs apart and the fat round them.

Window
Soft tissue, 400 / 40 HU
Shows well
Liver, kidneys, spleen and fat
Hides
Air goes black and bone white
The big idea

A CT slice is never photographed. Each reading is the attenuation added up along one line, and with enough lines from enough angles the computer can work out what lies at every point.

ln(I₀/I) = ∫ μ ds

A shadow stacks everything

A plain X-ray picture is a shadow. X-rays pass through the body to a detector, and wherever they cross bone more of them are stopped, so the bone shows white. But each point of the picture records everything along one straight line through the body: ribs, heart, spine and lungs are piled on top of one another. A shadow cannot tell you how deep anything is.

A CT scanner (computed tomography: drawing by slices) gets round this. Its X-ray tube and a curved row of detectors sit on opposite sides of a ring, the gantry, and spin round the patient two to four times a second. The table slides the body through the ring, and each turn measures one thin slice.

Every reading is a sum along a line

Each detector reading says how strongly the X-rays were dimmed on their way from the tube. Every tissue weakens the beam by a fixed fraction per centimetre, its attenuation. Bone weakens it most, water-rich muscle and organs less, fat a little less again, and the air in the lungs hardly at all. Over a whole path the fractions multiply, so the logarithm of the dimming is simply the sum of the attenuation along the line.

One sweep across the detector, with the tube at one angle, gives a projection: a profile of those sums. Stack the profiles from every angle, one row each, and you get a sinogram. Each point inside the body traces a sine-shaped stripe through it, because its shadow slides from side to side as the tube goes round.

From shadows back to a slice

How do you undo the sums? Take each profile and smear it back across the image along the lines it was measured on. Where many smears from different angles agree, something dense must be there. This back-projection alone gives a blurred image, so each profile is first sharpened by a filter that boosts fine detail and adds a slight dip beside every edge. Summed over every angle, the dips cancel the blur exactly. This filtered back-projection is what the scanner’s computer does, and the mathematics behind it was published by Johann Radon in 1917, long before anyone could use it. Godfrey Hounsfield built the first clinical scanner in 1971.

Try it: choose Head under Slice position, set Projection angles to 6 and choose Slice under Build the slice. Then slide it up to 180 and watch the streaks fade.

Back to the experiment

How many angles?

With only a few views, every sharp edge smears into straight streaks that point back towards the angles that were measured, and the skull or the spine throws spokes across the whole slice. As views are added, the streaks from different directions overlap and cancel, and the real shapes emerge: the black lungs, the bright vertebra, the grey liver and kidneys. A real scanner takes about a thousand views every turn.

The slider also shows why the method cares about dose. Each view needs X-rays, and X-rays can damage cells. A chest CT gives a dose of several millisieverts: about two years of natural background radiation, and a few hundred times a chest X-ray. Scanners are designed to get a clear slice from as few X-rays as they can.

Other ways in

CT shows bone, air and dense tissue sharply, but soft tissues that attenuate X-rays almost equally look nearly the same grey. MRI instead measures radio signals from hydrogen nuclei in a strong magnet, and it tells soft tissues apart with no ionising radiation. Ultrasound times echoes of high-pitched sound bouncing off boundaries inside the body; it is cheap, safe and moving, but it cannot see through bone or gas. Doctors choose the tool by what they need to see.

What this model leaves out

The patient’s insides are modelled as a phantom: ellipses with fixed attenuation values, those of tissue without an injected contrast agent, so organs such as the liver and the spleen differ only by their own small differences in density, and the lungs are filled by a held breath. The scene computes each view exactly, with no photon noise, scattered X-rays or beam hardening (the low-energy part of the beam being soaked up first), all of which add grain and artefacts to real images. Real scanners measure many slices at once with dozens of detector rows, often while the table moves in a spiral, and use far finer grids than 256 × 256. The drum is slowed down enormously, and the X-ray fan, invisible in reality, is drawn with its brightness compressed so the shadow of the body shows.

04 / Learn this in a course

Practise it, step by step.

This lesson teaches the topic with checked questions.

  1. Medical imaging Physics · Seeing and sensing