[Neuroimaging] temporal filtering and confounds when loading with nilearn niftimasker

Gael Varoquaux gael.varoquaux at normalesup.org
Mon Dec 12 17:34:49 EST 2016

That's a tricky problem, because the question is more: what do people
expect is done?

The way nilearn currently does it is to first remove the confounds, and
then filter the resulting signal. I cannot really see a drawback of doing
it that way. To take the case that you are describing below, the
low-frequency of the CSF would be removed from the final signal.

Now, IMHO, the right way to do things would be to express the frequency
filter in a cosine basis and concatenate the confounds. AFAIK this is how
SPM does it. We'd like to do it this way, and have an issue to do it:
However we haven't found time so far.

If you write the equations (they are a bit horrible), the way we do
things, the way you propose to do things, and the way I think that they
should be done all vary slightly. I cannot put an intuition on what the
differences are, though. Of course if the frequency filter and the
confounds are orthogonal (the confounds have no energy in the filtered
frequencies bands), they are equivalent.

Do you want to do a PR to solve issue 1011 (filtering based on a cosine
base)? That would move us toward the right way to do things.



On Mon, Dec 12, 2016 at 10:45:23AM +0100, Christophe Pallier wrote:
> Hello all,

> I was wondering if the confounds passed to Niftimasker were detrented
> and temporally filtered by the masker.

> Looking at the code of nilearn.signal.clean, I see that there are
> detrended but not filtered.

> Would it not be useful to also filter them before projecting the
> signal of the orthogonal of the confounds spaces?

> While writing this, I realize that, maybe,  this would have strickly
> no effect (for example if filtering and projection operation commute;
> sorry if this is obvious...)

> (real life case: I extracted timecourse from CSF to include as a
> confound before running a func. connectivity analysis, and there are
> some low freq in the signal that will probably not be cleaned by
> detrending, but differ from voxels in grey matter)

More information about the Neuroimaging mailing list