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.
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|
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|
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:
- The CT scan from Part 1 (needs conversion, see volren.py): ctscan_ez.vtk
- A CT scan of a foot: foot.vtk
- An MR image of a brain: brain.vtk
- Python script: volren.py