GLM on surface data in NiLearn

Does anyone know why NiLearn uses different functions to fit the glm for surface data versus volume data? Based on the tutorials run_glm is the only function that takes surface data whereas the main function nilearn.glm.first_level.FirstLevelModel only accepts niftis. Am I overlooking something or is this by design?

Hi,
Indeed in the example, we use low-level functions to run the GLM on the surface becauseā€¦ we have not yet implemented a high-level API that would be the equivalent of FirsLevelModel for surface data.
So I hope that weā€™ll propose something better in a future release.
HTH,
Bertrand

Thanks @bthirion . In future releases will FirstLevelModel take volume or surface data? Is there an open PR or issue on this? If no one is currently working on it I could try

Related question: is this tutorial still up to date for the current best practices in surface glm? I didnā€™t see any handling of confounds

Yes, the tutorial you mention is fine. In that case, you would need to handle confounds ā€˜manuallyā€™ by creating the design matrix first.
Let me suggest that you open an issue on Nilearn first: this is a way to get more peopleā€™s opinions.
Thx !

Bertrand

1 Like

@bthirion - Can you offer any guidance on analyzing multiple runs of surface data? This tutorial only covers one run. And unlike the volume functions, it doesnā€™t seem that the surface functions are set up to handle multiple runs of data

You have to do the fixed effects analysis ā€œmnauallyā€.
You have an example in this file:

HTH,
Bertrand

1 Like