Home » Lab 2

Assignment 2 – Volume visualization

Requirements to pass: Present a working solution to one of the lab assistants (Johan or Anders) during the lab session or at the next lab session (deadline). You don’t have to hand in the source code.

Please download the zip file, which contains what you need for this lab. Please use this one for VTK6.

Part 1 – Visualization of CT data with MPR

In this assignment you will visualize a CT-scan of the abdominal region of a human. You will also visualize a pre-segmented “mask” that shows where in the volume the liver is located. You shall create a small application that can be used to compare the mask with the original volume. Such an application could for example be used by a physician to verify that the mask, which might have been generated with an automatic segmentation algorithm, is correct. The CT dataset is available here. The CT scan is stored as a vtkStructuredPoints dataset of signed 16-bit data (short) representing Hounsfield units. The segmented liver can be found here. It is represented as a binary 8-bit (unsigned char) volume where the liver voxels have the value 255 and the background voxels have the value 0. A Python script to start from can be found here.

Part 1 – Task
  • Display the segmented liver mask as a solid surface. Which isovalue do you choose? Is it a good segmentation?
  • Display the CT-scan with multi planar reformatting (MPR). Three axes oriented planes are OK. I recommend you to use vtkImagePlaneWidget that provide means to browse and rotate the plane, change contrast, and to probe the data.
  • Probe the image with the mouse cursor and examine the density values of bone, air, and soft tissue.
  • Provide a keyboard interface to switch on/off the rendering of the segmented liver (can be controlled with the actor).

Part 2 – Volume rendering

In this part you should investigate the volume rendering capabilities of VTK. You can use the CT dataset from the first part above if you want, but you do not have to. The aim is to create a visualization that displays several structures in a volume by using transparency and different colors. For the CT scan this could be for example skin, bone, and fat.

Volumes are represented by a specialized actor, vtkVolume. The volume needs a vtkVolumeProperty that have transfer functions for color and opacity and also controls the interpolation scheme and shading. The volume also needs a vtkVolumeRayCastMapper that specifies which vtkVolumeRayCastFunction that should be used. A simple example of raycasting in vtk can be found here. To get started, I suggest you to extend your code from Part 1 and add a maximum intensity projection (MIP) with vtkVolumeRayCastMIPFunction or an isosurface by using thevtkVolumeRayCastIsosurfaceFunction. Then you can look into the more complexvtkVolumeRayCastCompositeFunction.

Part 2 – Task
  • Perform volume rendering of one of the three datasets below. The rendering should make use of both color and opacity transfer functions in order to display different tissues at the same time. Note that you can use both intensity (density) and gradient magnitude as argument to the transfer functions.
  • Create a simple keyboard or mouse interface to control the transfer functions interactively.

In order to construct your transfer functions you can use the code from Part 1 to examine the data. Here are three volumes and a Python script to start from:

Good luck!