Assignment  2. Due date: 4:30pm April 14, 2009 (after-class demo)

In this assignment you will implement a volume renderer that does full volume rendering. It will render both orthographic and perspective views of volumetric datasets on cubic grids along any arbitrary direction.

Full Volume Rendering Using VTK

Optional {You can use VTK library for this implementation. An interactive window for changing transfer functions should be provided. 

You will need 4 transfer functions, one for each red, green, blue, and alpha (or HSV and alpha). For this purpose, use the extern global 4-element array transFunctArr of type TransferFunction (this array can be declared in TransferFunctionEditor.cpp). It will hold the red, green, blue, and alpha transfer functions for your voume renderer.

Each transfer function will be drawn in a different color. You can set these colors in the extern array of floats, trans-FuncDrawColor[4][3]. This array is also declared in TransFunc.cpp. It would probably make most sense if you set the first triple (the one for red) to {1.0, 0.0, 0.0}, and the one for green, blue, and alpha (or HSValpha) to {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0} and {1.0, 1.0, 1.0}, respectively. Do this once when the program comes up. There are two more extern variables: transFuncMax and transFuncSelected. The former is set to 4 when you do volume rendering. It tells the TransferFunctionEditor what transfer function is to be edited. You should be able to edit the proper transfer function depending on what was selected in the ‘Transfer Function’ menu. All 4 transfer functions should be displayed in the same window, along with the histogram, but you should only be able to edit the selected one.

In the full volume rendering modes you will be rendering color images. Pre-allocate 3 · 512 · 512 bytes for curImage.data, and store the image as RGB triples (the largest images that could occur if your image window is 512·512 pixels).}

Now implement the renderer step-by-step in this recommended sequence (verify each step before you move on). Implement compositing using the RGBA lookups into the transfer function; implement ambient lighting (use Ia and ka); add diffuse shading with the ambient term turned off - in the beginning, just use nearest neighbor interpolation to get the sample points required for gradient estimation; add specular shading - you should get a nice white highlight on the solidCube, play with the ns coefficient to control the size of the highlight (you may need values around 1000 to get something reasonable, you can use the normalized ray direction vector as the eye vector) now use the trilinear filter to get the gradient sample values - the images will look probably better.

In some sense, e.g., a special case of full volume rendering. To just get an isosurface, set the alpha transfer function to a step function. To get a nice composite display with semi-transparencies, first find the iso-surfaces of the different structures/objects in the volume you want to display, then lower the opacities for the outermost surfaces and manipulate their colors. One strategy is to find the innermost iso-surface first and render it fully opaque, then add structures closer to the eye with lower opacities and different colors. It’s a bit of a trial and error process - do it on small images first with cheap nearest-neighbor interpolation and maybe coarse images and ray step sizes. Then when you like what you see, magnify and render at high quality with better interpolation functions.

Requirements:

    a. Loading the SLC volume.

    b. Implement full volume rendering with some interactions such as rotation, scaling ....

    c. Provide an interactive window allowing users to change transfer functions linearly.

    d. Measuring the rendering speed by outputting the frame rate per second.

 

Data: 6870/vm_foot.rar

 

Tip: Start to work on this assignment as early as possible. Good luck!

You have to submit a zipped package containing your source code and a self-contained executable file to csc5870@cs.wayne.edu by the deadline. Please include all the necessary source code (do not include "debug" or "release" directory but do not forget "res" directory if you are using VC++), and a simple "Readme.txt" file explaining how to compile and run your code properly. We will check and compile your code, then give you an evaluation.