Functional MRI
From a sluggish blood signal to an activation map.
Functional MRI never sees neurons. It sees a slow, small change in blood oxygenation that follows neural activity by several seconds, buried under noise that is often larger than the effect. The pipeline is an exercise in knowing exactly what you expect and testing for it.
What BOLD measures
When a patch of cortex works harder it draws more oxygenated blood than it uses. The local ratio of oxygenated to deoxygenated hemoglobin shifts, and because deoxyhemoglobin is paramagnetic and disturbs the field, the T2* signal in that voxel rises by one or two percent. That is the blood-oxygen-level-dependent signal. It peaks about five seconds after the neural event and takes twenty to settle, a shape called the hemodynamic response function.
An fMRI run is a 4D dataset: a whole-brain T2*-weighted EPI volume every one to three seconds (the TR), for five to fifteen minutes. Each voxel is a time series of a few hundred points. The spatial resolution is coarse, two to three millimetres, and the raw signal units are arbitrary; everything meaningful is expressed as percent change.
Two study designs dominate. Task fMRI presents stimuli on a known schedule and looks for voxels whose signal follows it. Resting-state fMRI presents nothing and looks for voxels whose spontaneous fluctuations are correlated with each other. The preprocessing is the same; the statistics are not.
Preprocessing
The effect is one percent. Head motion of a millimetre moves voxels across tissue boundaries worth ten times that. Nearly all of fMRI preprocessing exists to remove signal changes that are not BOLD.
- Motion correction. Rigid-body registration of every volume to a reference. The six estimated parameters are kept and later regressed out, and volumes with large framewise displacement are flagged or censored.
- Slice-timing correction. Slices in a volume are acquired at different times within the TR; each slice's time series is shifted to a common reference time. Matters more for event-related designs and long TRs.
- Distortion correction. EPI stretches near the sinuses, exactly as in diffusion MRI. Field maps or reverse-phase-encode images fix it.
- Co-registration and normalisation. Align the functional data to the subject's T1, then warp into template space so subjects can be combined.
- Spatial smoothing. A Gaussian blur of four to eight millimetres, which improves SNR, makes anatomy overlap better across subjects, and makes the random field theory used for inference valid. It also blurs away anything small.
- Temporal filtering and nuisance regression. Remove slow scanner drift, and regress out motion parameters, white-matter and CSF signals, and physiological noise. For resting-state data this step decides the result more than any other.
Motion is correlated with age, diagnosis, and attention, so motion artifacts masquerade as group differences. Report framewise displacement, match groups on it, and treat any finding that disappears under stricter motion censoring as a motion finding.
Tools: fMRIPrep (the current standard end-to-end pipeline), FSL FEAT, SPM, AFNI, XCP-D for post-processing resting-state data.
The general linear model
Task analysis is model-based. You know when the stimuli happened, you know the shape of the hemodynamic response, so you can predict what a responding voxel's time series should look like: the stimulus schedule convolved with the HRF. The general linear model fits each voxel's measured series as a weighted sum of that prediction plus nuisance regressors:
where the columns of X are the predicted response, a constant, drift terms, and the motion parameters. The weight β on the task column is the effect size, and dividing it by its standard error gives a t-statistic. Do this in every voxel and you have a statistical map.
A voxel's time course and the model that explains it
The quality of the result depends on the quality of the model. A wrong HRF shape, an omitted drift term, or an unmodelled motion spike all leak into the residuals, inflate the error estimate, and hide real effects, or, if the nuisance happens to correlate with the task, invent them.
Inference and connectivity
A whole-brain map has a hundred thousand voxels, each with a t-statistic. At p < 0.05 you would expect five thousand false positives. Three approaches control that.
- Voxel-wise family-wise error correction, via random field theory or permutation. Strict, and safe.
- Cluster-level inference: threshold the map, then ask whether a cluster of that size could occur by chance. More sensitive, but cluster-forming thresholds that are too lenient produce false-positive rates far above nominal, a widely discussed problem since 2016. Permutation-based cluster inference avoids the parametric assumptions.
- Region-of-interest analysis: decide the regions beforehand, average within them, and run a handful of tests instead of a hundred thousand.
Finding a group difference along a strip of cortex, honestly
Resting-state connectivity
Without a task there is nothing to model, so the analysis turns to correlation. Pick a seed region or a parcellation, extract the mean time series of each region, and correlate them pairwise. The resulting matrix is a functional connectome, and the graph theory applied to it is where "networks" such as the default mode network come from. Everything that was said about motion applies twice over, because motion raises correlations between nearby regions and lowers them between distant ones in a way that looks exactly like a group effect.
Tools: randomise (FSL) for permutation inference, SPM and FSL cluster
tools, CONN and nilearn for connectivity, the Schaefer and Glasser parcellations.