Medical Imaging I: X-ray, CT & Radiation Safety

Seeing inside with ionising radiation. Learn X-ray production (tube, bremsstrahlung, kVp and mAs), interactions (photoelectric, Compton), Beer–Lambert attenuation and contrast, detectors, radiography and fluoroscopy, computed tomography (projections, sinograms, filtered back-projection, Hounsfield units, helical and dual-energy CT), image quality (contrast, noise, resolution) and radiation dose and protection — with Python for attenuation, HU and dose comparisons.

Röntgen's 1895 discovery of X-rays gave medicine its first look inside the living body. Today, projection radiography, fluoroscopy, mammography and CT together perform billions of examinations per year.

CT (Hounsfield and Cormack, Nobel 1979) reconstructs cross-sectional images from many projections — one of the great applications of mathematics in medicine. Because X-rays are ionising, every exam balances image quality against radiation dose.

An analogy

An X-ray image is a shadow picture: bones cast darker shadows (on film, brighter on the image) because they absorb more X-rays. CT is like reconstructing a loaf's internal structure from shadows cast from hundreds of directions, instead of slicing it.

Making X-rays

In an X-ray tube, electrons accelerated by 50–150 kV strike a tungsten anode; most energy becomes heat (rotating anodes spread it), about 1% becomes X-rays (bremsstrahlung plus characteristic lines). kVp sets photon energy (penetration and contrast), mAs sets the number of photons (noise and dose). Filters remove low-energy photons that would only add dose.

Interactions, contrast and detectors

At diagnostic energies, photoelectric absorption (∝ Z³/E³) gives strong bone and iodine contrast; Compton scattering dominates in soft tissue and degrades images (anti-scatter grids help). Iodine and barium contrast agents highlight vessels and the gut. Detectors evolved from film to computed radiography plates to flat-panel digital detectors (indirect CsI scintillator + photodiodes, or direct a-Se).

Computed tomography

A rotating tube and detector array acquire projections from hundreds of angles; each projection is a line integral of μ. The sinogram collects them, and filtered back-projection (or iterative/deep-learning reconstruction) recovers the cross-section. Helical CT with multi-row detectors scans the whole chest in seconds; dual-energy CT separates materials (iodine, calcium, uric acid). Windowing (level/width) maps HU to grey levels for viewing.

Image quality and radiation protection

Quality metrics: contrast, noise (∝ 1/√photons), spatial resolution (MTF), contrast-to-noise ratio, artefacts (beam hardening, metal, motion). Dose metrics: CTDIvol, DLP, effective dose (mSv). Biological risk is modelled with the linear no-threshold assumption (~5%/Sv lifetime cancer risk). Protection principles: justification, optimisation (ALARA — time, distance, shielding), dose limits for staff (20 mSv/yr), dose-reduction tools (automatic exposure control, iterative reconstruction), and diagnostic reference levels.

Formulas

Worked example: Half-value layer

Given: μ = 0.20 /cm (soft tissue)

Find: HVL.

Answer: 3.47 cm

Worked example: CT number

Given: μ = 0.21 /cm, μ_water = 0.20

Find: HU.

Answer: +50 HU (e.g. enhanced tissue/blood)

Worked example: Inverse square

Given: Dose rate 40 µSv/h at 1 m

Find: At 2 m.

Answer: 10 µSv/h — distance is cheap protection

Attenuation, Hounsfield units and dose

import math
# Beer-Lambert attenuation of X-rays through tissue (60 keV approx. mu values)
mu = {"soft tissue": 0.20, "bone": 0.60}     # 1/cm
for name, m in mu.items():
    for x in (1, 5):
        print(f"{name:11s} {x} cm: transmitted {math.exp(-m*x)*100:5.1f}%")
# CT numbers (Hounsfield units)
mu_w = 0.20
for name, m in (("water", 0.20), ("fat", 0.18), ("bone", 0.60), ("air", 0.0)):
    print(f"HU({name}) = {1000*(m-mu_w)/mu_w:+.0f}")
# Effective dose comparison
print(f"chest CT 7 mSv = {7/0.02:.0f} chest X-rays (0.02 mSv) = {7/3*12:.0f} months of background (3 mSv/yr)")
# soft tissue 1 cm: transmitted  81.9%
# soft tissue 5 cm: transmitted  36.8%
# bone        1 cm: transmitted  54.9%
# bone        5 cm: transmitted   5.0%
# HU(water) = +0
# HU(fat) = -100
# HU(bone) = +2000
# HU(air) = -1000
# chest CT 7 mSv = 350 chest X-rays (0.02 mSv) = 28 months of background (3 mSv/yr)

The difference in attenuation creates contrast. The Hounsfield scale fixes water at 0 and air at −1000; cortical bone reaches +1000 to +2000 depending on energy. A chest CT gives far more dose than a radiograph, which is why CT is justified and optimised (ALARA).

Common mistakes

Applications

Key takeaways

Going further