question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Get render window in jupyter and integrate it with ipyvtk

See original GitHub issue

Hello,

It seems that ipyvtk-simple supports all vtk-based viewers in jupyter notebooks. What kind of code would allow embedding a plot made with vedo inside ipyvtk?

It seems to work with Paraview and pyvista. I tried to plug plot.window into ipyvtk but I got none.

Is there a way to retrieve the window from plot.show() in jupyter notebook?

from vedo import *
from ipyvtk_simple.viewer import ViewInteractiveWidget
# embedWindow(False) # ideally, we would specify ipyvtk here
plot = Plotter()
obj = load(datadir+"cessna.vtk")
plot.show(obj)
# After show, I should have access to window property
print(plot.window) # yields None
ViewInteractiveWidget(plot.window) # So this won't work obviously

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
nantillecommented, Apr 20, 2021

A note here: ipyvtk-simple was renamed to ipyvtklink. Please include the renaming in your next update. 😃

1reaction
nantillecommented, Mar 17, 2021

It does work! I haven’t checked the releases recently so I had no idea. Thanks a lot for making that work! As a side-note, if like me you have some commented code below the line ViewInteractiveWidget(plot.window), the viewer will not appear in the notebook and instead you will have what’s in the comments printed. Just remove any comment below that line and it works like a charm.

Edit More precisely: only multi-line comments after that line prevent the viewer from being shown. Comments with a sharp sign do not alter the viewer.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ipyvtk-simple - PyPI
The goal is to enable this widget to work with any server side vtkRenderWindow This render window could be from VTK Python, ParaView,...
Read more >
IPython Notebook & VTK - PyScience - WordPress.com
This post will show the only, currently available, way to integrate those beautiful renderings you might create with VTK into an IPython ......
Read more >
Using ipyvtklink with PyVista
This feature works by streaming the current render window to a canvas within JupyterLab and then passing any user actions from the canvas...
Read more >
vtk in jupyter - Web - VTK Discourse
Hi.I've integrated Python vtk in Jupyter lab, however, executing the code opens the renderer window at the server machine not embedded inside Jupyter...
Read more >
Working with Jupyter Notebooks in Visual Studio Code
If you have an existing Jupyter Notebook, you can open it by right-clicking on ... The Python Jupyter Notebook Editor window has full...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found