Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the user guide for the big picture.

8.11.3. nilearn.signal.high_variance_confounds

nilearn.signal.high_variance_confounds(series, n_confounds=5, percentile=2.0, detrend=True)[source]

Return confounds time series extracted from series with highest variance.

Parameters
seriesnumpy.ndarray

Timeseries. A timeseries is a column in the “series” array. shape (sample number, feature number)

n_confoundsint, optional

Number of confounds to return. Default=5.

percentilefloat, optional

Highest-variance series percentile to keep before computing the singular value decomposition, 0. <= percentile <= 100. series.shape[0] * percentile / 100 must be greater than n_confounds. Default=2.0.

detrendbool, optional

Whether to detrend signals or not. Default=True.

Returns
vnumpy.ndarray

Highest variance confounds. Shape: (samples, n_confounds)

Notes

This method is related to what has been published in the literature as ‘CompCor’ 1.

The implemented algorithm does the following:

  • compute sum of squares for each time series (no mean removal)

  • keep a given percentile of series with highest variances (percentile)

  • compute an svd of the extracted series

  • return a given number (n_confounds) of series from the svd with highest singular values.

References

1

Yashar Behzadi, Khaled Restom, Joy Liau, and Thomas T. Liu. A component based noise correction method (compcor) for bold and perfusion based fmri. NeuroImage, 37(1):90–101, 2007. URL: https://www.sciencedirect.com/science/article/pii/S1053811907003837, doi:https://doi.org/10.1016/j.neuroimage.2007.04.042.