HomeArticlesMedical Technology & Imaging Physics

How MRI Works — Nuclear Magnetic Resonance and Medical Imaging

From proton spin alignment to full-body scans — the physics behind MRI imaging explained step by step.

mysimulator teamUpdated July 2026≈ 14 min read▶ Open the simulation

Proton spin and magnetic moments

Every proton (hydrogen nucleus) has an intrinsic angular momentum called spin. Although spin is a quantum property with no classical analogue, it behaves macroscopically like a tiny bar magnet: each proton carries a magnetic moment μ aligned along its spin axis.

μ = γ · ℏ · I
γ (gyromagnetic ratio for ¹H) = 2.675 × 10⁸ rad s⁻¹ T⁻¹
ℏ = reduced Planck constant = 1.055 × 10⁻³⁴ J·s
I = spin quantum number = ½ for ¹H

The human body is ~60% water (H₂O), making hydrogen by far the most abundant NMR-active nucleus. Clinical MRI therefore primarily images proton density and tissue relaxation properties.

Alignment in a strong static field (B₀)

Outside a magnetic field proton spins point in random directions and cancel out. Inside the bore of an MRI scanner, a superconducting magnet generates a powerful static field B₀ (typically 1.5 T or 3 T — up to 50,000 times Earth's field). Quantum mechanics allows only two energy states for a spin-½ nucleus in field B₀, separated by an energy difference ΔE = γℏB₀. At body temperature there is a small Boltzmann excess of ~7 spins per million in the lower-energy (parallel) state, and this tiny imbalance creates a net macroscopic magnetization M₀ pointing along B₀ — proportional to field strength, which is one reason a 3 T scanner produces sharper images than a 1.5 T scanner.

live demo · proton spins aligning and precessing under B₀● LIVE

The RF pulse and Larmor resonance

To produce a detectable signal, the scanner tips the net magnetization M₀ away from the B₀ axis using a brief radiofrequency (RF) pulse. The key is resonance: the pulse frequency must exactly match the Larmor frequency ω₀.

ω₀ = γ · B₀  (Larmor equation)
For ¹H at 1.5 T: ω₀ ≈ 64 MHz
For ¹H at 3.0 T: ω₀ ≈ 128 MHz
For ¹H at 7.0 T: ω₀ ≈ 298 MHz (FM radio band)

A 90° pulse tips M₀ entirely into the transverse (x-y) plane. The magnetization then precesses around B₀ at ω₀, sweeping past the receive coil and inducing a sinusoidal voltage — the Free Induction Decay (FID) signal. The Bloch equations describe the full magnetization vector M(t) under the combined static field B₀, RF field B₁, and relaxation.

T1 and T2 relaxation — where contrast comes from

After the RF pulse is switched off, the magnetization returns to equilibrium through two independent processes, and these characteristic time constants are the primary source of tissue contrast in MRI. Longitudinal (T1) relaxation is the exponential recovery of Mz back to M₀ as spins release energy to the surrounding molecular lattice: Mz(t) = M₀·[1 − e^(−t/T1)]. Transverse (T2) relaxation is the decay of Mxy as spins dephase from local field variations: Mxy(t) = Mxy(0)·e^(−t/T2). T2 is always ≤ T1.

Typical values at 1.5 T:
              T1        T2
White matter  ~780 ms   ~90 ms
Grey matter   ~920 ms   ~100 ms
Fat           ~260 ms   ~80 ms
Water (CSF)   ~2400 ms  ~1800 ms

Lipids tumble at just the right rate for efficient energy transfer, giving fat a short T1 that appears bright on T1-weighted images. Free water has long T1 and T2; tumors and edema often appear hyperintense on T2-weighted images because pathological processes increase tissue water content. By choosing TR (repetition time) and TE (echo time), radiologists emphasise T1-weighting (short TR/TE — fat bright, water dark), T2-weighting (long TR/TE — water bright, pathology visible), proton density, or FLAIR (T2-weighted with CSF suppressed, used to spot MS plaques near the ventricles).

Gradient coils, k-space, and the Fourier transform

After the RF pulse, all protons produce signal at the same Larmor frequency, so the scanner cannot yet tell where the signal came from. Three sets of gradient coils (Gx, Gy, Gz) add small, linear variations to B₀ that encode spatial position into frequency and phase: a Gz gradient selects the excited slice, a Gx gradient frequency-encodes one in-plane axis during readout, and a Gy gradient phase-encodes the other. The raw data is stored in a 2-D matrix called k-space, where each point [kx, ky] represents a spatial frequency of the image.

S(kx, ky) = ∫∫ ρ(x,y) · e^(−i2π(kx·x + ky·y)) dx dy
→ S(kx, ky) is the 2-D Fourier transform of proton density ρ(x,y)
Image reconstruction: ρ(x,y) = 2D-IFFT{ S(kx, ky) }

The center of k-space holds low spatial frequencies — overall brightness and contrast — while the periphery holds high spatial frequencies — edges and fine detail. That's why partial k-space acquisitions (sampling only the center) are faster but blurrier. Echo Planar Imaging (EPI) fills all of k-space after a single RF pulse by rapidly oscillating Gx and Gy in a zigzag pattern, taking about 50 ms per slice — fast enough for fMRI and cardiac imaging.

Contrast agents, fMRI, and diffusion imaging

Gadolinium (Gd³⁺) is strongly paramagnetic and dramatically shortens T1 of nearby protons; injected intravenously, it accumulates where the blood-brain barrier is disrupted, creating bright spots on T1-weighted images. In fMRI, deoxy-hemoglobin is paramagnetic and shortens T2*, while oxy-hemoglobin is diamagnetic and does not — active brain regions have higher blood oxygenation, longer T2*, and brighter signal on gradient-echo sequences, the BOLD contrast that underlies functional MRI. Diffusion Tensor Imaging (DTI) applies strong gradient pulses in multiple directions to measure anisotropic water diffusion along white-matter axon bundles, revealing neural fiber tracts and detecting early axonal damage in stroke and MS.

Safety and field strengths

Unlike CT or PET, MRI uses no ionizing radiation, and RF energy deposition (SAR) is limited to 4 W/kg by safety guidelines. The main hazards are the projectile effect on ferromagnetic objects, implant heating from induced eddy currents, acoustic noise up to 130 dB from gradient coil switching, and claustrophobia (addressed by open-bore and wide-bore designs). Clinical field strengths range from 0.5–1.0 T open scanners, through the 1.5 T gold standard used since 1985 and 3 T systems that double SNR for neuro and cardiac research, up to 7 T (FDA-cleared since 2017) for sub-millimeter cortical imaging and the 11.7 T Iseult whole-body magnet, whose first human images were published in March 2024. Fast gradient switching is limited by peripheral nerve stimulation (PNS), which caps EPI and diffusion sequence performance in high-field systems.

Frequently asked questions

Why does MRI use hydrogen protons instead of other atoms?

The human body is roughly 60% water, making hydrogen by far the most abundant NMR-active nucleus. Each proton carries a magnetic moment from its intrinsic spin, so clinical MRI primarily images proton density and the relaxation properties of tissue water and fat.

What is the difference between T1 and T2 relaxation?

T1 (longitudinal) relaxation is the exponential recovery of magnetization back along the main field as spins release energy to the surrounding lattice: Mz(t) = M0[1 − e^(−t/T1)]. T2 (transverse) relaxation is the decay of magnetization in the transverse plane as spins dephase from local field variations: Mxy(t) = Mxy(0)·e^(−t/T2). T2 is always less than or equal to T1, and by choosing repetition time (TR) and echo time (TE), radiologists emphasise one or the other to control image contrast.

How does an MRI scanner turn raw signal into an image?

Gradient coils encode spatial position into frequency and phase, and the resulting raw data is stored in a 2-D matrix called k-space, where each point represents a spatial frequency of the image. The signal S(kx, ky) is mathematically the 2-D Fourier transform of the proton density, so the final image is reconstructed with a 2-D inverse fast Fourier transform (2D-IFFT).

Try it live

Everything above runs in your browser — open MRI Physics and watch proton spins align, tip under an RF pulse, and relax back to equilibrium. Nothing is installed, nothing is uploaded.

▶ Open MRI Physics simulation

What did you find?

Add reproduction steps (optional)