Vtk ui
Hello
Im writing for those who may find themselves in the same situation as well as for any guidance from the experts
I started down a path of writing an interactive vtk application. I am inspired by fui (iron man, ansys disocvery). I was intrigued with trame and vtk wasm. However when thinking through deploying this at scale, it would seem that i would need an instance of trame running per user on demand through my kubernetes cluster as I wanted to control lifetime and resource and be a good citizen on the shared resource.
So, in order to provide something to our users, I decided to write a desktop app that could interact with our web services since our users’ workstations are sufficient to interact with the data.
That lead to multiple trial and error experiments that I will list here:
-
Trame with local access: This proved difficult as the browser does not have local access. I would have to package a tkinter file open dialog from a locally running trame
-
This lead to trying to package trame with pywebview to get a local desktop app feel but that had many obstacles related to how trame interacts with pywebview. There is another framework thet interacts with rust but i did not want to pull rust into my cicd
-
So, I tried to embed both the trame ui and vtk in qt and get a transparent html layer over the open gl (similar to ansys tools). This did not work
-
-
Lastly, knowing about imgui from a colleague through polyscope usage, i tried imgui and vtk.
-
I tried jspanchu vtk imgui injector and tried to port it to python but that didnt work due to vtk gl issues
-
I landed on https://github.com/mortacious/pyvista-imgui which I am now happily using. It needed some tlc. However, I am able to get that instant gratification ui dopamine hit and build a spectacular experience
-
Overall thoughts:
-
While trame is great I see two barriers:
-
Deployment at scale
-
Local development making two copies of the data, one in server, one in wasm. That, along with lack of file access makes things prohibitive
-
-
I would love some official vtk imgui python support in the future as that has tons of interactions and ui elements to make a completely immersive experience
I would be interested in hearing other’s experiences
Regards
Joe