tinySceneGraph Home Images Features



MRT scan of lower torso

Volume transfer function setup with Dirac editor



Friends of tinySG,

having received some interesting X-ray computed tomography (CT) datasets recently increased motivation to tweak tinySG's viewing and editing capabilities for volume datasets. A bunch of new gui elements in csgEdit allow to easily setup a transfer function that basically looks like a Dirac pulse. By panning this pulse over the range of possible voxel values, the transfer function only honors voxels being in the range of the pulse. This enables the user to identify interesting areas quickly.

The interface allows to adjust position and width of the pulse in the parameter domain, as well as to control the color and transparency value created by the transfer function. Once a feature is located, pleasantly colorised and highlighted, the pulse can be copied over into the generic transfer function and the search for other areas can start over. This way, a pulsed transfer function can be created. The image to the right shows a combination of four colored pulses, applied to a CT scan.

The LUT editor has evolved from widget being part of the node property editor into a dockable and realizable window. This way, the widget can be enlarged, making adjustments with the mouse much easier.

The three images below show the effect of moving the center of a pulse to a different location, as shown in the docked LUT editor below the main render area. All screenshots are created from the same MRT dataset (click on image to enlarge).

Undetermined tissue Kidneys Aorta
MRT dataset, pulse at center=24 with range=4. Same dataset, pulse at center=106 with range=6. Same dataset, pulse at center=162 with range=22.

Naturally, each update to the transfer function immediately shows up in the 3D scene viewer. This allows to fly though the volume in real time, inspecting a given setup from different perspectives. Combined with a stereoscopic display, guts become particularly bloody when hovering over the carpet in front of your 3D television set...


Dataset preparation

Although tinySG can utilise libDevIL to load Dicom files, results of this approach tend to be poor. A much more powerful library for reading Dicom files is Gdcm, which implements part 5 of the dicom standard, focusing on the image file format.

The library is easy to build and use, at least on Linux. For now, tinySG uses a small converter application, translating Dicom files into ppm-images. This step looses precision and some data, but is suitable to quickly import images into a 3D texture for rendering with tinySG. Building such a converter on top of Gdcm takes less than 60 lines of code.

old volume new volume with adv. transfer function Anaglyphic Kidneys
Image created from MRT scan with an early version of tinySG. New rendering of the same dataset, using an advanced transfer function. Kidneys and Aorta become clearly visible. Anaglyph rendering. Best viewed fullscreen, use red/cyan glasses, keep some distance, approx 80cm, from your screen.



Performance

Video volume rendering Volume rendering is an almost ideal playground for high end graphics cards. It requires powerful texture units and enormous memory bandwidth and compute power when activating advanced render techniques like ray casting.

Stay tuned for some performance charts to appear at this location. For now, just click the image on the right to see a video (mp4, 320x200@30) showing realtime performance on a FirePro W8000. Unfortunately, many video players seem to have issues with this format - vlc is known to work.


Outlook

While implementing the code behind this pages imagery, the todo list for tinySG grew longer and longer:
  • It would be interesting to extract polygonal data from a volume, allowing for faster rendering or feature extraction/recombination. One appealing approach would be to start a GPU marching cube implementation, either using OpenCL or the new OpenGL compute shaders.
  • Another well needed feature is to edit the real volume data, allowing to remove unwanted data, like from scan tables.
  • Having an option to focus on a sub-volume would be another nice-to-have.
  • Finally, tinySG's texture implementation still supports only 8bit data. Using 10bit or even float formats avoids loosing precision of CT data. The original data in all images on this page has 12bit depth, so the rendering with 8bit luminance 3D textures unfortunately lost 1/3 of all the details.

Look inside lungs CT skeleton
CT scan, 512x512x64. View inside the lungs from the top. Click on image to enlarge. Skeleton extracted from same CT scan. Click on image to enlarge.

Keep rendering,
Christian



Acknowledgements and links:

  • The X-ray computed tomography dataset is by courtesy of Klinikum rechts der Isar in Munich.
  • The magnet resonance checkup scan has been kindly provided by the University of Hannover, Germany.
  • The early introduction to tinySG volume rendering is here.
  • Cudo's to the creators of the Gdcm Dicom image library. It is by far the best free (Berkeley-style license) Dicom image loader implementation I'm aware of.
  • Wikipedia provides extended information on the anatomic background of the images on this page.



Copyright by Christian Marten, 2009-2014
Last change: 21.04.2013