In the documentation for nilearn.signal.clean (, it lists:

This function can do several things on the input signals, in the following order: detrend, standardize, remove confounds, low- and high-pass filter.

I was wondering if anyone knows if nilearn.signal.clean is doing bandpass filtering simultaneously as confound regression or in a stepwise, modular fashion (as described here recently by Lindquist and colleagues:


Hi @imawla

Looking at the source code here, it seems that nilearn.signal.clean does everything step wise, i.e. first detrending, then confound removal, followed by bandpass filtering and finally standardization.


Indeed, I thought that we were filtering the confounds before applying them, but we are not. This is a bad behavior that I am willing to call a bug (and is related to the problem raised by the Linquist paper).

I’ve raised the issue on the nilearn tracker, so that we fix it: