Designing
a transfer function to effectively and efficiently visualize a dataset
is an essential part of developing a volume rendering application. The
design of the transfer function affects not only how effective the data
visualization is, but also affects the rendering performance of the
application. This section provides some tips on transfer function
design, and several examples that show how to properly create a
transfer function. The transfer function examples are represented here
with screenshots from the Fovia Workstation application, which provides
a useful transfer function development and testing platform. Example
preset XML files are also provided with theF.A.S.T. Cloud SDKdistribution.
Transfer
Function Shape
The
suggested way to begin is with a triangular or trapezoid shaped
transfer function (Figures 1-2). Next, progress towards a bell shaped
curve by adding additional ascending and descending control points
(Figures 3-6). This will add more depth to the rendered image. These
ascending and descending control points largely affect the tonal range
of the rendered image, while the bounding control points contribute
more to the overall color. Finally, make fine adjustments to the
control point positions to achieve the desired color and opacity
values. For best interactive performance, try to keep the distance
between control points along the x-axis as even as possible. (Figures
7-8).
Figure
1: A trapezoid transfer function.
Figure
2: Image result from Fig. 1.
Figure
3: A curved transfer function.
Figure
4: Image result from Fig. 3.
Figure
5: Adding additional control points for depth.
Figure
6: Image result from Fig. 5.
Figure
7: Final adjusted transfer function.
Figure
8: Image result from Fig. 7.
Avoiding
Undersampling
Rapidly
changing color (sharp color gradients in the Transfer Function) in
conjunction with high opacity may increase the probability of
undersampling artifacts and create the “zebra” pattern shown in Figures
11-12. Therefore, keeping color as uniform as possible, as well as
maintaining relatively low opacities (Figures 9-10) will reduce the
probability of undersampling artifacts.
Figure
9: Uniform color spacing.
Figure
10: Image result from Fig 9.
Figure
11: Sharp opacity gradient at point A.
Figure
12: Undersampling results in zebra pattern.
Value
Range for Skin
The
range of values for film-like tissue such as skin is considerably
smaller than ranges of values for other types of tissue and will take
up only a small portion of the scalar field within the transfer
function. Because of this small range of values, it is this tissue that
has the highest probability of being undersampled. Therefore these
tissues should be represented by transfer function ranges that are as
wide as possible within the 'skin section' of the scalar field. The
skin section is shown in the render range on the left-hand side of the
transfer functions in Figures 13 and 15. The resulting images are shown
in Figures 14 and 16. Note the reduced undersampling in Figure 14 as
compared to Figure 16.
Figure
13: Wide TF range of skin values.
Figure
14: Reduced undersampling.
Figure
15: Narrow TF range of skin values.
Figure
16: Increased undersampling.
Optimizing
a Dental Preset
Small
changes to transfer function lighting and opacity can have a
significant impact on the appearance of the dataset and rendering
efficiency. Figures 17-18 show an initial dental transfer function. A
noticeable amount of pixelation is present in the rendered image. Note
that this initial transfer function does not have lighting enabled on
any of the control points. Figures 19-22 show the reduction in
pixelation by adding lighting to control points one and two. While this
lighting improves the appearance of the image it will have a negative
impact on rendering efficiency. A further improvement in pixelation and
contrast between the teeth and jaw can be obtained instead by modifying
the opacity of control points two and three from the original transfer
function in Figure 17. This results in the best quality image and has
the additional benefit of not using control point lighting. Turning off
lighting for transfer function control points will significantly
accelerate rendering. This is because the normal gradients at the
dataset's virtual surface can be ignored. The rendering algorithm
therefore does not need to traverse the entire octree down to
individual voxels. Therefore, it is recommended to turn off lighting
for transfer function control points where not necessary.
Figure
17: Initial transfer function.
Figure
18: Noticeable pixelation in image.
Figure
19: Lighting added to control point 2.
Figure
20: Reduced image pixelation.
Figure
21: Lighting added to control point 1.
Figure
22: Further reduction in image pixelation.
Figure
23: Opacity of original control points adjusted.
Summary
Designing a transfer function to effectively and efficiently visualize a dataset is an essential part of developing a volume rendering application. The design of the transfer function affects not only how effective the data visualization is, but also affects the rendering performance of the application. This section provides some tips on transfer function design, and several examples that show how to properly create a transfer function. The transfer function examples are represented here with screenshots from the Fovia Workstation application, which provides a useful transfer function development and testing platform. Example preset XML files are also provided with the F.A.S.T. Cloud SDK distribution.
Transfer Function Shape
The suggested way to begin is with a triangular or trapezoid shaped transfer function (Figures 1-2). Next, progress towards a bell shaped curve by adding additional ascending and descending control points (Figures 3-6). This will add more depth to the rendered image. These ascending and descending control points largely affect the tonal range of the rendered image, while the bounding control points contribute more to the overall color. Finally, make fine adjustments to the control point positions to achieve the desired color and opacity values. For best interactive performance, try to keep the distance between control points along the x-axis as even as possible. (Figures 7-8).
Figure 1: A trapezoid transfer function.
Figure 2: Image result from Fig. 1.
Figure 3: A curved transfer function.
Figure 4: Image result from Fig. 3.
Figure 5: Adding additional control points for depth.
Figure 6: Image result from Fig. 5.
Figure 7: Final adjusted transfer function.
Figure 8: Image result from Fig. 7.
Avoiding Undersampling
Rapidly changing color (sharp color gradients in the Transfer Function) in conjunction with high opacity may increase the probability of undersampling artifacts and create the “zebra” pattern shown in Figures 11-12. Therefore, keeping color as uniform as possible, as well as maintaining relatively low opacities (Figures 9-10) will reduce the probability of undersampling artifacts.
Figure 9: Uniform color spacing.
Figure 10: Image result from Fig 9.
Figure 11: Sharp opacity gradient at point A.
Figure 12: Undersampling results in zebra pattern.
Value Range for Skin
The range of values for film-like tissue such as skin is considerably smaller than ranges of values for other types of tissue and will take up only a small portion of the scalar field within the transfer function. Because of this small range of values, it is this tissue that has the highest probability of being undersampled. Therefore these tissues should be represented by transfer function ranges that are as wide as possible within the 'skin section' of the scalar field. The skin section is shown in the render range on the left-hand side of the transfer functions in Figures 13 and 15. The resulting images are shown in Figures 14 and 16. Note the reduced undersampling in Figure 14 as compared to Figure 16.
Figure 13: Wide TF range of skin values.
Figure 14: Reduced undersampling.
Figure 15: Narrow TF range of skin values.
Figure 16: Increased undersampling.
Optimizing a Dental Preset
Small changes to transfer function lighting and opacity can have a significant impact on the appearance of the dataset and rendering efficiency. Figures 17-18 show an initial dental transfer function. A noticeable amount of pixelation is present in the rendered image. Note that this initial transfer function does not have lighting enabled on any of the control points. Figures 19-22 show the reduction in pixelation by adding lighting to control points one and two. While this lighting improves the appearance of the image it will have a negative impact on rendering efficiency. A further improvement in pixelation and contrast between the teeth and jaw can be obtained instead by modifying the opacity of control points two and three from the original transfer function in Figure 17. This results in the best quality image and has the additional benefit of not using control point lighting. Turning off lighting for transfer function control points will significantly accelerate rendering. This is because the normal gradients at the dataset's virtual surface can be ignored. The rendering algorithm therefore does not need to traverse the entire octree down to individual voxels. Therefore, it is recommended to turn off lighting for transfer function control points where not necessary.
Figure 17: Initial transfer function.
Figure 18: Noticeable pixelation in image.
Figure 19: Lighting added to control point 2.
Figure 20: Reduced image pixelation.
Figure 21: Lighting added to control point 1.
Figure 22: Further reduction in image pixelation.
Figure 23: Opacity of original control points adjusted.
Figure 24: Smooth image and improved contrast.