nipreps / fmriprep

fMRIPrep is a robust and easy-to-use pipeline for preprocessing of diverse fMRI data. The transparent workflow dispenses of manual intervention, thereby ensuring the reproducibility of the results.
https://fmriprep.org
Apache License 2.0
636 stars 294 forks source link

cosine regressors #3351

Open TrevorKMDay opened 2 months ago

TrevorKMDay commented 2 months ago

It's my understanding the number of cosine_ regressors are based on the length of the scan. However, I thought they behaved like the aCompCor regressors, i.e. more than you need are calculated. I spent some time looking for how many to select based on the length of the scan, before finding out fMRIPREP makes that calculation for you and spits out exactly the correct number of cosine_ regressors.

I think the documentation could be more explicit about the number of cosine regressors and how fMRIPREP selects them for you.

effigies commented 2 months ago

Thanks!

Just to state: fMRIPrep doesn't produce the "correct" number of cosine regressors, it produces those needed for a 128s high-pass cutoff. You are free to use less (or more, if you calculate them yourself).

That said, from https://fmriprep.org/en/stable/outputs.html:

fMRIPrep does high-pass filtering before running anatomical or temporal CompCor. Therefore, when using CompCor regressors, the corresponding cosine_XX regressors should also be included in the design matrix.

Here the point is that you should use all of the cosine regressors if you're going to use CompCor.

If this is unclear, could you propose clearer wording that would you feel would have gotten the point across better?

TrevorKMDay commented 2 months ago

Ah thanks for the note and quick reply.

I think it would be useful to include something like "it produces those needed for a 128s high-pass cutoff, based on the length of the scan ... One characteristic of the cosine regressors is that they are identical for two different datasets with the same TR ..."

Therefore when using CompCor regressors, [all of] the cosine_XX regressors should be included ...

I suppose I got a little turned around because the other regressors contain a lot of information about how many to select, but with cosine_XX, you just use them all. Does that make sense? "Corresponding" to me isn't very clear, it sounds like if you used the first 10 CompCor regressors, you'd only use the first cosine, and then with 20, you'd use the first two or something.

effigies commented 1 month ago

Would you feel up for opening a PR against the documentation?

TrevorKMDay commented 1 month ago

Sure, I can next week

On Thu, Sep 5, 2024 at 11:56 AM Chris Markiewicz @.***> wrote:

Would you feel up for opening a PR against the documentation?

— Reply to this email directly, view it on GitHub https://github.com/nipreps/fmriprep/issues/3351#issuecomment-2332103548, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADGMXGFBUS2OEFTKZTEWJCTZVB5LZAVCNFSM6AAAAABM6L43X6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZSGEYDGNJUHA . You are receiving this because you authored the thread.Message ID: @.***>

-- Trevor