A tale of 2.5 UIs

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:

  1. 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

    1. 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

    2. 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

  2. Lastly, knowing about imgui from a colleague through polyscope usage, i tried imgui and vtk.

    1. I tried jspanchu vtk imgui injector and tried to port it to python but that didnt work due to vtk gl issues

    2. 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:

  1. While trame is great I see two barriers:

    1. Deployment at scale

    2. Local development making two copies of the data, one in server, one in wasm. That, along with lack of file access makes things prohibitive

  2. 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

Thanks Joe to take the time reporting your experiments.

For deployment at scale, we are working on web portal leveraging kubernetes to run any trame application that you may want to expose and/or use along with user access control built-in.

For trame local access, it is actually pretty easy to do it with tauri (which you didn’t want to use). You can see an example here even if we used a web ui for local file browsing to allow HPC distributed execution. But the file browsing (to save file) using tauri is done here.

For local/desktop setup, I would argue that you don’t need to use WASM and therefore skip the data duplication you are mentioning.

Hi @Sebastien_Jourdain Thanks for the feedback! It’s great to hear that you are all thinking about deploying trame at scale. Tauri, while promising, introduces another bit of complexity into the stack. How would one avoid wasm locally and use desktop vtk rendering?

My experience with trame was quite good. Experience w imgui with good too

Thanks

Joe

I would use “remote rendering” with trame-rca or trame-vtk depending on your speed needs.

1 Like