Example 5: Volume rendering and interactions
Introduction
In this example we like to convert a scan of a head into a 3D scene-object. The scene-object allows to add some textures, interactions and animations.
Steps to do
Develop your network
Implement the following network and open the image $(DemoDataPath)/BrainMultiModal/ProbandT1.tif.
The module SoGVRVolumeRenderer
allows volume rendering of 3D and 4D images.
Change LUT
We like to add a surface color to the head. In order to do that, we add the module SoLUTEditor
, which adds an RGBA Look up table (LUT) to the scene. Connecting this module to SoExaminerViewer
left to the connection between SoGVRRenderer
and SoExaminerViewer
(remember the order in which Open Inventor modules are executed) allows you to set the surface color of the head.
To change the color, open the panel of SoLUTEditor
. In this editor we can change color and transparency interactively (for more information take a look at the
help page
). Here, we have a range from black to white and from complete transparency to full opacity.
We now like to add color. New color-points can be added by clicking on the color bar at the bottom side of the graph and existing points can be moved by dragging. You can change the color of each point under Color.
Interactions
As a next step, we add some dynamics to the 3D scene: We like to rotate the head. In Order to do this, add the modules SoRotationXYZ
and SoElapsedTime
to the workspace and connect the modules as shown.
Open the panels of both modules and select the axis the image should rotate around. In this case the z-axis was selected. Now, build a parameter connection from the parameter Time out of the module SoElapsedTime
to the parameter Angle of the module SoRotationXYZ
. The angle changes with time and the head starts turning.
Exercises
- Change rotation speed
- change rotation angle
- Pause rotation on pressing SPACE
Summary
- The module
SoGVRVolumeRenderer
renders paged images like DICOM files in a GVR. - Lookup Tables (LUT) allow you to modify the color of your renderings