fmriprep icon indicating copy to clipboard operation
fmriprep copied to clipboard

cosine regressors

Open TrevorKMDay opened this issue 1 year ago • 4 comments

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.

TrevorKMDay avatar Aug 22 '24 15:08 TrevorKMDay

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?

effigies avatar Aug 22 '24 15:08 effigies

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.

TrevorKMDay avatar Aug 22 '24 15:08 TrevorKMDay

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

effigies avatar Sep 05 '24 15:09 effigies

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

TrevorKMDay avatar Sep 20 '24 18:09 TrevorKMDay