Functional MRI generates rich images of brain activity, but the raw signal is so contaminated by noise from head movement, breathing, heartbeat, and scanner imperfections that it cannot be analyzed meaningfully without extensive cleanup. This cleanup process, known as preprocessing, typically involves a dozen or more steps performed in a carefully chosen order, each designed to strip away a different class of artifact while preserving the genuine brain signal underneath. Getting these steps wrong, or even performing them in the wrong sequence, can introduce new artifacts or erase the very patterns researchers are trying to study.
Why Raw fMRI Data Cannot Be Used Directly
An fMRI scanner does not measure neural activity directly. It detects changes in blood oxygenation, called the BOLD signal, which serves as a proxy for brain activity. That proxy signal, however, is a complex mixture of neuronal, metabolic, and vascular processes, and it arrives severely corrupted by fluctuations that have nothing to do with what the brain is actually doing.1PubMed Central. Methods for cleaning the BOLD fMRI signal Over two decades of research have identified three broad categories of contamination: instabilities in the scanner hardware itself, physical movement of the person’s head, and physiological rhythms such as breathing and heartbeat.2PubMed. Noise contributions to the fMRI signal: An overview
These noise sources are not just random static. Many of them produce structured patterns that mimic real brain connectivity, which makes them especially dangerous for connectivity analyses. Movement and respiration, for instance, can have delayed effects on the BOLD signal that persist across multiple time points, meaning their contamination can spuriously influence findings about how brain regions communicate with one another.3PubMed Central. Identifying and characterizing systematic temporally-lagged BOLD artifacts Preprocessing exists to peel these layers of contamination away, one by one, before any scientific analysis begins.
Correcting for How the Scanner Collects Slices
An fMRI volume of the whole brain is not captured in a single snapshot. The scanner acquires it one two-dimensional slice at a time, and those slices are not collected sequentially from top to bottom. They are typically acquired in an interleaved order, meaning the first, third, fifth slices are gathered in one pass and the even-numbered slices in the next. This means that a slice acquired at the start of a volume and a slice acquired at the end can be separated by a second or more in time, yet they are treated as if they represent the same moment.4PubMed Central. Optimal slice timing correction and its interaction with fMRI parameters and artifacts
Slice timing correction uses interpolation to shift each slice’s time series so that every voxel in a volume is aligned to the same reference time point. The step matters most when the repetition time (the interval between successive whole-brain volumes) is long, because the temporal offset between the first and last slice becomes a bigger fraction of the sampling period. With modern scanners using multiband acceleration to acquire volumes in under a second, the timing mismatch shrinks, and some researchers skip this step entirely for very fast acquisitions. Whether to include it, and where to place it in the pipeline, depends on the acquisition parameters of the specific dataset.
Head Motion Correction
Even cooperative adults shift their head by small amounts during a scan. Over the course of a session that can last thirty minutes or more, those small shifts accumulate. Motion correction works by choosing one volume as a reference and then mathematically realigning every other volume to match it, estimating the six rigid-body parameters (three translations and three rotations) needed to undo the displacement. Some advanced approaches go further, using active tracking markers attached to the head to update the scanner’s imaging plane in real time, achieving tracking precision on the order of hundredths of a millimeter with corrections applied roughly every 37 milliseconds.5PubMed Central. Prospective real-time correction for arbitrary head motion using active markers
The six motion parameters estimated during realignment also serve a second purpose. They are saved and fed into later statistical models as nuisance regressors, so that any residual motion-related variance still lurking in the signal can be accounted for during analysis. Some pipelines expand these six parameters to 24 by adding their temporal derivatives and squared terms, capturing more of the motion-related signal that a simple linear model would miss.
Fixing Geometric Distortions
The echo-planar imaging sequences used for fMRI are fast but sensitive to magnetic field inhomogeneities. Where the field is uneven, particularly near air-tissue boundaries like the sinuses and ear canals, the resulting images stretch, compress, or shift, sometimes by several millimeters. This geometric distortion means that a brain region can appear in the wrong location on the image, which is a serious problem when you are trying to figure out which specific area lit up during a task.
Distortion correction typically relies on acquiring a separate field map scan that measures the local inhomogeneity, then using that map to unwarp the functional images. An alternative approach uses pairs of images acquired with opposite phase-encoding directions, which distort in opposite ways, and calculates the true geometry from the difference. Both methods substantially improve the spatial accuracy of the resulting images.6PubMed Central. Effects of Field-Map Distortion Correction on Resting State Functional Connectivity MRI
Aligning Functional and Structural Images
Functional images have poor spatial resolution and low tissue contrast, making it hard to tell exactly where in the brain a signal originates. Structural images collected in the same session, typically high-resolution T1-weighted scans, show fine anatomical detail but carry no functional information. Co-registration aligns these two image types so that each functional voxel can be mapped to a precise anatomical location. Most pipelines use boundary-based registration, which aligns the functional image to the structural one by matching the boundary between gray matter and white matter rather than relying solely on the brain’s outer contour.
After co-registration, spatial normalization warps the aligned brain into a standard template space, such as the commonly used MNI152 template. This allows researchers to compare activations across individuals whose brains differ in size and shape. The warping is straightforward for healthy brains, but it becomes challenging when someone has a structural abnormality. In patients who have had a stroke, for example, the missing tissue creates a mismatch with the template that can distort the normalization of the entire image. Specialized techniques like cost function masking attempt to address this, though none offer a perfect solution.7PubMed Central. Spatial normalization of lesioned brains: performance evaluation and impact on fMRI analyses
Spatial Smoothing and Its Trade-Offs
Smoothing blurs each voxel’s value with its neighbors using a Gaussian kernel, typically measured by its full width at half maximum. A kernel of 6 mm, for instance, averages signal over roughly a 6 mm radius. The main benefit is an improved signal-to-noise ratio: random thermal noise averages out while correlated neural signal, which tends to be spatially coherent, is preserved. Research at ultra-high field strengths has shown that acquiring data at high resolution and then smoothing down to a lower resolution actually yields a better signal-to-noise ratio than acquiring directly at the lower resolution, because physiological noise is reduced in the high-resolution acquisition before the smoothing step boosts thermal signal-to-noise.8PubMed. Effect of spatial smoothing on physiological noise in high-resolution fMRI
The downside is lost spatial precision. Too much smoothing can merge signals from adjacent but functionally distinct brain regions, which is especially problematic for studies trying to resolve fine-grained cortical patterns. The choice of kernel size is always a compromise between sensitivity (detecting weak activations) and specificity (localizing them accurately), and there is no single correct answer.
Temporal Filtering and a Hidden Pitfall
Brain activity relevant to most fMRI experiments fluctuates slowly, typically below 0.1 Hz for resting-state studies and at task-related frequencies for task designs. Temporal filtering removes signal outside the frequency band of interest. A high-pass filter, for instance, strips out very slow drifts caused by scanner heating or slow physiological oscillations, while a band-pass filter retains only a narrow window of frequencies.
Here is where things get tricky. Most preprocessing pipelines are modular, meaning they apply filters and regressions in a sequence of separate steps. Research has demonstrated that this sequential approach can actually reintroduce artifacts that were previously removed. Each regression step projects the data onto a mathematical subspace, and a later step can push the data back into subspaces that overlap with already-removed nuisance signals.9PubMed Central. Modular preprocessing pipelines can reintroduce artifacts into fMRI data The practical implication is that the order in which you apply motion regression, band-pass filtering, and other denoising steps genuinely matters. In some cases, combining multiple regressions into a single simultaneous step avoids the problem entirely.
Dealing with Heartbeat and Breathing
Your heart beats and your lungs expand and contract throughout a scan, and both create rhythmic fluctuations in the BOLD signal that can dwarf the neural signal, particularly at higher field strengths. Physiological noise correction methods like RETROICOR model these fluctuations using recordings of the person’s cardiac and respiratory cycles collected during the scan, then regress the modeled noise out of the data.10PubMed Central. Integration of motion correction and physiological noise regression in fMRI
A complication is that these physiological corrections depend critically on the timing of image acquisition relative to the heartbeat, and they do not naturally account for head motion. Since a person’s head tends to move slightly with each breath and heartbeat, physiological noise and motion artifacts are entangled. Pipelines that treat them as independent can leave residual contamination. Integrating motion correction with physiological noise regression in a unified framework addresses this, though doing so adds computational complexity.
Data-Driven Denoising with Independent Component Analysis
Rather than modeling specific noise sources, an alternative strategy decomposes the entire dataset into independent components, essentially separating the fMRI signal into a set of spatial maps and their associated time courses, then classifying each component as either signal or noise. ICA-AROMA is a widely used automated version of this approach that identifies motion-related components using four features: whether the component is located at the brain’s edges or in cerebrospinal fluid, whether it has high-frequency content, and whether it correlates with motion parameters.11PubMed. ICA-AROMA: A robust ICA-based strategy for removing motion artifacts from fMRI data The flagged components are then subtracted from the data.
Validation studies have shown that ICA-AROMA identifies motion components with high accuracy without requiring retraining on each new dataset, and it preserves the temporal autocorrelation structure of the data, which matters for statistical modeling downstream.12PubMed. Evaluation of ICA-AROMA and alternative strategies for motion artifact removal in resting state fMRI Some pipelines combine ICA-AROMA with other techniques, such as anatomical component correction, to handle both motion and physiological noise simultaneously.13PubMed. The optimized combination of aCompCor and ICA-AROMA to reduce motion and physiologic noise in task fMRI data
Scrubbing High-Motion Time Points
Even after motion correction and ICA denoising, individual time points where a person moved sharply can retain artifacts severe enough to distort results. Scrubbing, also called censoring, identifies these problematic frames using metrics like framewise displacement and removes them from subsequent analysis. The approach was motivated by research showing that motion systematically inflates short-distance correlations and deflates long-distance correlations in connectivity analyses, essentially making nearby brain regions look more connected and distant regions look less connected than they actually are. Removing the high-motion frames substantially corrects this distance-dependent bias.14PubMed Central. Spurious but systematic correlations in functional connectivity MRI networks arise from subject motion
The trade-off is lost data. A person who moves frequently can have a large fraction of their time series removed, leaving too few frames for reliable analysis. Researchers must balance the aggressiveness of the scrubbing threshold against the amount of data they can afford to lose, and heavily censored participants are sometimes excluded from the study entirely.
Surface-Based Versus Volume-Based Approaches
Traditional preprocessing treats the brain as a three-dimensional volume of cubes (voxels). Surface-based registration instead maps functional data onto a reconstruction of the cortical surface, a sheet of gray matter that has been computationally “inflated” into a smooth surface. This approach offers several advantages. The alignment of cortical folds across individuals is much more precise when matching surfaces rather than volumes, and smoothing performed along the cortical sheet preserves signals better than smoothing through three-dimensional space, which can blur signal across opposite banks of a sulcus that are spatially close in volume space but functionally distinct.15PubMed Central. Comparing surface-based and volume-based analyses of functional neuroimaging data in patients with schizophrenia
Empirical comparisons confirm that surface-based group analyses tend to detect denser networks of activated regions and produce more reliable activation maps than volume-based analyses.16PubMed. An empirical comparison of surface-based and volume-based group studies in neuroimaging The gains are especially pronounced in populations with structural brain abnormalities, where volume-based normalization struggles. The downside is that surface reconstruction requires high-quality structural scans and more computation, and deep subcortical structures like the thalamus and brainstem are not naturally represented on a cortical surface.
Standardized Pipelines and Reproducibility
One of the field’s persistent problems has been that two labs studying the same question can reach different conclusions simply because they preprocessed their data differently. Every lab traditionally built its own pipeline by chaining together tools from packages like SPM, FSL, or AFNI, making choices about step order, parameter settings, and which corrections to include. These idiosyncratic pipelines are difficult to reproduce and hard to compare.
fMRIPrep was developed to address this by providing an analysis-agnostic tool that automatically adapts a best-in-breed workflow to the specifics of each dataset, ensuring high-quality preprocessing without manual intervention.17PubMed Central. fMRIPrep: a robust preprocessing pipeline for functional MRI It leverages a standardized data format called BIDS for both input and output, making its results immediately usable by downstream analysis tools.18Nature Protocols. Analysis of task-based functional MRI data preprocessed with fMRIPrep Testing has shown that fMRIPrep introduces less uncontrolled spatial smoothness than many commonly used preprocessing setups, and its visual quality reports make it easier to spot problems before they contaminate results.
Quality Control Still Requires Human Eyes
Automated pipelines handle the heavy lifting, but no software can fully replace human inspection. Quality control protocols built around tools like MRIQC and fMRIPrep’s visual reports involve examining each subject’s data individually for problems like excessive motion, failed registrations, or residual artifacts. In one study applying a rigorous visual assessment protocol to a composite dataset of 181 subjects drawn from open fMRI repositories, 97% of the data was flagged for exclusion.19PubMed Central. Quality control in functional MRI studies with MRIQC and fMRIPrep That number reflects an intentionally strict protocol applied to heterogeneous legacy data, but it underscores how much problematic data can slip through without careful visual review.
How Preprocessing Choices Affect Machine Learning Results
The stakes of preprocessing become concrete when you look at clinical applications. In studies using resting-state fMRI to train machine learning classifiers for psychiatric diagnoses, the choice of preprocessing pipeline can swing classification accuracy by more than 20 percentage points. One study on schizophrenia classification found that accuracy ranged from 52% to 81% depending solely on which preprocessing pipeline and feature extraction method was used.20PubMed Central. Influence of Functional Magnetic Resonance Imaging Data Preprocessing Pipelines on the Accuracy of Schizophrenia Classification Using Machine Learning Methods Similar effects have been reported for autism classification, where optimal preprocessing configurations pushed accuracy above 95%.21PubMed. The Impact of rs-fMRI Preprocessing on the Quality of Machine Learning Models for Autism Spectrum Disorder Diagnosis These findings make the uncomfortable point that a preprocessing pipeline is not a neutral conduit. It shapes the data in ways that can determine whether a classifier works or fails, and reporting the pipeline in full detail is as important as reporting the classifier itself.
Preprocessing Infant and Neonatal Brains
Standard adult preprocessing pipelines assume a set of brain characteristics that do not hold for newborns. The neonatal brain has reversed tissue contrast on MRI due to incomplete myelination, radically different proportions, and distinct hemodynamic response characteristics. Adult tools trained on adult brain templates fail when applied to these images.22Frontiers in Neuroinformatics. NeoRS: A Neonatal Resting State fMRI Data Preprocessing Pipeline
The Developing Human Connectome Project and related efforts have produced bespoke neonatal preprocessing pipelines that account for these differences with optimized motion and distortion correction, age-specific templates, ICA-based denoising tuned for infant motion patterns, and hemodynamic response models fitted to neonatal physiology. These specialized pipelines achieve substantial gains in both spatial specificity and sensitivity compared to using adapted adult tools.23PubMed Central. Optimising neonatal fMRI data analysis: Design and validation of an extended dHCP preprocessing pipeline to characterise noxious-evoked brain activity in infants Neonates also present a practical challenge: they cannot follow instructions to hold still, so motion artifacts tend to be more severe and more erratic, requiring aggressive denoising that must avoid discarding the limited data available from short scanning sessions.
The Moving Target of Pipeline Optimization
There is no universal “correct” preprocessing pipeline. Resting-state connectivity studies and task-based activation studies have different sensitivities to various noise sources, and the optimal combination of denoising steps differs accordingly. Research comparing seven distinct pipelines found that all advanced pipelines significantly outperformed a minimal pipeline on standard noise metrics in both resting-state and task fMRI, but the relative ranking among advanced pipelines varied depending on the metric used and the type of analysis.24IOP Publishing. Noise removal in resting-state and task fMRI: functional connectivity and activation maps Ultra-high field scanners operating at 7 Tesla and above introduce additional complications: the stronger magnetic field yields finer spatial resolution but amplifies susceptibility artifacts and physiological noise, requiring preprocessing adjustments that remain an active area of development.25PubMed Central. High-resolution fMRI at 7 Tesla: challenges, promises and recent developments for individual-focused fMRI studies The field has moved toward transparency and standardization, but the honest reality is that thoughtful pipeline selection, thorough quality control, and full reporting of every preprocessing choice remain as important as any individual algorithm.