Remote Rendering to a python desktop gui application with vtk as a server


I have been able to do web-based remote rendering with vtk, vtk.web and wslink on the server side and vtk.js/paraview web on the client side.

I want to be able to desktop based remote rendering with the exact same tech stack on the server side and instead of the web, a simple desktop application.

As per my understanding, wslink has only a server side python api. The client side api is in js or cpp.

So, basically I wanted to know how to replace the RemoteRenderer or ImageStream component to make it desktop based rendering.

Any help on this is apprecitated.

We use vnc server with novnc web client to make 3D Slicer available in web browsers and fully interactive VTK renderer in Jupyter notebooks.

You can give it a try here.

We have a few docker images that sets this up without Jupyter, with/without GPU support, etc. If you are interested in the details you can ask on the Slicer Forum.

ImageStream in vtk.js is just subscribing to a wslink topic which receive jpg images that get pushed by the server. Therefore, if you want to implement it within a desktop app, you just need to display those images that you are getting via wslink.

Oh ok thanks @Sebastien_Jourdain i’ll try this out.

Understood. But that is not what I’m looking at. But anyway thanks for taking out the time to reply.

1 Like

Hi Sebastien.

I understood as to what you’re saying. But, I’m having trouble implementing it. But, I think I’m close to it. I understand, wslink has a publish and subscribe mechanism based on wamp. And you ask me to display the images that are coming just like in vtkImageStream. I just want to have the python server and python client, I don’t want the js client at all. How do I do the on the client side in python. And which’…’) should I call? This is what I tried.
Say my main class(WebCone) on server side is the usual pipeline with vtk, vtk.web protocols and wslink. With registering mousehandler, viewport and overidding vtkimagedelivery like in the vuevtkjs templates.
And on the client side, I have a simple websocket connection, then I am creating an object of WebCone like,
cone = WebCone()
cone.getRegisteredProtocols[-1] #this gives me the overidden vtkImageDelivery
cone.getRenderedStaleImage(#i’m not sure what view id to pass here)

I am stuck here and any help is appreciated.

Just a small correction. We are not using WAMP as it is only text base while with wslink we support binary messages but in general the concept is the same.

For the remaining of your question, it starts to get involved and it might be tricky to provide solution via discourse. But the subscription/callback would be something like that.

Ok thanks. That will be helpful.