Difference between revisions of "2010 NAMIC Project week: Programmatic use of Volume Rendering module"

From NAMIC Wiki
Jump to: navigation, search
(Created page with '__NOTOC__ <gallery> Image:PW-MIT2010.png|Projects List Image:genuFAp.jpg|Scatter plot of the original FA data through the genu of the corpus…')
 
Line 17: Line 17:
 
A number of modules in Slicer use volume rendering. However, none of them is using this functionality from Volume Rendering module in Slicer.
 
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 develop a set of guidelines and recommendations for incorporating volume rendering into Slicer GUI modules, and convert some of the existing modules to use this functionality instead of directly accessing VTK to set up volume rendering.
+
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
  
 
</div>
 
</div>
Line 25: Line 28:
 
<h3>Approach, Plan</h3>
 
<h3>Approach, Plan</h3>
  
This is where we start ...
+
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.
 +
 
 +
</div>
 +
 
 +
<div style="width: 40%; float: left;">
 +
 
 +
<h3>Progress</h3>
 +
 
 +
 
 +
</div>
 +
</div>
 +
 
 +
<div style="width: 97%; float: left;">
 +
 
 +
<h3>Delivery</h3>
 +
 
 +
The following Tcl code provides the guidelines for implementation:
 +
 
 
<pre>
 
<pre>
 +
 +
# Initialization
 +
 
set scene $::slicer3::MRMLScene
 
set scene $::slicer3::MRMLScene
  
Line 41: Line 71:
  
 
$scene AddNode $scenario
 
$scene AddNode $scenario
</pre>
 
  
 +
# on/off
 +
set vtGUI $::slicer3::VolumeRenderingGUI
 +
set vrLogic [$vrGUI GetLogic]
  
</div>
+
$vrLogic SetVolumeVisibility 0
  
<div style="width: 40%; float: left;">
+
# initialize opacity mapping
  
<h3>Progress</h3>
+
# initialize color mapping
  
Complete success of this project is near!
+
# switch between rendering technique
  
</div>
+
# detect the available rendering techniques
</div>
 
  
<div style="width: 97%; float: left;">
+
</pre>
  
 
==Delivery Mechanism==
 
==Delivery Mechanism==

Revision as of 20:04, 16 June 2010

Home < 2010 NAMIC Project week: Programmatic use of Volume Rendering module

Key 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

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

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

Delivery Mechanism

This work will be delivered to the NA-MIC Kit as a (please select the appropriate options by noting YES against them below)

  1. ITK Module
  2. Slicer Module
    1. Built-in
    2. Extension -- commandline
    3. Extension -- loadable
  3. Other (Please specify)

References