Edit this page

NA-MIC Project Weeks

Back to Projects List

PRISM Volume Rendering

Key Investigators

Project Description

The goal of this project is to enable the development of advanced 3D rendering techniques in Slicer. The goal is to facilitate access to GPU shaders and enable GPU-based filtering in Slicer by improving shader access multipass rendering in VTK and Slicer. The PRISM Module in Slicer will serve as a test environment for the new capabilities.

Long-term Objective

  1. Facilitate the development and debugging of GPU shaders for Slicer
  2. Extend the principles introduced in the PRISM module to surface rendering and other types of rendering
  3. Integrate GPU filters in Slicer and connect them with volume rendering in such a way that filtered volumes do not have to be transfered back to CPU memory before rendering. See work by Kyle Sunderland on VTK GPU image filters (branch here).
  4. Explore custom rendering to simplify integration with the vtk render process. Prior work includes:
    • Python scripted Actor/Mappers: https://www.slicer.org/wiki/Slicer3:Python:ScriptedActor
    • SimpleMapper: https://github.com/IbisNeuronav/Ibis/tree/master/IbisVTK/vtkExtensions

PW36 Objective

  1. Adapt the PRISMRendering module to the new Markup interface in Slicer 5.
  2. Enable opening shaders with tags in a text editor while running Slicer
    • Previous efforts by Simon Drouin were made to facilitate shader debugging by leaving tags in the shader code. Code is available in this branch.
    • In vtkShaderProgram class, debug functionality is available by setting the string variable FileNamePrefixForDebugging, which loads a shader from a file before rendering or dumps the shader to a file if doesn’t already exists. However, this functionality is private. Mappers should have public functions to enable this debugging mechanism.
  3. Generalize the mechanism that allows the VolumeRendering module to store vtkShaderProperties in the display node to obtain the same behavior with the Models module.

Progress and Next Steps

Adaption code to new Markup interface

  1. Identified documentation on changes here:
  2. The Region of Interest (ROI) of the volume was transformed to use the new Markups Module with native scaling and rotations. This also fixed some of the issues that caused the module to crash.

Generalizing vtkShaderProperties

  1. Move the management of vtkShaderProperty object from vtkMRMLVolumeRenderingDisplayNode to base class vtkMRMLDisplayNode
  2. TODO: Find out if the base class of displayable manager able to take over the assignment vtkShaderProperty to view actors to replace the work of vtkMRMLVolumeRenderingDisplayableManager?

Future of Slicer advanced rendering

A discussion between Steve Piper, Rafael Palomar, Simon Drouin and Andrey Titov has allowed to identify a few requirements for the future of rendering in VTK and Slicer:

  1. Allow for GPU preprocessing pipelines, available for volumes, geometry and textures.
  2. Allow for an arbitrary number of textures, scalar and vector fields that can easily be fed into mappers and easily accessed in shaders.
  3. An arbitrary number of transfer functions can be fed into mappers and easily accessed in shaders.

Illustrations

PRISM - Markup ROI: PRISM_Markups

PRISM - Markup ROI (rotated and scaled): PRISM_Markups_rotated

Background and References