Structural MRI
From relaxation times to cortical thickness.
A structural scan is the anatomical backbone of nearly every study: the image other modalities are aligned to, the source of tissue volumes and cortical thickness, and the thing a radiologist actually reads. Its pipeline is shorter than diffusion's but every step is reused by the others.
Where contrast comes from
MRI does not image tissue directly. It tips the magnetisation of hydrogen nuclei out of alignment and listens to them relax back. Two time constants describe that relaxation and differ by tissue: T1, how fast longitudinal magnetisation recovers, and T2, how fast transverse magnetisation decays. A third quantity, proton density, is simply how much water is there.
A sequence chooses how much each of these matters through its timing. For a spin echo:
Short TR punishes tissue with slow T1 recovery, long TE punishes tissue with fast T2 decay. White matter has the fastest T1, cerebrospinal fluid by far the slowest, which is why the same head can look like a negative of itself between two scans acquired minutes apart.
Dial in a contrast
Most research protocols acquire a high-resolution 3D T1-weighted image (MPRAGE or similar, around 1 mm isotropic) as the anatomical reference. T2-weighted and FLAIR scans are added when lesions, edema, or ventricles are the question. FLAIR is T2 contrast with the CSF signal nulled by an inversion pulse, so a bright periventricular lesion no longer hides next to bright ventricles.
Tools: contrast is fixed at acquisition; the choice lives in the sequence protocol, not in software.
From k-space to image
The scanner samples spatial frequencies, not pixels. Each readout traverses a line of k-space, and the image is the inverse Fourier transform of the full grid. Resolution is set by how far out in k-space you sample; field of view by how finely. Three artifacts that every analyst meets live here.
Where artifacts come from: the k-space view
- Gibbs ringing at sharp edges, from truncating the sampled frequencies. On T1 images it shows up as faint stripes parallel to the skull and ventricles.
- Motion during acquisition corrupts phase-encode lines and ghosts the whole image. Structural scans take five to eight minutes, so this is the most common reason a scan is unusable. Prospective motion correction and quick quality ratings catch it.
- Noise, which for parallel-imaging reconstructions is also spatially varying, denser where the coils see less.
Reconstruction happens on the scanner and produces DICOM files; the first software step in any pipeline is converting them to NIfTI, a single header plus voxel array with an affine matrix that says where in the scanner each voxel sits. That affine is the thread every later step depends on.
Tools: dcm2niix for conversion, MRIQC for automated quality metrics.
Bias field and skull stripping
The receive coil is closer to some parts of the head than others, so the same tissue is brighter near the coil elements and darker in the centre. The result is a smooth multiplicative bias field across the image. Human eyes ignore it. Intensity classifiers do not. Bias correction estimates that smooth field, usually by iteratively sharpening the intensity histogram, and divides it out.
Skull stripping removes everything that is not brain: scalp, skull, eyes, neck. It matters because the next steps are statistical, and fat in the scalp has a T1 signal that looks like white matter. Historically a source of endless manual fixing; deep learning tools have made it close to solved for healthy adult heads.
Skull stripping fails quietly at the inferior temporal lobes and the top of the cortex. Check the mask on every subject before anything is computed from it. The same goes for bias correction on scans with large lesions, where the "smooth field" assumption breaks.
Tools: N4BiasFieldCorrection (ANTs), bet (FSL), SynthStrip (FreeSurfer),
HD-BET.
Segmentation and volumes
With a clean, bias-corrected T1 image, voxels can be assigned to tissue. The simplest approach is to cluster intensities: on a T1 image, CSF is darkest, gray matter in the middle, white matter brightest. Real tools add two things on top of that: a spatial prior (an atlas saying how likely each tissue is at each location) and a model of partial volume, since a 1 mm voxel at the cortical boundary contains both gray and white matter.
Segmenting tissue by intensity, and why bias correction comes first
From the segmentation come the numbers people report: total intracranial volume, gray and white matter volume, ventricle volume, and, via a very different surface-based pipeline, cortical thickness. The surface approach fits a mesh to the white-matter boundary and another to the pial surface and measures the distance between them, which sidesteps the voxel grid entirely and is far more sensitive to thinning than volume is.
Volumes depend on the scanner, the sequence, the software version, and the head size. Compare within a study processed identically, normalise by intracranial volume when the question is relative, and never mix FreeSurfer versions in one cohort.
Tools: fast (FSL), SPM's unified segmentation, FreeSurfer's recon-all for surfaces and thickness, FastSurfer and SynthSeg for fast deep-learning equivalents.
Registration and templates
Almost every multi-subject analysis needs voxels to correspond across people, and almost every multi-modal analysis needs a subject's diffusion or functional data aligned to their own anatomy. Both are registration: find the transform that maps one image onto another by minimising a cost function.
Registration as an optimisation problem
The demo uses six parameters (really three, in 2D). Real registration climbs a ladder:
- Rigid: rotation and translation. Same person, different session.
- Affine: adds scaling and shear. Gross size differences between people.
- Nonlinear (deformable): a smooth warp field with millions of parameters, regularised so it stays plausible. This is what maps individual anatomy onto a template such as MNI152.
The cost function matters as much as the transform. Mean squared difference only works when intensities match; mutual information handles different contrasts, which is how a T1 and a b=0 diffusion image can be aligned at all. Everything downstream, from voxel-based morphometry to the TBSS skeleton in the diffusion walkthrough, inherits whatever misalignment survives this step.
Tools: flirt and fnirt (FSL), ANTs antsRegistration (the usual accuracy benchmark), SPM normalise, bbregister for boundary-based
functional-to-anatomical alignment.