Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plotting multiple overlays simultaneously with add_data function in MNE's Brain class #11503

Open
mmbannert opened this issue Feb 23, 2023 · 2 comments
Labels

Comments

@mmbannert
Copy link

Describe the new feature or enhancement

Hi,

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.

Describe possible alternatives

There are no alternatives that I am aware of.

Additional context

This is the type of figure that I am aiming for. image

@mmbannert mmbannert added the ENH label Feb 23, 2023
@welcome
Copy link

welcome bot commented Feb 23, 2023

Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴🏽‍♂️

@larsoner
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants