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.
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.
(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.
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.
(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. |
|
Thanks @GuillaumeFavelier |








This PR reworks the interactor in
_Brainwhen usingflatmapsand adds a button to reset the initial time index and camera settings "Reset".vtkInteractorStyleRubberBand2Dwith parallel projectiontry/exceptorhasattrfor "RubberBand2D"It's an item of #7162
Related to #8082 (comment)