Visualization (M.Sc. Computational Science) Assignment 2

Part I: Scalar Field Visualization

In this part of the assignment, you will write vtk code to read in data files from disk and visualize them using isosurfaces and volume rendering. For convenience, we will use the .vtk format for storing files, as these are the easiest to read in.

Here is an archive of data files have been converted to .vtk format for you:

Dataset Description Source
fuel.vtk A simulation of a fuel injection jet. www.volvis.org
hydrogen.vtk A simulation of two hydrogen atoms. www.volvis.org
3dhead.vtk The UNC head dataset (a CT ? scan). UNC-CH
carotid.vtk MRI (?) scan of the carotid arteries. www.vtk.org
ironProt.vtk A simulation of electrostatic potential in an iron-related protein. www.volvis.org
tomato.vtk A CT scan of a tomato. The Whole Frog Project
Engine.vtk A dataset of an engine block. www.volvis.org
Trilin.vtk A trilinearly interpolated dataset (to be added).
For each dataset, you should do the following:
  1. Read in the dataset with vtkStructuredPointsReader.
  2. Render isosurfaces with vtkContourFilter.
  3. Choose isovalue(s) for your isosurface(s) that you think illustrate the interesting features of the data.
  4. Save the image, using xview or a similar tool to capture the image
  5. In your handin, include a document in Word, HTML or PDF format in which you explain why you chose the isovalue parameters that you did for each dataset.
  6. Similarly, design a transfer function for volume rendering that highlights the interesting features of the data, render, save the image, and include an explanation of the transfer function and why you chose it.
Since you will be working with multiple datasets, you will probably find it convenient to be able to specify both the dataset and your visualization parameters on the command-line, rather than hard-coding them and recompiling.
For convenience, here is some sample Tcl code for volume rendering. To convert this to C++ is fairly straightforward: you will need to add vtkVolumeRendering to your CMakeLists.txt, and you will also need to make sure that all of your objects are created with New().
Notice how difficult it is to work this way, by respecifying parameters every time you run. Obviously, one would prefer to have a GUI (graphic user interface) with widgets controlling the isovalue &/or transfer function. Unfortunately, the mechanisms for doing this in C++ using vtk are extremely awkward. The mechanisms for doing so in Tcl are rather easier, but Tcl support was not installed on the lab machines.

Part II: Automation / User Control

In addition, once you have built up some experience working with these datasets, include in your handin document the following:
  1. A brief description (1-2 paragraphs) on how you might automatically choose isosurfaces &/or design a transfer function for these datasets.
  2. A brief description (1-2 paragraphs) of your ideal GUI for this task, accompanied by a sketch of what the GUI would look like.

Part III: Vector Field Visualization

In this part of the assignment, you will write vtk code to visualize a simple flow field - office.vtk taken from the vtk textbook.
Visualize this data at least twice - once with glyphs and once with at least 20 streamlines (for which you may find vtkLineSource useful). You will find tcl examples on the vtk documentation website which may be useful. Hand in one image with glyphs and one with your streamlines, and explain what they tell you about the flow field in question.

Due Date: May 31, 2006, 5:00 pm