Nilearn orthogonalization in nilearn.glm.first_level

Hi,
I was looking into the orthogonalization for the design matrix used in nilearn.glm.first_level, and there is something I need help figuring out. I am using Nilearn version 0.10.4.

When creating a design matrix in nilearn/glm/first_level/design_matrix.py, the make_first_level_design_matrix function calls _convolve_regressors. In _convolve_regressors, we iterate over each condition in the events and use the compute_regressor function from hemodynamic_models.py.

From what I checked in my code, compute_regressor works on a single vector, which is a single regressor of the condition, and it performs orthogonalization over a single regressor each time, which doesn’t make sense.

I would appreciate any help to understand if I am missing something here.
Thanks!
Tamir Scherf

I believe the orthogonalization in this case is applied across HRF model regressors (e.g., the HRF, its temporal derivative, and its dispersion derivative, if they’re included in the requested HRF model), rather than across conditions.

Indeed. Orthogonalizing across conditions makes the interpretation very tricky. Hence it is performed only within each condition.
HTH, Bertrand

1 Like

Hi,
Sorry for the late reply, and thanks a lot for your responses!
It makes better sense now.
Thanks!
Tamir