Skip to content

ENH: Add public LayeredMesh and brain.layered_meshes#13970

Open
payamsash wants to merge 12 commits into
mne-tools:mainfrom
payamsash:brain-streaming-api
Open

ENH: Add public LayeredMesh and brain.layered_meshes#13970
payamsash wants to merge 12 commits into
mne-tools:mainfrom
payamsash:brain-streaming-api

Conversation

@payamsash

Copy link
Copy Markdown

Reference issue (if any)

#13949

What does this implement/fix?

Adds the streaming API discussed in the issue:

  • _LayeredMesh changed to LayeredMesh (public, with _LayeredMesh alias kept for compat)
  • LayeredMesh.smooth_mat: sparse matrix applied automatically in add_overlay/update_overlay
  • Brain.add_data(key="data"): named overlays
  • Brain.layered_meshes : access the mesh dict directly
  • set_data_smoothing() now syncs smooth_mat onto the mesh
  • LayeredMesh exported from mne.viz

Additional information

  • "I implemented the code changes myself, and Claude Sonnet 4.6 reviewed it."

@welcome

welcome Bot commented Jun 20, 2026

Copy link
Copy Markdown

Hello! 👋 Thanks for opening your first pull request here! ❤️ We will try to get back to you soon. 🚴

@payamsash payamsash requested a review from agramfort as a code owner June 20, 2026 15:38
Comment thread mne/viz/_brain/_brain.py Outdated
def layered_meshes(self):
"""Dict of :class:`~mne.viz.LayeredMesh` objects keyed by hemisphere."""
return self._layered_meshes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What is the purpose here of having a property that shadows a private variable? Why not rename brain._layered_meshes -> brain.layered_meshes?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yes it's unnecessary, I'll drop/rename. tnx

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

otherwise, LGTM

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.

2 participants