I created this video by screen recording on the 3D-Slicer platform. It features an animation of a VTK object and a NIFTI file (MRI image). I’m looking for advice on how to generate similar high-quality videos automatically using Python code, including managing opacity, titles, rotations etc. (and any other tips to improve the visuals would be appreciated).
Also, I’m seeking a freelancer to help automate the video creation process using VTK/SimpleITK tools, so feel free to reach out if interested.
You can create videos using Python scripting in 3D Slicer’s Python environment. Slicer does not take anything away from VTK (you can still access all underlying VTK classes if you want to manipulate anything at the lowest level), but Slicer just adds a thin wrapping layer on top of VTK and other essential medical image computing libraries. This thin layer sets up defaults for medical applications, provide a simpler API, implement essential features, such as complex DICOM import, saving and loading the entire scene, … and an interactive GUI. The interactive GUI is very important, because often visualization parameters are so complex (such as volume rendering transfer functions) that is is very inefficient, or even practically impossible to optimize them just by modifying and rerunning a Python script or using generic solutions like sliders in Jupyter notebooks. If you don’t need the GUI (for example, to automatically generate visualizations with pre-determined parameters) then you can run all Python scripts in Slicer environment from the command line, without a GUI.
You can use segmentation-colorized volume rendering, which is a new volume rendering technique that we developed with @LucasGandel for rich visualization of AI segmentation results, by combining colorization of grayscale image, color image raycasting, and volumetric screen-space ambient occlusion.
The advantage of this method is that it can visualize information obtained by AI image segmentation, while preserving details in the original image. The result is similar to those generated by photorealistic rendering techniques, but at a tiny fraction of their computation cost (and so our technique provides interactive frames rates on any laptop). Compared to this technique, classic techniques, such as volume raycasting or surface rendering look extremely poor.
= original volume + AI segmentation results + screen-space ambient occlusion. See some examples here:
If you want to try this, install the Sandbox extension in 3D Slicer and use the Colorize volume module.