mne-tools / mne-python

MNE: Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python
https://mne.tools
BSD 3-Clause "New" or "Revised" License
2.73k stars 1.33k forks source link

MNE Report: plot source space(s) #12836

Open vferat opened 2 months ago

vferat commented 2 months ago

Describe the new feature or enhancement

To my knowledge, there is no way to display source space(s) in the MNE Report. I would be nice to be able to quickly visualize the source space distribution, especially when working with automated tools such a MNE-BIDS-Pipeline.

Describe your proposed implementation

A src parameter could be added to the report.add_bem method in order to visualize a source space ( very few changes)

src_fname = r"C:\Users\victor.ferat\mne_data\MNE-testing-data\subjects\sample\bem\sample-fsaverage-ico-5-src.fif"
src = mne.read_source_spaces(src_fname)

report = Report(
    subjects_dir=subjects_dir,
    projs=False,
    image_format="png",
)
report.add_bem(subject='sample', title='BEM with src', src=src)

image

Describe possible alternatives

Source space data might also be extracted from the forward instance and therefore be added in the using the Report.add_forward method instead.

We could also create a dedicated add_src method.

Additional context

No response

larsoner commented 2 months ago

Agreed I think it would be cool to support it in add_bem!