Volume transfer function setup with Dirac editorFriends 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).
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 preparationAlthough 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.
PerformanceVolume 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.
OutlookWhile implementing the code behind this pages imagery, the todo list for tinySG grew longer and longer:
Keep rendering, Acknowledgements and links:
Copyright by Christian Marten, 2009-2014 Last change: 21.04.2013 |