Medical Imaging II: MRI, Ultrasound & Nuclear Medicine
Imaging without X-rays — and imaging function. Learn MRI physics (spin, Larmor frequency, RF excitation, T1/T2 relaxation, gradients and k-space, contrast weighting, safety), ultrasound (acoustic impedance, reflection, attenuation, transducers, resolution, B-mode, Doppler), nuclear medicine (radiotracers, gamma cameras, SPECT, PET), and image processing basics — with Python for Larmor frequencies, T1-weighted contrast and ultrasound resolution.
MRI uses strong magnetic fields and radio waves to image hydrogen nuclei in water and fat, giving superb soft-tissue contrast without ionising radiation. Ultrasound uses sound echoes — cheap, portable, real-time and safe, ideal for pregnancy and cardiology. Nuclear medicine images physiology: where a radioactive tracer goes reveals metabolism, perfusion or receptor density.
Each modality measures a different physical property, so clinicians combine them (PET/CT, PET/MRI) for the most complete picture.
An analogy
MRI is like tuning a radio to the hydrogen nuclei: in a strong magnet they precess at a precise frequency, and gradients make that frequency depend on position — so the 'station' tells you where each signal came from. Ultrasound is like a bat's echolocation inside the body.
MRI basics
Hydrogen nuclei behave like tiny magnets. In B₀ (1.5–3 T clinically) they align slightly and precess at the Larmor frequency. An RF pulse tips the net magnetisation; as it relaxes, it induces a signal in receiver coils. T1 describes recovery along B₀, T2 the loss of phase coherence. Different tissues have different T1/T2 — the source of MRI's soft-tissue contrast.
Spatial encoding and sequences
Gradient coils make the field — and thus frequency and phase — vary with position: slice selection, frequency encoding and phase encoding fill k-space, and a 2-D inverse FFT produces the image. Sequences (spin echo, gradient echo, inversion recovery/FLAIR, diffusion-weighted, fMRI BOLD, MR angiography) trade contrast, speed and artefacts. Parallel imaging and compressed sensing accelerate scans.
Ultrasound
Piezoelectric array transducers send 2–15 MHz pulses; echoes at tissue boundaries (impedance mismatches) return with delays proportional to depth. B-mode builds a grey-scale image in real time; beamforming focuses and steers electronically. Doppler measures blood velocity from frequency shifts (colour, pulsed-wave, continuous-wave). Coupling gel removes air, which reflects ~99.9% of sound. Safety indices: thermal index (TI) and mechanical index (MI).
Nuclear medicine and safety
Radiopharmaceuticals (⁹⁹ᵐTc for SPECT, T½ 6 h; ¹⁸F-FDG for PET, T½ 110 min) accumulate by physiology. Gamma cameras with collimators image single photons (SPECT); PET detects coincident 511 keV annihilation photons, giving quantitative uptake (SUV). MRI safety: projectile risk from ferromagnetic objects, RF heating (SAR limits), gradient-induced nerve stimulation and acoustic noise, implant compatibility (MR safe/conditional/unsafe), gadolinium contrast considerations.
Formulas
- Larmor frequency:
f₀ = γ·B₀ - Spin-echo signal:
S ∝ ρ·(1 − e^(−TR/T1))·e^(−TE/T2) - Spatial encoding:
f(x) = γ(B₀ + G_x·x) - Ultrasound reflection:
R = ((Z₂ − Z₁)/(Z₂ + Z₁))² - Depth from echo time:
d = c·t/2 - Doppler shift:
Δf = 2f₀·v·cos θ / c - Radioactive decay:
A = A₀·e^(−ln2·t/T½)
Worked example: Larmor frequency
Given: B₀ = 3 T
Find: f₀.
- 42.58 × 3
Answer: 127.7 MHz
Worked example: Soft tissue–bone reflection
Given: Z_tissue 1.63, Z_bone 7.8 MRayl
Find: Reflected intensity.
- ((7.8 − 1.63)/(7.8 + 1.63))²
Answer: ≈ 43% — bone shadows deeper structures
Worked example: Doppler
Given: f₀ = 5 MHz, v = 0.5 m/s, θ = 60°
Find: Δf.
- 2 × 5e6 × 0.5 × 0.5/1540
Answer: ≈ 1.62 kHz (audible)
Larmor frequency, T1 contrast and ultrasound resolution
import math
# Larmor frequency and T1/T2 relaxation (1.5 T)
gamma = 42.577e6 # Hz/T for hydrogen
for B0 in (1.5, 3.0):
print(f"B0 = {B0} T: Larmor frequency {gamma*B0/1e6:.1f} MHz")
tissues = {"white matter": (600, 80), "grey matter": (950, 100), "CSF": (4000, 2000)} # T1, T2 ms at 1.5 T
TR, TE = 500, 15 # T1-weighted spin echo
for name, (T1, T2) in tissues.items():
S = (1 - math.exp(-TR / T1)) * math.exp(-TE / T2)
print(f"{name:12s}: T1-weighted signal {S:.3f}")
# Ultrasound: wavelength and axial resolution in soft tissue
c = 1540.0
for f in (3.5e6, 10e6):
lam = c / f
print(f"{f/1e6:4.1f} MHz: wavelength {lam*1000:.3f} mm, axial resolution ~{lam*1000:.2f} mm (2-cycle pulse / 2)")
print(f"echo from 10 cm depth returns after {2*0.10/c*1e6:.0f} us")
# B0 = 1.5 T: Larmor frequency 63.9 MHz
# B0 = 3.0 T: Larmor frequency 127.7 MHz
# white matter: T1-weighted signal 0.469
# grey matter : T1-weighted signal 0.352
# CSF : T1-weighted signal 0.117
# 3.5 MHz: wavelength 0.440 mm, axial resolution ~0.44 mm (2-cycle pulse / 2)
# 10.0 MHz: wavelength 0.154 mm, axial resolution ~0.15 mm (2-cycle pulse / 2)
# echo from 10 cm depth returns after 130 usWith short TR and TE, tissues with short T1 (white matter, fat) are bright and fluid (CSF) is dark — a T1-weighted image. Long TR/TE flips the contrast (T2-weighted: CSF bright). Higher ultrasound frequency improves resolution but attenuates faster (~0.5 dB/cm/MHz), limiting depth.
Common mistakes
- Wrong: Bringing ferromagnetic objects into the MRI room. — Right: Strict zone screening — the field is always on.
- Wrong: Doppler at angles near 90°. — Right: Keep θ ≤ 60° to limit velocity error.
- Wrong: Choosing high ultrasound frequency for deep organs. — Right: Lower frequency penetrates deeper.
Applications
- Neurology: MRI for stroke, MS, tumours; fMRI for brain mapping.
- Obstetrics & cardiology: Fetal ultrasound, echocardiography.
- Oncology: PET/CT staging and treatment response.
- Point-of-care: Handheld ultrasound probes on smartphones.
Key takeaways
- MRI: f = γB₀; contrast from T1/T2 via TR/TE.
- Ultrasound: echoes from impedance mismatches, d = ct/2.
- Doppler measures blood velocity.
- PET/SPECT image function with radiotracers.
Going further
- k-space & compressed sensing: Faster MRI by under-sampling and sparse reconstruction.
- Elastography: Imaging tissue stiffness with ultrasound or MRI.
- Theranostics: Radiopharmaceuticals that both image and treat.