ENH: Reapir and enahnce logic of ChannelsSelect event handling in Xfit-like dipole GUI - #25
Conversation
|
oh, |
There was a problem hiding this comment.
Pull request overview
This PR updates the dipole fitting GUI’s 3D sensor rendering/selection path so selected channels can be highlighted reliably after the instanced-rendering changes, by attaching channel-name metadata to the underlying glyph “cloud” datasets and driving selection highlighting via per-point RGBA updates. It also adds a GUI test assertion that the 3D selection state matches the topo lasso selection.
Changes:
- Make
_plot_glyphs()return both the VTK actor and the underlying point “cloud” dataset, enabling later per-point updates. - Attach
ch_namesintocloud.field_datafor instanced sensor meshes to support mapping selections back to channel names. - Update the dipolefit GUI + tests to recolor sensors based on selected channel names and validate the highlight behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
mne/viz/_3d.py |
Returns glyph cloud objects and stores per-instance ch_names metadata on sensor glyph clouds for selection/highlighting. |
mne/gui/_dipolefit.py |
Switches sensor selection highlighting to operate on per-point RGBA in the instanced glyph “cloud” data. |
mne/gui/tests/test_dipolefit.py |
Adds assertions that selected channels are actually highlighted in the 3D sensor scene and cleared on close. |
Suppressed comments (1)
mne/viz/_3d.py:1516
- Indexing
[0]on_plot_glyphs(...)will raise when there are no head-shape ("extra") dig points (because_plot_glyphsreturnsNonewhenlen(loc) == 0). This makes_plot_head_shape_pointsfail for infos withoutFIFFV_POINT_EXTRA.
backface_culling=True,
check_inside=check_inside,
nearest=nearest,
)[0]
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
I'll merge this in and then continue work in the |
Reference issue (if any)
What does this implement/fix?
The channel select function suffered deterioration due to a recent rendering pipeline upgrade, for the sake of efficiency. It wasn't able to properly highlight the selected channels in the GUI.
This PR repairs the issue by changing the colour of the cloud specific to each actor, while also improving the logic to extend to all channel types and coils.
Additional information