How to save the 3D medical image reconstructed by the volume drawing algorithm as a PLY file to the local computer
Direct volume rendering using raycasting is a display technique and you cannot store its result in a surface mesh (.ply file). See more detailed discussion of this topic on the Slicer forum:
Thank you very much for your answer. Can I ask one more question? If I want the rendering results to be displayed on a web page, is there a suitable way?
Yes, there are many ways to use VTK’s volume renderer in a web browser:
- trame
- vtk.js
- run your current desktop VTK code in a docker container; view it in the web browser using novnc (for example, run this command to run the VTK-based 3D Slicer application in your web browser at the URL http://127.0.0.1:8080/:
docker run -d -p 8080:8080 --name slicer stevepieper/slicer:5.0.3
)
I’m a noob and thank you very much for your answer. My Volume Rendering is programmed in C++, the web system is written in Java and Js. I want to display the Volume Rendering results on the web page, can it be implemented through network transmission? If not, which way is appropriate?
If you don’t want to touch the C++ code then the first and third option (trame and docker+novnc) should work. The only non-trivial part is that you need to set up a reverse proxy server that launches a new server (docker container or trame server) for each client and makes each client communicate with its own server.
Thanks, I’ll give it a try.
Hello, Can I use vtkWindowToImageFilter to get a series of volume drawing rendered images and Transfer these pictures to the front-end to generate a 3D model?
Yes, absolutely, this works. Fortunately, you don’t even need to implement this, because this is exactly what Trame does when you use it in remote rendering mode.
But my code is written in C++, and I learned a bit about trame, which uses python. Does trame support C++?
Yes, it works for C++ classes, too. You can expose any vtkRenderWindow in the web browser using vtkRemoteView. This is how ParaView (implemented in C++) is made available via Trame using remote rendering. You only need a few small Python files to describe your view layout and if you want to use any web widgets.
Thank you very much for your answer! I will try it.
Hello, long time no see.
I now use the vtk server, using the remoteview method to display the volume drawing results on the web page, but I found that the only pictures presented on the web page are pictures. I now have a question: I want to achieve cutting through interaction with the web page, how should I do it? On the back end, I used boxwidget2 to implement cutting,
but when I rendered the web page with remote rendering, there was no box surrounding the image, which confused me.