Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cosine regressors #3351

Open
TrevorKMDay opened this issue Aug 22, 2024 · 3 comments
Open

cosine regressors #3351

TrevorKMDay opened this issue Aug 22, 2024 · 3 comments

Comments

@TrevorKMDay
Copy link

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
Copy link
Member

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
Copy link
Author

TrevorKMDay commented Aug 22, 2024

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
Copy link
Member

effigies commented Sep 5, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants