-
Notifications
You must be signed in to change notification settings - Fork 42
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
Integrate widget from upstream ipyvtk_simple #53
Comments
Thank you for working on this. I'm very much in favor of sharing a single Jupyter VTK render window viewer! A few comments/suggestions that would need to be addressed:
We should not use dash in the name, as it just bring unnecessary complexity: we cannot use the same name everywhere (some places you need to use ipyvtk-simple, other times you need to use ipyvtk_simple). Since the package offers a viewer (render window), it should be reflected in the name. "simple" usually refers to simplifying/abstracting another package, which is not the case here, as we wrap VTK features to create widgets. For example, these names would be much better: ipyvtkviewer, ipyvtkrenderwindow, ipyvtkwindow, ipyvtkrenderer. If you plan to add other Jupyter related features then the package could be ipyvtk or ipyvtkwidgets or vtkwidgets (similar to ITK's itkwidgets).
Do you mean there would be no more quick/full render anymore?
Javascript-side throttling would be nice. Have you managed to throttle events at that level? I've tried Python-side throttling (
asyncio may not play well in applications that have their own event loop, such as Slicer. I think we tried it in Slicer and it did not work at all. Did you need to do anything special for this to work in ParaView? What Qt wrapping Paraview uses? How Python is integrated into ParaView's event loop? Probably we should add an option to switch between different timer mechanisms. We need to have at least PythonQt and asyncio options (but others may want to add PyQt). |
The dash appears only in the repository name/URL - everywhere else, it uses an underscore. I am well aware of how confusing this can get with Python packages.
You bring up an excellent point... we deliberately chose the name
No this is still there for the most part, but much of the timer code that went into it has gone away in favor of throttling on the server-side. I may have messed this up actually - I will need to revisit it.
This is a good point, we can open an issue in Indeed, the performance on Binder is not great. We have demos here:
Nothing special at all... I'm not sure what you are getting at/what issues you were having?
That's fair. There shouldn't be a need to use PythonQt timer options... Everything should work without any special Qt stuff if you make the events thread-safe (I think). The widget works fine with PyVista's |
Thanks for the additional information. Since you plan to keep only the interactive viewer in the package, the name should reflect this: it is a viewer, not a simple interface to VTK. So, please rename it to something like ipyvtkviewer, ipyvtkrenderwindow, ipyvtkwindow, ipyvtkrenderer, ...
OK!
Slicer's refresh rate is much better than the current https://mybinder.org/v2/gh/Kitware/ipyvtk-simple/master - view rotation in SlicerJupyter on binder seems more smooth (except when congestion kicks in due to lack of throttling at javascript level). But maybe it is just due to render window size difference. Nevertheless, it seems that there is no high-speed rendering done anymore (at least I don't see it in pyvista.ipynb) and we always need to wait for the full-quality rendering to be sent over. Note that we could reach almost any frame rate in quick_render by not just altering compression options but also lowering resolution (rendering at 1/2 or 1/4 resolution, sending that image over, and displaying that with 2x or 4x zoom)
asyncio's has an event loop and if you have a GUI application then it has an event loop, too, so they are not supposed to work together unless you make asyncio use the application's event loop instead of creating its own. There is nothing special about PythonQt, it is the same for PyQt, Tk, etc. Maybe you used a server implementation of ParaView that does not have a GUI. |
I borrowed much of the awesome work here in the
ViewInteractiveWidget
class to createipyvtk_simple
as a more minimal, general, and extensible version of the widget for use with anyvtkRenderWindow
backend (VTK or ParaView). It would be awesome refactor this project to utilizeipyvtk_simple
for the widget and maintain it there so that the broader Jupyter VTK ecosystem can leverage the excellent work done in this project!I can handle a PR for this, but I won't have time likely until mid-August at the earliest. I figured I'd raise the issue just so everyone is aware and if there needs to be any discussion on this work, that can happen here. cc @jcfr
Some notable changes:
vtkRenderWindow
during initipyevents
andipywdigets
(see Improve interactive performance Kitware/ipyvtklink#3 and linked PRs)The text was updated successfully, but these errors were encountered: