This section contains an online version of the book chapter:
Nieto-Castanon, A. (2020). FMRI denoising pipeline. In Handbook of functional connectivity Magnetic Resonance Imaging methods in CONN (pp. 17–25). Hilbert Press. https://doi.org/10.56441/hilbertpress.2207.6600
Please note that this online version includes updated content and additional material prepared for the next edition of the book. When citing material from this section, please use the reference above.
alternative sources: pdf (ResearchGate); e-book (Google Books); paperback (Amazon)
CONN's default denoising pipeline combines two general steps: linear regression of potential confounding effects in the BOLD signal, and temporal band-pass filtering
Factors that are identified as potential confounding effects to the estimated BOLD signal are estimated and removed separately for each voxel and for each subject and functional run/session, using Ordinary Least Squares (OLS) regression to project each BOLD signal timeseries to the sub-space orthogonal to all potential confounding effects. Potential confounding effects used in CONN’s default denoising pipeline implement an anatomical component-based noise correction procedure (aCompCor), and include noise components from cerebral white matter and cerebrospinal areas (Behzadi et al. 2007), estimated subject-motion parameters (Friston et al. 1995), identified outlier scans or scrubbing (Power et al. 2014), constant and first-order linear session effects, and constant task effects, if applicable (Whitfield-Gabrieli and Nieto-Castanon, 2012):
noise components from white matter and cerebrospinal areas: potential confounding effects are defined from the observed BOLD signal within each of two anatomically-defined noise areas computed by applying a one-voxel binary erosion step to the masks of voxels with values above 50% in white matter and CSF posterior probability maps. Within each area five potential noise components (Chai et al. 2012) are estimated: the first computed as the average BOLD signal, and the next four computed as the first four components in a Principal Component Analysis of the covariance within the subspace orthogonal to the average BOLD signal and all other potential confounding effects
estimated subject-motion parameters: a total of 12 potential noise components are defined from the estimated subject-motion parameters in order to minimize motion related BOLD variability, 3 translation and 3 rotation parameters plus their associated first-order derivatives
scrubbing: a variable number of noise components (one for each identified outlier scan during the outlier identification preprocessing step) are used as potential confounding effects to remove any influence of these outlier scans on the BOLD signal
session and task effects: constant and linear BOLD signal trends within each session, as well as main task or session effects convolved with a canonical hemodynamic response function, are defined as additional noise components in order to reduce the influence of slow trends, initial magnetization transients, as well as constant task-induced responses in the BOLD signal, if applicable
Temporal frequencies below 0.008 Hz or above 0.09 Hz are removed from the BOLD signal in order to focus on slow-frequency fluctuations while minimizing the influence of physiological, head-motion and other noise sources. Filtering is implemented using a discrete cosine transform windowing operation to minimize border effects, and performed after regression to avoid any frequency mismatch in the nuisance regression procedure (Hallquist et al. 2013)
The effect of denoising, acting to minimize the influence of artifactual factors on functional connectivity measures, can be exemplified by estimating the distribution of functional connectivity values (FC) between randomly-selected pairs of points within the brain before and after denoising (available as part of CONN's Quality Control plots). Considering the BOLD signal after a standard minimal preprocessing pipeline (but before denoising), FC distributions show extremely large inter-session and inter-subject variability, and skewed distributions with varying degrees of positive biases, consistent with the influence of global or large-scale physiological and subject-motion effects. After denoising FC distributions show approximately centered distributions, with small but noticeable larger tails in the positive side, and considerably reduced inter-session and inter-subject heterogeneity.
The Data Validity score (DV) is a useful measure that characterizes the potential presence of global biases in functional connectivity estimates by exploring the properties of the empirical FC distributions for each subject. It is defined as:
where nu represents the mode of the empirical FC distribution and sigma its interquartile range for each subject i. Intuitively, nu and sigma describe the distribution "center" and its "width", and their ratio describes the relative displacement of the FC peak that results from the presence of global biases in functional connectivity measures (Morfini et al. 2023). DV scores are defined to measure these displacements robustly despite the distribution skewness and long positive tails, which arise from natural contributions of strong local connectivity to the overall FC distribution. DV scores range from 0% to 100%. A value of DV=100% represents a distribution with peak/mode exactly at r=0, and values above 95% represent distributions with peak displacements below 3.8% of the distribution interquartile range (approximately 5% of the distribution standard deviation). In the example data shown in the figure above, DV was 13.2% before denoising (FC distributions shown on top) and 97.2% after denoising (FC distributions shown on bottom plot).
Another useful way to evaluate the quality of the fMRI data after denoising include computing QC-FC correlations (Ciric et al. 2017). QC-FC correlations look, again, at the connectivity values (FC) between randomly-selected pairs of points within the brain separately for each subject, but instead of simply displaying the distribution of these values, this method evaluates whether these FC values are correlated, across subjects, with individual Quality Control ( QC) measures (e.g. subject-motion indicators). The method computes a QC-FC correlation value for each randomly-selected pair of points within the brain, and then it displays the distribution of the resulting QC-FC correlation values (shown in gray before and after denoising in the plots below). The observed QC-FC distribution shape f(r) can then be directly compared to a permutation-derived null distribution f0(r) (shown as red dashed lines in the plots below) in order to evaluate the potential influence of motion-related or other confounds in functional connectivity measures. The difference between these two distributions is described by their overlap coefficient (Ihman and Bradley 1989), the integrated minimum of two probability density functions.
The Data Quality score (DQ) summarizes these analyses across a range of Quality Control measures focusing on the potential influence of subject-motion and other forms of outliers on functional connectivity estimates. In particular, DQ scores are defined as the minimum of the overlap coefficients between the observed QC-FC distribution and its permutation-derived null distribution for a series of individual Quality Control measures (Nieto-Castanon 2025):
where f(j) represents the observed distribution of FC-QC correlations for the j-th quality control measure, and f0(j) its associated permutation-based null distribution. Three quality control measures are used in the computation of Data Quality scores: QC_MeanMotion, characterizing the average inter-scan motion for each subject; and QC_InvalidScans and QC_PorportionValidScans, characterizing the total number and proportion of outlier scans for each subject. Similar to the Data Validity score, Data Quality is scaled between 0% and 100%, with values above 95% typically interpreted as indicating minimal associations between functional connectivity and subject motion and other forms of outliers. In the example data shown in the figure above, DQ was 38.2% before denoising (QC-FC distributions shown on top) and 98.7% after denoising (QC-FC distributions shown on bottom plot).
Last and complementing the Data Validity and Data Quality scores, a useful measure quantifying the expected reliability of functional connectivity measures is the Data Sensitivity score (DS). This measure represents the expected power to detect a small effect-size (average connectivity across subejcts r=0.1) in a simple fixed-effect analysis at a p<0.05 false positive control level. It is computed as:
where df(i) represents the effective degrees of freedom of the fMRI data after denoising for subject i. For each subject the effective degrees of freedom are approximated by the degrees of freedom of the residual timeseries during denoising, taking into account the number of regressors in the confound Linear Regression model, combined with a Welch-Satterthwaite approximation (Satterthwaite 1946) in the frequency domain, taking into account both the frequency-filtering operation during denoising as well as the the intrinsic BOLD signal temporal autocorrelation within that frequency window. Last, if needed DS can also be computed separately for each individual subject in order to characterize the sensitivity of single-subject connectivity measures.
Data Validity, Quality, and Sensitivity scores are expressed in percent units and interpreted using three broad categories: low (<80%), intermediate (80–95%), and high (>95%) values. When used to evaluate the outputs of the fMRI denoising pipeline, these scores provide a quantitative basis for refining confound regression choices to best suit the characteristics of each dataset. Aiming to achieve high (>95%) values in all three metrics before proceeding to first-level functional connectivity analyses can help maximize analytic sensitivity and reduce the influence of global biases and motion-related confounds in functional connectivity measures, thereby improving the reliability and replicability of all subsequent analyses.
While the above denoising pipeline is designed to remove most outlier, physiological, including respiratory and cardiac effects, and residual subject-motion effects from the BOLD signal, researchers are strongly encouraged to evaluate the quality of their data after denoising and consider modifying these or using additional denoising steps as necessary. In addition to simple variations of the default denoising strategy, such as using different scrubbing options (e.g. identifying outliers based on a lower framewise displacement threshold) or selecting a higher number of aCompCor noise components, some useful additional denoising approaches include:
1. ICA denoising is a data-driven approach where Independent Component Analyses are used to identify potential noise-related temporal components either manually or semi-automatically (Griffanti et al. 2017) which can then be entered in CONN as additional potential confounding effects in the standard Linear Regression denoising step
2. Retroicor (Glover et al 2000) is a popular technique to use cardiac and respiratory state information recorded during the scanning session to build a series of predicted sine and cosine components of the respiratory and cardiac effects, which can then be used in CONN as additional potential confounding effects in the standard Linear Regression denoising step
3. Simult (Hallquist et al. 2013) is an alternative implementation of the standard sequential regression followed by filtering approach, where both regression and filtering are implemented simultaneously as a single regression step (either by explicitly adding low- and high- frequency regressors or by pre-filtering the matrix of linear regressors). This approach can be used in CONN directly (e.g. switching the default 'RegBP' option to 'Simult'), or it can be used selectively over a subset of regressors only (by selecting the 'Filtered' option on the selected subset of potential confounding effects). Since Simult is equivalent to removing the frequency-specific effect of potential confounder variables (the effect estimated only within the frequency window defined by the band-pass filter) it is recommended to not apply this filtering to confounders such as outliers which are broadband and not frequency-modulated
4. Friston24 (Friston et al. 1996) is a richer set of motion-related regressors designed to remove an autoregressive-moving-average model of the effects of subject motion on the BOLD signal. In CONN this can be used simply selecting a polynomial expansion (quadratic effects) for the realignment parameters, in addition to the temporal expansion (first-order derivatives) that is already part of the default denoising strategy
5. Global Signal Regression (GSR) is an alternative approach which uses the average BOLD signal (across the entire brain) as a potential confounding effect. This approach is generally not recommended, since it can introduce artifactual biases (Murphy et al. 2009), remove potentially meaningful neural components (Chai et al. 2012), and introduce confounding effects across populations. It is nevertheless possible to use as a last resort or reference alternative approach in CONN simply defining a new ROI encompassing the entire brain (e.g. a subject-specific brain mask resulting from the outlier detection step during preprocessing, or gray matter mask resulting from the segmentation step) and using this ROI as an additional potential confounding effect in the standard Linear Regression denoising step
Behzadi, Y., Restom, K., Liau, J., & Liu, T. T. (2007). A component based noise correction method (CompCor) for BOLD and perfusion based fMRI. Neuroimage, 37(1), 90-101
Chai, X. J., Castañón, A. N., Öngür, D., & Whitfield-Gabrieli, S. (2012). Anticorrelations in resting state networks without global signal regression. Neuroimage, 59(2), 1420-1428
Morfini F, Whitfield-Gabrieli S and Nieto-Castañón A (2023) Functional connectivity MRI quality control procedures in CONN. Front. Neurosci. 17:1092125.
Ciric, R., Wolf, D. H., Power, J. D., Roalf, D. R., Baum, G. L., Ruparel, K., ... & Gur, R. C. (2017). Benchmarking of participant-level confound regression strategies for the control of motion artifact in studies of functional connectivity. Neuroimage, 154, 174-187
Friston, K. J., Williams, S., Howard, R., Frackowiak, R. S., & Turner, R. (1996). Movement‐related effects in fMRI time‐series. Magnetic resonance in medicine, 35(3), 346-355.
Glover, G. H., Li, T. Q., & Ress, D. (2000). Image‐based method for retrospective correction of physiological motion effects in fMRI: RETROICOR. Magnetic Resonance in Medicine: An Official Journal of the International Society for Magnetic Resonance in Medicine, 44(1), 162-167.
Nieto-Castanon, A. (2025). Preparing fMRI data for statistical analysis. In fMRI techniques and protocols (pp. 163-191). New York, NY: Springer US.
Inman, H. F., & Bradley Jr, E. L. (1989). The overlapping coefficient as a measure of agreement between probability distributions and point estimation of the overlap of two normal densities. Communications in Statistics-theory and Methods, 18(10), 3851-3874.
Satterthwaite, F. E. (1946). An approximate distribution of estimates of variance components. Biometrics bulletin, 2(6), 110-114.
Griffanti, L., Douaud, G., Bijsterbosch, J., Evangelisti, S., Alfaro-Almagro, F., Glasser, M. F., ... & Beckmann, C. F. (2017). Hand classification of fMRI ICA noise components. Neuroimage, 154, 188-205.
Hallquist, M. N., Hwang, K., & Luna, B. (2013). The nuisance of nuisance regression: spectral misspecification in a common approach to resting-state fMRI preprocessing reintroduces noise and obscures functional connectivity. Neuroimage, 82, 208-225
Murphy, K., Birn, R. M., Handwerker, D. A., Jones, T. B., & Bandettini, P. A. (2009). The impact of global signal regression on resting state correlations: are anti-correlated networks introduced?. Neuroimage, 44(3), 893-905.
Power, J. D., Mitra, A., Laumann, T. O., Snyder, A. Z., Schlaggar, B. L., & Petersen, S. E. (2014). Methods to detect, characterize, and remove motion artifact in resting state fMRI. Neuroimage, 84, 320-341
Whitfield-Gabrieli, S., & Nieto-Castanon, A. (2012). Conn: a functional connectivity toolbox for correlated and anticorrelated brain networks. Brain connectivity, 2(3), 125-141
CONN's default denoising pipeline can be run using any of the following options:
If you have already imported your data in CONN and run either one of CONN or fMRIPrep preprocessing pipelines, go to CONN's Denoising tab. All options here will be set by default to implement the denoising procedure described above, so simply click 'Done' and 'Start' to run CONN's default denoising pipeline (optionally change the 'local processing' option available in that window to 'distributed processing' if you want to parallelize this pipeline across multiple processors or nodes in an HPC cluster).
All outputs of the denoising step will be automatically imported into your CONN project. In addition, if you want to export the fully preprocessed and denoised functional files to a different software package, those files will be stored in the same folder as your original functional images, with filename prefixes following SPM convention and indicating the sequence of preprocessing steps performed (e.g. 'swau' for CONN's default preprocessing pipeline) plus an additional prefix 'd' for denoising (e.g. for a combined 'dswau' prefix).
Similarly, if you have already entered and pre-processed your functional/anatomical files in CONN (either using the GUI or batch commands), you may run the default denoising pipeline using Matlab command syntax:
conn_batch( 'Denoising.done', true )
optionally adding to this command any desired alternative field name/value pairs (see doc conn_batch for additional details), for example:
conn_batch( 'filename', '/data/Cambridge/conn_Cambridge.mat', ...
'Denoising.done', true, ...
'Denoising.filter', [0.008 inf], ...
'Denoising.regbp', 2 )
The outputs of this command will be identical to those using Option 1 above.
If you prefer to run this denoising pipeline separately from the rest of CONN's functionality (e.g. to preprocess and denoise some data that is then to be used by a different software package), you may also run CONN's default denoising pipeline simply as two additional preprocessing steps following CONN's minimal preprocessing pipeline or similar. For example, the following Matlab command syntax runs CONN's default minimal preprocessing pipeline (realignment + STC + outlier identification + direct segmentation & normalization + smoothing) followed by CONN's default denoising steps (aCompcor + scrubbing + motion regression + filtering):
conn_module( 'preprocessing', ...
'structurals', {'/data/anat.nii'}, ...
'functionals', {'/data/func.nii'}, ...
'steps', {'default_mni', 'functional_regression', 'functional_bandpass'}, ...
'reg_names', {'realignment','scrubbing','White Matter','CSF'}, ...
'reg_dimensions',[inf, inf, 5, 5], ...
'reg_deriv', [1, 0, 0, 0], ...
'bp_filter', [0.008 inf] )
modifying the parameter name/value pairs when appropriate.
The output functional files (preprocessed and denoised) will be stored in the same folder as your original functional images, with prefixes following SPM convention and indicating the sequence of steps performed (e.g. output functional files in /data/bdswaufunc.nii for the example command above).
Alternatively, if your data is already fully preproccessed, and you already have the subject motion timeseries (e.g. a rp_func.txt file), the list of potential outliers (e.g. an art_regression_outliers_func.mat file), and the white matter and CSF masks (e.g. c2anat.nii and c3anat.nii files), you may use the following syntax to apply denoising alone (aCompCor + scrubbing + motion regression + filtering) to your functional data:
conn_module('preprocessing',...
'functionals', {'/data/func.nii'}, ...
'covariates', struct(...
'names', {{'realignment','scrubbing'}},...
'files', {{'/data/rp_func.txt', '/data/art_regression_outliers_func.mat'}}),...
'masks', struct(...
'White', {{'/data/c2anat.nii'}},...
'CSF', {{'/data/c3anat.nii'}}), ...
'steps', {'functional_regression', 'functional_bandpass'}, ...
'reg_names', {'realignment','scrubbing','White Matter','CSF'}, ...
'reg_dimensions',[inf, inf, 5, 5], ...
'reg_deriv', [1, 0, 0, 0], ...
'bp_filter', [0.008 inf] )
again modifying the parameter name/value pairs when appropriate (see doc conn_module and doc conn_batch for additional details)
The output functional files (denoised) will be stored in the same folder as your original functional images, with prefixes following SPM convention indicating the sequence of steps performed (e.g. output functional files in /data/bdfunc.nii for the example command above).