-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
MRG: Reset the viz settings in _TimeViewer #8125
Conversation
…ameters in _TimeViewer
Could we use a 2D interactor instead like https://vtk.org/doc/nightly/html/classvtkInteractorStyleRubberBand2D.html |
Yes indeed! In my experiments it works assuming that the camera uses parallel projection :) |
These are the results for "restore" on material.io:
4 is already used for "Restore Scale". I put it in case we would swap for something else. Alternatively:
I searched "reset" and "init" without success. |
I prefer 1 personally. Any opinion @agramfort , @larsoner, @hoechenberger, @drammock ? |
I think 1 could be a nice choice :) |
+1 for 1
|
I'll go ahead with 1 then |
mne/viz/backends/_pyvista.py
Outdated
if interaction == "rubber_band": | ||
for renderer in self.plotter.renderers: | ||
renderer.enable_parallel_projection() | ||
style = vtk.vtkInteractorStyleRubberBand2D() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you open a PR to pyvista to add this as a mode? Then we can try/except
or hasattr
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(For example, this mode will suffer from the "click-and-drag-not-captured" bug, because the fix for this is in PyVista subclassing the VTK interactor style and dealing with button presses.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you open a PR to pyvista to add this as a mode?
Sure, will do.
I use middle-click to drag with this one. I was not aware of this bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(It's possible we also need to capture middle clicks, in which case hopefully from pyvista/pyvista#854 it's clear what you'd need to do to capture those, too)
@larsoner I opened pyvista/pyvista#872 Also, could you check the that mne logo is exactly like you want? I had the following message while building it:
Maybe that was not a good idea but I tried multiple packages for my linux distribution without any success. |
The MNE logo in the resources is a PNG. I'm not sure why this would happen. But FWIW you can get the Primetime font listed in the logo generation script for free here |
The logo is not tracked in |
But you shouldn't have gotten any font warning from running the icon resource generation from the mne logo because it's not a vector format, but rather bitmap. Did you also need to run something from logo/? Or did you just run the icons/ script? Can you got bisect to verify it's coming from the logo commit? |
On a system without the Primetime font, I can reproduce with:
But you should not have needed to call
which does not emit any warning. ... but then I realized that the logo actually was not saved as part of the git repo! So now I see why you had to do all of this. I'll push a commit that adds the PNG so that people don't have to do it in the future, and also regenerate the resources. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great for me
Thanks @GuillaumeFavelier |
This PR reworks the interactor in
_Brain
when usingflatmaps
and adds a button to reset the initial time index and camera settings "Reset".vtkInteractorStyleRubberBand2D
with parallel projectiontry/except
orhasattr
for "RubberBand2D"It's an item of #7162
Related to #8082 (comment)