-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
ENH: Add channel names to plot_alignment (#13502) #13507
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
base: main
Are you sure you want to change the base?
ENH: Add channel names to plot_alignment (#13502) #13507
Conversation
larsoner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you modify some example/tutorial where it would help to have this? Maybe:
- Modify this plot? https://mne.tools/stable/auto_tutorials/preprocessing/70_fnirs_processing.html#viewing-location-of-sensors-over-brain-surface
- Add one to https://mne.tools/stable/auto_tutorials/intro/40_sensor_locations.html ?
- Can look here to see if there are other good candidates: https://mne.tools/stable/generated/mne.viz.plot_alignment.html#examples-using-mne-viz-plot-alignment
| @@ -1,4 +1,4 @@ | |||
| """Functions to make 3D plots with M/EEG data.""" | |||
| z"""Functions to make 3D plots with M/EEG data.""" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| z"""Functions to make 3D plots with M/EEG data.""" | |
| """Functions to make 3D plots with M/EEG data.""" |
| %(seeg)s | ||
| %(fnirs)s | ||
| .. versionadded:: 0.20 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| .. versionadded:: 1.x (The maintainer will finalize the version number) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| .. versionadded:: 1.x (The maintainer will finalize the version number) | |
| .. versionadded:: 1.12.0 |
#13502.
What does this implement/fix?
This PR implements the ability to display channel names directly on the 3D alignment plot.
A new parameter, show_names, is added to :func:mne.viz.plot_alignment. When set to True, it renders the channel name as a text label next to the corresponding sensor location in the 3D scene.
The implementation uses renderer.text3d to place labels for all standard sensor types (MEG, EEG, ECoG, SEEG, DBS).
A unit test has been added to mne/viz/tests/test_3d.py to ensure that text actors are correctly added to the scene when the parameter is used.
Additional information
The scale of the text labels is set to be small (0.003) and the color is gray to avoid dominating the visualization.
A corresponding entry has been added to the change log using towncrier.