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 sourcespace to Report #12848

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

vferat
Copy link
Contributor

@vferat vferat commented Sep 13, 2024

Reference issue (if any)

Fixes #12836

What does this implement/fix?

Add a src argument to the Report.add_bem method.

Additional information

I'm not sure which strategy to adopt and changes to make to Report.parse_folder.
The Report.parse_folder method automatically adds BEM to the Report if Report.subject is specified. However, several sourcespaces -src.fif files might be present in the BEM folder and/or folder to parse.

@larsoner
Copy link
Member

For add_folder I think if a source space is found, it could be passed in during the add_bem step (assuming that happens in parse_folder, I don't remember!). Not 100% sure the right thing to do when multiple source spaces are found, could just put in whichever is first, or only add one if there is exactly one source space. I'm thinking just using the first one would make sense so that you get some sense whether or not the alignment is correct.

Another place it would be nice to add if you're motivated is in report.add_trans since that's used for making sure everything is nicely aligned, too.

Then it would be good to pass some src in the tests for report.add_bem and report.add_trans

@vferat
Copy link
Contributor Author

vferat commented Sep 16, 2024

Having looked at the many possibilities, I think the best solution would be to add a figure in the forward section:
the forward object contains all the information needed to display the source space

This solution has the advantage of being able to also display the EEG sensors projected onto the scalp, as well as displaying only the sources used in for forward computation (as some sources from the original source space may be dropped if too close to the inner skull surface). This will give a global idea of the sensors <-> sources model.

mne.viz.plot_alignment(trans=fwd["mri_head_t"], info=fwd["info"], src=fwd["src"], eeg=dict(original=0.2, projected=0.8))

image

We could also have a clearer view of the source space with an additional plot:

image

@larsoner
Copy link
Member

I like both of those plots! Adding to the forward section sounds reasonable to me

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

Successfully merging this pull request may close these issues.

MNE Report: plot source space(s)
2 participants