mne-tools / mne-tools/mne-python

viz.plot_sensors('3d') doesn't handle mouse clicks to reveal sensor names correctly

Open
#9,328 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

BUG VIZ
Dominant language
Python
Stars
3.5k
Forks
1.6k
Avg merge
1d 6h
Merged PRs (30d)
100

Description

MWE:

from pathlib import Path
import matplotlib
import mne

matplotlib.use('Qt5Agg')

sample_dir = Path(mne.datasets.sample.data_path())
sample_fname = sample_dir / 'MEG' / 'sample' / 'sample_audvis_raw.fif'

raw = mne.io.read_raw_fif(sample_fname, preload=False)
raw.plot_sensors('3d')

Clicking on the frontal sensors reveals names of channels someplace else.

https://user-images.githubusercontent.com/2046265/115535014-a6acc000-a298-11eb-881d-bacf661ee57d.mov

When show_names=True is passed, the channels are labeled correctly, though, leading me to believe that the odd behavior described above is related to click -> channel mapping

Screen Shot 2021-04-21 at 11 55 09

For completeness, here's a 2D sensor plot:
Screen Shot 2021-04-21 at 11 54 48

macOS with Qt5 backend.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run the provided MWE with the Qt5Agg backend and inspect viz.plot_sensors('3d'), comparing click-to-channel mapping with show_names=True and the 2D plot. Done means clicking a frontal sensor reveals that sensor's name at the correct location; the payload does not name a source file or test.

Written by the indexing model from the issue text.

Assessment

Tech stack
matplotlib, python
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.