Difference between revisions of "2010 NAMIC Project week: Programmatic use of Volume Rendering module"
From NAMIC Wiki
Line 19: | Line 19: | ||
* confirm that all the needed functionality available from volume rendering GUI is available from Tcl/C++ interfaces | * confirm that all the needed functionality available from volume rendering GUI is available from Tcl/C++ interfaces | ||
* convert the existing modules that use VTK volume rendering to use the volume rendering module functionality | * convert the existing modules that use VTK volume rendering to use the volume rendering module functionality | ||
+ | |||
+ | Questions to study: | ||
+ | * difference in performance and appearance between rendering label maps and greyscale images | ||
+ | * GPU/CPU switch while using pure VTK volume rendering | ||
</div> | </div> |
Revision as of 21:30, 16 June 2010
Home < 2010 NAMIC Project week: Programmatic use of Volume Rendering moduleKey Investigators
- BWH: Andriy Fedorov
- NCI: Yanling Liu
- Isomics: Alex Yarmarkovich
Objective
A number of modules in Slicer use volume rendering. However, none of them is using this functionality from Volume Rendering module in Slicer.
The objective of this project is to:
- provide example code (Tcl and/or C++) that allows to use volume rendering programmatically
- confirm that all the needed functionality available from volume rendering GUI is available from Tcl/C++ interfaces
- convert the existing modules that use VTK volume rendering to use the volume rendering module functionality
Questions to study:
- difference in performance and appearance between rendering label maps and greyscale images
- GPU/CPU switch while using pure VTK volume rendering
Approach, Plan
We will go through the basic functionality needed to add volume rendering to the code:
- create volume rendering scene
- visibility on/off
- initialization of the opacity and color transfer maps
- switching between the volume rendering techniques and automatic identification of the techniques available on a given machine
Our hope is that by the end of the week this page will be self-contained for adding volume rendering to any GUI Slicer module.
Progress
Delivery Mechanism
The following Tcl code provides the guidelines for implementation:
# Initialization set scene $::slicer3::MRMLScene set scenario [vtkMRMLVolumeRenderingScenarioNode New] set property [vtkMRMLVolumePropertyNode New] set parameters [vtkMRMLVolumeRenderingParametersNode New] $scene AddNode $property $scene AddNode $parameters $parameters SetAndObserveVolumeNodeID "vtkMRMLScalarVolumeNode1" $parameters SetAndObserveVolumePropertyNodeID [$property GetID] $scenario SetParametersNodeID [$parameters GetID] $scene AddNode $scenario # on/off set vtGUI $::slicer3::VolumeRenderingGUI set vrLogic [$vrGUI GetLogic] $vrLogic SetVolumeVisibility 0 # initialize opacity mapping # initialize color mapping # switch between rendering technique # detect the available rendering techniques