Volume Rendering with LightningChart

arction
by Alexey Tukalo

Introduction

LightningChart offers VolumeModel tool for volume data visualization via Direct Volume Rendering. VolumeModel takes the volume data inside, and visualize it. Our volume rendering engine is based on the Volume Ray Casting.

An image is produced by the algorithm via the volume data sampling along the tracks of the rays which travel inside the data-set. A simple realization of hardware acceleration for Volume Ray Casting requires the generation of boundaries for a volume object. Usually, they are represented by a cube. High rendering quality with the lack of artifacts, and usage of the interchangeable ray function are the main advantages of this technology.

Ray Function is the core of the algorithm, and provides it with a very high level of flexibility. The technique is very powerful because it specifies the way how the data is sampled and combined. This makes it a very useful tool for a feature extraction.

Loading of data

There are several ways how the data can be imported to the VolumeModel:

  • Data can be supplied to the Data property as a collection of images which represent slices of the dataset
  • Data can be supplied directly to the constructor of the VolumeModel in various ways
  • Data can be supplied to the VolumeModel via one of the load functions

Load functions and constructors allow to supply data as a collection of slices (same as Data property do) or as a string with a path to the folder with the slices (as .Net supported image extension). The data can also be provided as a texture map created by our tool. The texture map consists of slices, and its supplement also needs an additional information about the number of slices on the picture. This is required for an efficient usage of GPU input buffers. The texture map can be created by ChartTools.CreateMap function. Direct input of texture map is used to speed up the start of an application for a very big datasheet.

Properties

VolumeModel possesses the typical properties of a 3D object in LightningChart, like Visible, Rotation, Size, Position, MouseInteraction, and MouseHighLight. In addition, the object also has very specific properties, which define how Volume Rendering engine handles it.
volumermodel-properties
Figure 1. Object property tree

Ray Function

It allows choosing one of the three ways of voxel sampling and composition available in LightningChart Volume Rendering Engine:
Accumulation Ray Function collects and combines as much data as possible. The visualization which is produced by this technique looks like a semi-transparent gel. Figure 2. shows an example of Accumulation Ray Function application, visualizing a medical dataset.
Example of a medical application for the Accumulation Ray Function
Figure 2. Example of a medical application for the Accumulation Ray Function
Maximum Intensity Ray Function takes into account only the brightest value sampled by the ray. Visually it provides a very similar result to X-ray images. It allows to get an additional information about the internal structure of the object. Figure 3. shows an example of Maximum Intensity Ray Function application of ultrasound waves interference simulation.
Examples of a Maximum Intensity Ray Function application
Figure 3. Examples of a Maximum Intensity Ray Function application
Examples of a Maximum Intensity Ray Function application
Isosurface Ray Function draws the model surface in a way that it looks like a polygonal model rendering. The result is very similar to those produced by Indirect Volume Rendering. Figure 4. shows an example of Isosurface Ray Function application for the visualization of water flow simulation.
Examples of a Maximum Intensity Ray Function application
Figure 4. Examples of an Isosurface Ray Function application
Figure 4. Examples of an Isosurface Ray Function application

Threshold

The Volume Rendering Engine is able to apply a threshold range by the property to the VolumeModel. There is a separate boundary for every colour channel. The voxel is visualized only if it is lower than the high boundary, and higher than the low at all the channels. Acceptable areas are invisible. This property is not taken into consideration by the mouse hit test.
Examples of a Maximum Intensity Ray Function application
Figure 5. Example of two different threshold settings
Figure 4. Examples of an Isosurface Ray Function application

Slice Range

The Volume Rendering Engine is able to apply a threshold range by the property to the VolumeModel. There is a separate boundary for every color channel. The voxel is visualized only if it is lower than the high boundary, and higher than the low at all the channels. Acceptable areas are invisible. This property is not taken into consideration by the mouse hit test.
Example of Accumulation Ray Function and SliceRange modification
Figure 6. Example of Accumulation Ray Function and SliceRange modification

Sampling Rate Options

Sampling Rate is very important to the final image quality. It defines how often the volume dataset is sampled along the ray’s track. Higher sampling rate produces better quality but requires more powerful hardware. Sampling Rate significantly influences the Accumulation Ray Function. Artefacts produced by the low sampling rate are less noticeable when using Maximal Intensity function. Isosurface Ray Function can be too sharp at a very high sampling rate. Usually, the sweet spot equals the number of voxels on the side which is placed along the ray tracks.

SamplingRateOptions contains several options for Sampling Rate Manager. SamplingRateManager is needed to reach the optimal balance between quality and frame rate for a particular hardware. The usage of sampling rate manager has to be turned on by the property Enabled, otherwise, the ManualSamplingRate value would be used. SamplingRateRange defines the boundaries for Sampling Rate Manager. Inertness specifies how rapid are the changes of sampling rate in case of performance changes. TargetFPS is an aim, which should be achieved by sampling rate manager if it is possible.

Example of low sampling rate: 32
Figure 7. Example of low sampling rate: 32(left), 64(right)
Example of low sampling rate: 64

Smoothness

It prevents too high detalization of the surface. The factor makes the surface smoother, and reduces some noise and other artifacts.
Example of too high sampling rate, fixed by smoothness property
Figure 8. Example of too high sampling rate, fixed by smoothness property

EmptySpaceSkipping

Defines a resolution of empty space, skipping sampling. A low value (16-32) of EmptySpaceSkipping improves the performance but can cause artifacts in the model edges.
Example of too low EmptySpaceSkipping property value
Figure 9. Example of too low EmptySpaceSkipping property value

Opacity

Specifies an Accumulation Ray Function behavior. Low opacity makes an object more transparent.
Example of Accumulation Ray Function Opacity modification: 15%(left), 45(right)
Figure 10. Example of Accumulation Ray Function Opacity modification: 15%(left), 45(right)

Brightness and Darkness

The properties define the image’s transfer function. Every change has its own transfer function. It is represented by the linear function: output=Brigthness*input-Darkness