mne-tools / mne-nirs

Process Near-Infrared Spectroscopy Data in MNE
https://mne.tools/mne-nirs/
BSD 3-Clause "New" or "Revised" License
84 stars 35 forks source link

Add source-detector on head/brain view #59

Closed rob-luke closed 4 years ago

rob-luke commented 4 years ago

It is common to display the output of NIRS channel level analysis over a brain or head. I prefer the style where each channel is a line between the source and detector and the color indicates the analysis output. This makes it clear to the viewer where the measurement was taken, and compliments the topomaps.

Below is an example from the AnalysIR toolbox. I think their style is very nice.

Screen Shot 2020-04-07 at 10 20 54 am

larsoner commented 4 years ago

This could be a fairly easy (I think?) addition to mne.viz.plot_alignment. If there are paired fNIRS channels, add lines.

Same for plot_sensors in 3D (and 2D for that matter) mode.

rob-luke commented 4 years ago

Great. Thanks @larsoner. I'm now very glad I started to dump my thoughts as issues. I will take a look at mne.viz.plot_alignment and let you know if I have any questions.

One thing I am struggling with is where the different brain plotting code fits together. It seems MNE, pysurfer and nilearn all have their own brain visualisation code. Is this correct? Should I just stick with MNE codebase for now?

larsoner commented 4 years ago

MNE has tended to use PySurfer in the past but recently we've been moving to PyVista. nilearn does a different bit of plotting but AFAIK it's all with matplotlib so eventually 3D becomes limiting when trying to view brain surfaces, volume rendering, etc.

FYI you can look at each function to see where it ends up being used, e.g.:

https://mne.tools/dev/generated/mne.viz.plot_alignment.html#examples-using-mne-viz-plot-alignment

The third one for example would be very easy to imagine having lines added between the sensors (maybe even curved to try to avoid going inside the head):

https://mne.tools/dev/auto_examples/visualization/plot_eeg_on_scalp.html#sphx-glr-auto-examples-visualization-plot-eeg-on-scalp-py

rob-luke commented 4 years ago

Thanks for the pointers. This really helps.

FYI: this is by far the most requested feature that people ask me for (students, reviewers, etc). So I will probably focus on this next.

larsoner commented 4 years ago

It seems pretty straightforward. You can add it directly in MNE. If it's not clear how, let me know and I can help