Handed out: September 28, 2015
Due: October 14, 2015 before 8:00 am
The second assignment focuses on the visualization of three-dimensional scalar fields using isosurfaces. Specifically, we will consider a medical imaging dataset corresponding to CT scans of a female subject. Your objective will be to combine isosurfaces, transparency, clipping planes and color mapping to reveal in your visualization important anatomical structures present in the data.
The data corresponds to
CT scans of a human female head and
feet, courtesy of the Visible Human
Project. For each dataset I am providing you with both high
and low resolution versions. The small resolution was created by
halving the size of the original data along each direction (it is
therefore 8 times smaller). For each resolution, you will
find both a CT volume and an additional dataset corresponding to the
magnitude of the gradient of the CT image. As a reminder, the gradient
of a scalar field is the vector-valued derivative of the scalar field. Here however, we are only
interested in the magnitude of the derivative. In each case, the CT
data is of type unsigned short
, yielding values between 0 and 65535,
while the gradient magnitude data is of type float. Note that the small
resolution is mainly provided as a convenience for the testing phase of
your implementation and I expect to see high quality results at full
resolution in your reports. The interesting features in this dataset
correspond to skin, bones, muscles and other soft tissues (e.g.,
fat or brain).
Your experimentation with the head dataset should allow you to identify values that correspond to the skin and the skull, respectively. In addition, you will use isosurfaces to try and reveal soft tissues such as muscles and brain. In the foot dataset, you will use isosurfaces to reveal the bone structure as well the skin and surrounding muscles. Note that for each dataset, the CT and gradient magnitude volumes will offer you complementary means to identify interesting features. To permit the selection of optimal isovalues, you will create a GUI that will let you select individual values associated with the various structures you are looking for. A slider bar will allow you to interactively browse the value range in search for the proper isovalue, while two additional slider bars will allow you to select a range of gradient magnitudes to act as a filter on the constructed isosurface. To mitigate the occlusion caused by the nested structure the surfaces, you will be using transparency and / or a clipping plane. The latter will allow you to cut away the occluding part of the surfaces to reveal internal structures. Finally you will use color mapping to convey quantitative properties of the selected isosurfaces.
The first task in this project consists in visualizing a 3D scalar dataset using isosurfacing while supporting the interactive modification of the corresponding isovalue. This initial step will allow you to identify a set of isovalues that correspond to the major anatomical structures present in each dataset. Specifically, skin, bones, muscles, and white matter (human head CT) and bones, muscles, and skin (human feet CT).
Write a program that uses vtkContourFilter to extract isosurfaces and ties it to a slider bar GUI to interactively manipulate the isovalue. To address occlusion issues, your program will offer interactive control over a clipping plane implemented as a vtkClipPolyData filter used with a plane implicit function, which allows you to clip away portion of the volume to reveal internal structures. Specifically, your program must satisfy following requirements.
Your program will have following API:
> isosurface[.py]
<data> [--val <value>]
[--clip <X> <Y> <Z>]
where <data>
is the 3D scalar
dataset to visualize, <value>
is the optional
initial isovalue to be used by the program, and
<X> <Y> <Z>
are the optional initial
positions of the 3 clipping planes.
Include in your report high-quality images showing each of the major anatomical structures that you were able to extract with isosurfaces. Each image should include a color bar. Indicate the isovalues that you identified for each structure and the visual settings associated with each visualization. Use clipping planes at your discretion to facilitate the visual inspection of your results. In addition, include answers to following questions in your report.
Now that you have identified interesting isosurfaces corresponding to major anatomical structures in each dataset, your second task is to color map the value of the gradient magnitude on those isosurfaces. In other words, you will visualize the values that the gradient magnitude takes at the set of positions defined by each isosurface. This visualization should give you additional insight into the properties of each isosurface.
Write a program that takes both scalar volume and gradient magnitude in input as well as a set of pre-selected isovalues in Task 1 and perform the color coding of the gradient magnitude on the isosurfaces. More precisely, you will use vtkProbeFilter jointly on the geometry of the isosurfaces and on the gradient magnitude volume to associate each vertex of the isosurfaces with the corresponding gradient magnitude value. The color mapping itself will be controlled by a color map supplied by the user. Specifically, your program must meet following requirements:
(1) The isovalues to be used by the program must be included in a file (see API below).
(2) The GUI only controls the clipping planes. There is no isovalue slider for this task.
Your program will have following API:
> isogm[.py]
<data> <gradientmag> <isoval> [--cmap <colors>]
[--clip <X> <Y> <Z>]
where <data>
is the 3D scalar
dataset, <gradientmag>
is the corresponding gradient
magnitude, <isoval>
is the name of a file containing the isovalues to be used,
<color>
is the optional name of a
file containing a color map definition following the same syntax as the one
used in Project 1, and
<X> <Y> <Z>
are the optional initial positions
of the 3 clipping planes.
Include in your report images of the color mapped isosurfaces computed by your program. Indicate clearly for each surface the corresponding isovalue. Each image should include a color bar. In addition, answer following questions:
Combining the insight you gained from Task 1 and Task 2 you will now use the gradient magnitude data to filter out unwanted portions of your isosurfaces. Specifically, Task 2 has shown you what values of the gradient magnitude coincide with certain portions of your isosurface. You can therefore use this information to discard from an isosurface uninteresting portion by specifying a gradient magnitude interval outside of which isosurface points should be removed. This kind of downstream filtering can be achieved by using vtkClipPolyData again but this time you will be applying it directly to the gradient magnitude values attached to the vertices of the isosurface. In fact, you will need to use two such filters for a given $[grad_{min}, grad_{max}]$ gradient magnitude interval, one to discard all the values less than $grad_{min}$ and one to discard all the values larger than $grad_{max}$ among the values that passed the first filtering stage.
You will write a program similar to the one you wrote for Task 2 except that this time, the gradient magnitude information will not be directly displayed on the isosurface after resampling but instead used to determine which points should be removed from the isosurface in the visualization pipeline. Your program should allow the user to interactively modify the $[grad_{min}, grad_{max}]$ selection interval to facilitate the identification of an optimal range. Specifically, your program should meet following requirements:
Note that in contrast to Task 2, you will only be considering one isosurface at a time here. This is meant to facilitate the adjustment of the gradient magnitude range on a per surface basis.
Your program will have following API:
> iso2dtf[.py]
<data> <gradientmag> [--val <val>]
[--clip <X> <Y> <Z>]
where <data>
is the 3D scalar
dataset and <gradientmag>
is the corresponding gradient
magnitude to visualize, and
<X> <Y> <Z>
are the optional initial positions
of the 3 clipping planes.
Include in your report high quality images for each dataset, corresponding to each filtered isosurface, while precisely indicating the matching isovalue. Indicate for each visualization which parameters / visual settings were used to create the image. In addition, provide an answer to following questions, with images to support your answers as necessary.
Using the isovalues that you identified in Task 1 and the gradient magnitude filtering ranges that you discovered in Task 3 to precisely characterize the various anatomical structures present in the data, you will now create a visualization where all the filtered isosurfaces are shown simultaneously using color and transparency.
For this final implementation task, you will write a program that incorporates the various features of the programs written so far and uses transparency in addition to clipping planes to allow for all relevant isosurfaces to be shown simultaneously without excessive occlusion. Remember to use Depth Peeling to achieve correct transparency results! Specifically, your program must satisfy following requirements.
Your program will have following API:
> isocomplete[.py]
<data> <gradientmag> <params>
[--clip <X> <Y> <Z>]
where <data>
is the 3D scalar
dataset, <gradientmag>
is the corresponding gradient
magnitude to visualize, <params>
is the name of a file
containing all the information necessary to select, filter, and visualize
the isosurfaces. The format of this file will be as follows.
#
' will be considered
comments and ignored.RGB
"
or "HSV
" to indicate the color space in which
the color associated with each isovalue is defined.<isovalue> <grad_min>
<grad_max> <x> <y>
<z> <alpha>
"
where "<grad_min> <grad_max>
" indicates the
gradient magnitude filtering range for the isosurface,
<x> <y> <z>
" are the
3 coordinates in the chosen color space of the color
associated with <isovalue>
, and
<alpha>
is the associated opacity.Include in your report, high quality images showing the results produced by your method for your particular selection of parameters for each dataset.
Comment on the effectiveness of isosurfaces for these medical datasets in your report. Isosurfaces in general are widely used in medical applications.
The datasets are available online. All datasets are of type vtkStructuredPoints
,
which is itself a specialized type of vtkImageData
.
Feet: CT (small, large), gradient magnitude (small, large)
Head: CT (small, large), gradient magnitude (small, large)
Submit your solution for this project before October 14, 2015 before 8:00 am (EXTENSION). Refer to the instructions below.
head_params.txt
and
feet_params.txt
.
Makefile
(if applicable). If you are using Visual Studio include the
solution file (.sln
)
and the project files (.vcproj
) that are needed
to build your project.README.txt
file with compilation / execution instructions
(optional).<myLogin>_p2
, where <myLogin>
is your Purdue login.After logging into
data.cs.purdue.edu
, submit your assignment as
follows:
> turnin -c cs530 -p project2
<dir_name>
where <dir_name>
is the name
of the directory containing all your submission material.
Keep in mind that old submissions are overwritten by new ones
whenever you execute this command. You can verify the contents of
your submission by executing the following command:
> turnin -v -c cs530 -p
project2
Do not forget the -v
flag here, as
otherwise your submission would be replaced by an empty one.