S15 · Lesson 42 · Imaging lab
How a two-energy X-ray beam hardens with depth, reconstructing a disk from its projections by filtered back-projection, echo levels from a stack of tissue layers, and the echo time that maximizes the contrast between two tissues
Lessons 37 to 41 explained how each imaging method forms its contrast. Every scanner then runs computations that turn measurements into a picture: correcting for a beam whose spectrum changes as it passes through the body, reconstructing a slice from its projections, predicting how strong each echo will be, and choosing timings that make one tissue stand out from another. In this lab you'll write a small version of each and check it against what the physics predicts.
- Two tissues have T2 relaxation times on the sliders. The curve is the difference of their spin-echo signals, , against echo time (equal proton density and full T1 recovery).
- At short TE both signals are near 1 and the difference is small; at long TE both have decayed.
- The difference peaks between the two T2 values, at .
Predict
Two tissues have T2 of 100 ms and 60 ms. Which echo time gives the most contrast between them?
Setting the derivative of to zero gives = 76.6 ms, where the difference is 0.186. Longer echoes lose signal faster than they gain contrast; task 4 finds the optimum numerically too.
Name it
What the lab computes
- Beam hardening: a beam of two equal-weight energies with attenuation coefficients transmits through thickness x, and its effective coefficient falls with x as the low-energy part is filtered out. Uncorrected, this makes the center of a uniform object look less dense than its edge (cupping).
- Filtered back-projection: for parallel projections p(s) over angles from 0 to π, convolve each with the discrete ramp filter (, for odd n, 0 for even n), then add each filtered projection back along its lines, , interpolating linearly between samples. A uniform disk of radius R and attenuation μ has projections .
- Echoes: through layers of impedance and thickness , the echo from each interface has intensity times the attenuation , where R is the intensity reflection coefficient , the product of over the interfaces passed, and α in dB/(cm·MHz).
- MRI contrast: spin-echo signal , and the TE that maximizes the difference between two tissues' T2 decays.
Check
Write transmit(mu1, mu2, x) returning (transmitted fraction, effective attenuation coefficient) for a two-energy beam.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Write fbp_disk(R, mu, N=32, views=60, bins=65): reconstruct an N × N image over the square from −1 to 1 from the analytic projections of a centered disk, sampled at bins points from −1 to 1.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Write echoes(layers, f, alpha=0.5): for a list of (impedance in MRayl, thickness in cm) layers, return the echo level in dB from each interface, relative to the transmitted pulse.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Write spin_echo(pd, t1, t2, tr, te) and best_te(t2a, t2b), the echo time that maximizes the difference between two tissues' T2 decays.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Explain why
Why must CT projections be filtered before they are back-projected?
Back-projection smears each projection value back along the line it was measured on, so every point in the object contributes not only to its own location but to every location along all the lines through it. Summed over angles, a single point becomes a blur that falls off as one over the distance from it, which in frequency terms means the image's spectrum is weighted by 1/|frequency|: fine detail is suppressed and low frequencies piled up. Multiplying each projection's spectrum by |frequency| first, the ramp filter, cancels that weighting exactly, so the back-projected sum reproduces the object. In practice the ramp is rolled off at high frequencies to limit noise.