Skip to content

DOC: Example using Vertexselect with source index - #14169

Open
Gnefil wants to merge 14 commits into
mne-tools:mainfrom
Gnefil:vertexselect-source-index
Open

DOC: Example using Vertexselect with source index#14169
Gnefil wants to merge 14 commits into
mne-tools:mainfrom
Gnefil:vertexselect-source-index

Conversation

@Gnefil

@Gnefil Gnefil commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Reference issue (if any)

#14094

What does this implement/fix?

This enhances the documentation tutorial 20_ui_events.py by providing an example to VertexSelect.

Additional information

Continuation of PR #14126 and #14154.

@Gnefil Gnefil changed the title Vertexselect source index DOC: Example using Vertexselect with source index Aug 18, 2026
@Gnefil
Gnefil marked this pull request as ready for review August 20, 2026 14:12
@Gnefil
Gnefil requested a review from larsoner as a code owner August 20, 2026 14:13
Copilot AI lite review requested due to automatic review settings August 20, 2026 14:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the UI events tutorial by adding a concrete, end-to-end example demonstrating how to react to VertexSelect events using the source_id payload (for indexing source-space–aligned data like forward-model gain matrices). It also includes a small internal adjustment in Brain picking logic related to computing the selected source index.

Changes:

  • Add a new tutorial section showing how to subscribe to "vertex_select" and use event.source_id to drive a topomap.
  • Adjust volume picking code in mne.viz.Brain to use a source_id variable when determining the selected point.
  • Add a changelog fragment for the documentation update.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
tutorials/visualization/20_ui_events.py Adds a VertexSelect usage example that indexes a forward gain matrix via source_id.
mne/viz/_brain/_brain.py Tweaks how the selected index is computed/named during volume picking before publishing VertexSelect.
doc/changes/dev/14169.other.txt Adds a changelog entry for the new tutorial example.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread mne/viz/_brain/_brain.py
Comment thread tutorials/visualization/20_ui_events.py Outdated
Comment thread doc/changes/dev/14169.other.rst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants