[go: up one dir, main page]

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

add possibility to initialize GLM with "design matrices" (or events) #4505

Open
Remi-Gau opened this issue Aug 16, 2024 · 4 comments
Open

add possibility to initialize GLM with "design matrices" (or events) #4505

Remi-Gau opened this issue Aug 16, 2024 · 4 comments
Labels
API This issue is related to the Nilearn's API. GLM Issues/PRs related to the nilearn.glm module.

Comments

@Remi-Gau
Copy link
Collaborator

The rationale would be to be able to generate a report with the model to be fitted.

So something like:

first_level_model = FirstLevelModel(t_r, events=events)
# inspect that everything is OK
report = first_level_model.generate_report()
# then fit the model
first_level_model = first_level_model.fit(fmri_img)

Instead of the current:

first_level_model = FirstLevelModel(t_r, events=events)
# fit the model
first_level_model = first_level_model.fit(fmri_img, events=events)
# inspect that everything was OK but if anything was wrong we need to refit everything
report = first_level_model.generate_report()

Not sure if this is easily feasible but in terms of using the reports to do early QC it would be better from a user experience perspective.

@Remi-Gau Remi-Gau added the Enhancement for feature requests label Aug 16, 2024
@Remi-Gau
Copy link
Collaborator Author

from a quick look it seems that it would be possible to do it

@bthirion do you think it would be something desirable to have / do ?

@bthirion
Copy link
Member

Normally, you want to have events associated with fMRI data. Both are provided at fit time.
You want to specify the GLM irrespective of the events.
Home I got your point right.
Best,

@Remi-Gau
Copy link
Collaborator Author

Normally, you want to have events associated with fMRI data. Both are provided at fit time.
You want to specify the GLM irrespective of the events.

I want to be able to specify the model irrespective of the data.

I think that it'd be nice to be able to distinguish model specification (which is fast and allows to review / inspect the model) from model estimation.

From my understanding SPM and FSL, do make that distinction by allowing inspection of the specified model before fitting. AFNI I think does not allow that.

From what I can read FSL even allows to pass contrasts with model specification which allows to compute design efficiency as well (since this does not require any data).

Not exactly a hill I want to die on but this is not urgent either so I will leave the issue open in case some other people are interested.

Could also be discussed at a dev meeting.

@bthirion
Copy link
Member

+1 for discussion.
Nilearn offers the possibility to build design matrices, but indeed, the API is different which makes it less easy to run.
On the other hand, I want to insist that GLM specification involves a fit(), so that it would make little sense to me to provide events descriptors during model setup. Nothing is carved in stone though, so I'm happy to hear more about your motivation.

@Remi-Gau Remi-Gau added GLM Issues/PRs related to the nilearn.glm module. API This issue is related to the Nilearn's API. labels Sep 4, 2024
@Remi-Gau Remi-Gau removed the Enhancement for feature requests label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API This issue is related to the Nilearn's API. GLM Issues/PRs related to the nilearn.glm module.
Projects
Status: Backlog
Development

No branches or pull requests

2 participants