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
ENH: Notebook 3d backend improvements (ipyvtklink) #8704
For a screenshot it seems like it should be fairly easy since the ipyvtk_simple is sending bitmaps, and/or we should be able to get the Renderer directly and get the image from it
Although now ipycanvas is supported on Google Colab, vtk, even on notebook, still requires a running X server.
My testing workflow is: ipycanvas ✔️ -> ipyvtklink ✔️ -> pyvista (ipyvtklink) ✔️ -> mne-python (notebook)
It's a work in progress but I managed to get it working at low resolution, which is already amazing IMO.
Here is a modified version of ipyvtklink's default example:
output.mp4
The important points:
setting the custom widget manager
from google.colab import output
output.enable_custom_widget_manager()
Activity
[-]Notebook improvements[/-][+]Notebook 3d backend improvements (ipyvtk)[/+]GuillaumeFavelier commentedon Jan 7, 2021
About Google Colab, I made some research @agramfort.
Considering that
ipyvtk_simple's main viewer class,ViewInteractiveWidget, is based onipycanvas'sCanvaswidget, I found that it is a known issue. The short answer is (and I quote Martin Renou):We could track the progress on this matter on https://github.com/martinRenou/ipycanvas/issues/170 or more directly in googlecolab/colabtools#498.
Anyway, I think those need to be resolved before more can be expected from
ipyvtk_simpleand finallymne-python.larsoner commentedon Jan 7, 2021
For movie and autoplay I think you basically need a timer, e.g. https://stackoverflow.com/questions/57255394/jupyter-and-timer-functions
For a screenshot it seems like it should be fairly easy since the ipyvtk_simple is sending bitmaps, and/or we should be able to get the
Rendererdirectly and get the image from itFor label time course do you need more than https://ipywidgets.readthedocs.io/en/latest/examples/Widget%20List.html#Dropdown ?
For sizing I think it's https://ipywidgets.readthedocs.io/en/latest/examples/Widget%20Styling.html
GuillaumeFavelier commentedon Jan 7, 2021
Exactly what I was looking for, thank you @larsoner 👍
[-]Notebook 3d backend improvements (ipyvtk)[/-][+]ENH: Notebook 3d backend improvements (ipyvtk)[/+]GuillaumeFavelier commentedon Apr 14, 2021
The mouse events on Firefox might be fixed by Kitware/ipyvtklink#25. I'll open a PR and give it a try.
GuillaumeFavelier commentedon Apr 14, 2021
It might not be necessary, I don't have those issues anymore on Firefox 87.0
GuillaumeFavelier commentedon Apr 29, 2021
For
Jupyter Labintegration it might worth trying again once pyvista/pyvista#1116 is fixed.GuillaumeFavelier commentedon Mar 9, 2022
Quick update:
ipycanvasnow works on Google Colab. It's a big milestone for thenotebook3d backend.https://github.com/martinRenou/ipycanvas/issues/170#issuecomment-1062071346
I'll check
ipyvtklinkand report back in here.agramfort commentedon Mar 9, 2022
[-]ENH: Notebook 3d backend improvements (ipyvtk)[/-][+]ENH: Notebook 3d backend improvements (ipyvtklink)[/+]GuillaumeFavelier commentedon Mar 9, 2022
Although now
ipycanvasis supported on Google Colab,vtk, even on notebook, still requires a running X server.My testing workflow is:
ipycanvas✔️ ->ipyvtklink✔️ ->pyvista (ipyvtklink)✔️ ->mne-python (notebook)It's a work in progress but I managed to get it working at low resolution, which is already amazing IMO.
Here is a modified version of
ipyvtklink's default example:output.mp4
The important points:
xvfbxvfbwith the correctDISPLAYvariable at the beginning of the cellNote:
I tested on
Mozilla Firefox 97.0.2.Known issues:
I encountered a bug where I have to change the size of the viewer explicitly to re-render.
larsoner commentedon Oct 1, 2023
I think we can close this now that the notebook seems to be working correctly (even nowadays with
trame)