|
CS 6630 Scientific Visualization: Volume Rendering
CS 6630 Project 4 James Angel, 11/13/03 angel@cs.utah.edu
Part One - Transfer Functions
vr.tcl - This script uses VTK's built in volume rendering class to apply a statically defined transfer function to one of three data sets (selected by removing comment markers), the visible human male head from project 3, the mummy, and the visible human female feet. As with isosurfacing, the features I have tried to pull out are the subjects skin and bone. Targeting voxels with those values found in project 3, 25.0 for flesh and 75.0 for bone, produced the results shown at the top of this report. vtkPiecewiseFunction opacityTransferFunction With these calls we define the transfer function which yields the above results. First opacity at data value 20.0 is set to 0% (completely transparent) and to 20% at the maximum data value of 255. This makes it so that the denser the material in the data set, the more opaque that voxel is made in the rendering. No voxel is made more than 20% opaque, however, regardlesss of how dense it is. The second set of commands assign an off-white color to voxels
with a data value of 25 (skin) and bright white to voxels with a data
value of 75 (bone.)
Visible Human Male Head Data
At left we have a treatment of the visible human male data set employing isosurfacing (created for project 3; the center image was produced by the vr.tcl script described in above; the last image was produced using mip.tcl, described in the next section. The above images provide us with a good example of how direct isosurfacing and volume rendering produce dramatically different results, even when the same data values are targeted, as is the case here. Isosurfacing produces crisp and clear results. The geometry of each surface (bone and skin) is very easy to see. This crispness is lost with volume rendering. Nevertheless, the results appear richer, smoother, and more visually compelling. I would like to have the image produced through isosurfacing were I a surgeon trying to determine where the skull could most easily be penetrated. If I want to see where the flesh of the head around the skull is thickest and how it hangs on the bone, the volume rendered image is what I would prefer to look at. So really there is no "winner." Both methods have their advatages over the other, as well as their shortcomings. It should be noted that here the isosurfacing result employs
shading while the volume rendered result does not. It is
possible to shade volume rendered surfaces using density
gradient for surface normals. This produces a result that has
much of the crispness of isosurfacing with the richness of
volume rendering. Please see my
research
page for images produced using this technique and links to the
Simian volume rendering project.
mip.tcl - This script is based in great
part on code taken from VolMIP.tcl. The script makes use of the
vtkVolumeRayCastMIPFunction module to produce a MIP from a .vtk data
file.
MIP images show finer detail more clearly than do
volume-rendered images. The main disadvantage is voxels nearer
the camera have no more influence upon the coloring of a given
pixel than do those farther from the camera, so there is little
sense of depth. Please refer to the script itself to see what parameters were
set and what specific modules I employed. Below I discuss
tweaking interpolation method (linear interpolation vs. none, a.k.a.
nearest neighbor) sample distance, and dataset resolution.
Sample Distance Spacing
MIPs of the mummy data set with sample spacing of 0.125,0.25, 0.5, 1.0, 2.0 and 4.0 Adjusting the spacing between sample points along the rays
cast through the volume did not produce the dramatically
differest results I had expected. The quality of the image
produced did not degrade significantly for sample distances of
up to 2.0. At 4.0, the resulting image is clearly
degraded. (Notice the eye socket - a pretty clear feature -
becomes quite blurred.) Going any finer than 0.5 appeared to have little effect. The
example program VolMIP.tcl set sample distance to 0.25. I
believe at this spacing there is certainly little more to be
gained by sampling any finer. It should be noted that rendering
time increased dramatically with finer sampling.
Interpolation Type
MIPS using linear interpolation (left) and nearest neighbor (right) VTK allows for two different methods of interpolation (more
accurately, you can use linear interpolation or you can just use
nearest neighbor.) Nearest neighbor uses the nearest data value
while interpolation uses a weighted average of the values at the eight corners of
the cube in which the sample point lies. The results above show linear interpolation
produces much smoother and more attractive results.
Dataset Resolution
Linear-interpolation MIP images produced using data sets 50, 80, and 128 in each dimension
Nearest-neighbor MIP images produced using data sets 50, 80, and 128 in each dimension There is one sure-fire way to improve the quality of your
renderings, namely, to increase the resolution of the data set
you use. Below are the results of isosurfacing the mummy and
feet data sets using 50, 64, and 128-samples a side data sets.
Clearly the higher the sample rate the more clear and compelling
the result. Notice fairly coarse features like the teeth and
jaw are almost lost in the the image at left. Results will
continue to improve until the density of data is
such that the width of sample space is several times that of the
image produced. The data sets provided for this assignment come
no where near that point. Degradation is even more marked when no interpolation is used.
|