You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Plotting multiple overlays simultaneously with add_data function in MNE's Brain class #11503
According to docs, the add_data function in MNE's Brain class takes the Boolean argument of whether or not to remove previously data that's been added with add_data. However, the default behavior already is that existing data gets deleted when calling add_data again. This happens around line 1885 in file mne/viz/_brain/_brain.py where it says self.update_lut(). Yet it should be up to the user to decide whether previous data should be removed or not.
To provide some background: I would like to be able to plot two overlays simultaneously on the same brain as is done here. That example unfortunately does not work anymore, as I describe here, and PySurfer is not maintained as well as MNE. Now, Eric Larson therefore suggested that this should be possible to achieve with MNE's Brain class in response to my post. Contrary to expectation (given the similarities between PySurfer's and MNE's brain classes) MNE currently does not provide such a solution, as I described in the MNE forum.
Could someone please find a solution to this that produces output that is as close as possible to (or better than) this PySurfer example? I say "better than" because the color of the conjunction is determined explicitly in the PySurfer example when IMHO it would be more convenient to let the class figure it out itself possibly via alpha blending.
Cheers,
Michael
Describe your proposed implementation
I don't know the ins and outs of MNE's brain class but it looks like adding support for the remove_existing argument in add_data would be suitable for implementing the solution.
I think in principle we could/should support this. Hopefully it's not too difficult to process a list of items rather than assuming there is just one data entry
Activity
welcome commentedon Feb 23, 2023
Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴🏽♂️
larsoner commentedon Feb 23, 2023
I think in principle we could/should support this. Hopefully it's not too difficult to process a list of items rather than assuming there is just one data entry
payamsash commentedon Jun 26, 2026
If okay for both of you, I wanna open a PR for this.
larsoner commentedon Jun 26, 2026
Yes please do @payamsash !