Difference between revisions of "SciVisFall2008/Assignment 2"

From VistrailsWiki
Jump to navigation Jump to search
(Exercise 3)
Line 11: Line 11:
As you work on the assignment, we encourage you to read the available documentation on both [http://www.python.org python] and [http://www.vtk.org VTK]. Remember that VisTrails allows you to easily access the VTK documentation. To see the documentation of a VTK module in the ''Modules panel'', just right click on its name and choose '''View Documentation''' in the context menu. Analogously, you can right click on a method's name in the ''Methods panel'' to see it's documentation.
As you work on the assignment, we encourage you to read the available documentation on both [http://www.python.org python] and [http://www.vtk.org VTK]. Remember that VisTrails allows you to easily access the VTK documentation. To see the documentation of a VTK module in the ''Modules panel'', just right click on its name and choose '''View Documentation''' in the context menu. Analogously, you can right click on a method's name in the ''Methods panel'' to see it's documentation.
Some of the problems will require you to use VTK modules you might not have previously seen. These are indicated in the problems.
Some of the problems will require you to use VTK modules you might not have previously seen. These are indicated in the problems.
Starting with this assignment, grad students will have to perform extra work and this is indicated with '''Grads only''' headings.


== General Hints ==
== General Hints ==
Line 56: Line 58:
=== Grads only ===
=== Grads only ===


(c) You know that from their source, rivers flow downhill. Based on 2(b), design a visualization that shows the variance of the elevation of the stream bed of the Colorado river, without sacrificing the existing information. Tag the final version of this visualization as '''Problem 2c'''. Potentially relevant modules for this task: vtkColorTransferFunction.  
(c) You know that from their source, rivers flow downhill. Based on 2(b), design a visualization that shows the variance of the elevation of the stream bed of the Colorado river and that also emphasizes the borders of the cliff, without sacrificing the existing information. Tag the final version of this visualization as '''Problem 2c'''. Potentially relevant modules for this task: vtkColorTransferFunction.  
  '''Hint:''' the vtkProperty module has a method called SetLineWidth  
  '''Hint:''' the vtkProperty module has a method called SetLineWidth  
  that you can use to make a set of lines stand out.
  that you can use to make a set of lines stand out.
Line 81: Line 83:


(c) Generate a visualization of the gradients of the Grand Canyon DEM. Use any technique you might find appropriate. Will there ever be a streamline that connects to itself? Why (or why not)? Answer these questions in the notes for your visualization and tag it as '''Problem 3c'''. Use the PythonSource module from the '''Gradient Generation''' visualization in '''Assignment2.vt''' to create a gradient vector field from the grand canyon dataset. It's OK to copy and paste this module.
(c) Generate a visualization of the gradients of the Grand Canyon DEM. Use any technique you might find appropriate. Will there ever be a streamline that connects to itself? Why (or why not)? Answer these questions in the notes for your visualization and tag it as '''Problem 3c'''. Use the PythonSource module from the '''Gradient Generation''' visualization in '''Assignment2.vt''' to create a gradient vector field from the grand canyon dataset. It's OK to copy and paste this module.
== Exercise 4: Differential information in vector fields ==
(a) Generate a visualization that builds on 3(b) and uses the background to portray the magnitude of the vectors in the field. Tag the final version of this visualization as '''Problem 4a'''. Potentially relevant modules: vtkVectorNorm.
=== Grads only ===
(b) Generate a visualization that portrays divergence, and one that portrays curl. Choose an appropriate colormap, and justify it in your notes. Tag your final visualization as '''Problem 4b'''. Use the PythonSource module from the '''Divergence Generation''' and '''Curl Generation''' visualizations in '''Assignment2.vt''' to create divergence and curl fields. It's OK to copy and paste these modules.
=== Extra credit ===
(c) Try to generate a visualization that portrays both divergence and curl at the same time. There are (at least) two issues we want you to solve creatively here - occlusion and colormap interference. This is your chance to explore anything you might feel like doing. Here is a set of places to get you started: vtkProbeFilter, opacity values, vtk clipping algorithms, interactive visualizations (look up terminator.vt in the examples). Tag this visualization '''Problem 4c''' and describe what you did in your notes.

Revision as of 06:12, 9 October 2008

This is your third assignment for CS 5630/6630.

The assignment is due at midnight on October ??, 2008. You will need to use the CADE handin functionality to turn in your assignment. The class account is "cs5630".

This assignment was successfully tested in release 1.2.1rev1336. It should work fine in releases >=1.2.1rev1336. Check your release before starting your work and upgrade it if necessary.

The purpose of this assignment is to make sure you understand (and experiment with) the basic concepts involved in the visualization of 2D scalar and vector fields.

Examples of visualizations of 2D scalar and vector fields were provided in the lectures and can be found here and here.

As you work on the assignment, we encourage you to read the available documentation on both python and VTK. Remember that VisTrails allows you to easily access the VTK documentation. To see the documentation of a VTK module in the Modules panel, just right click on its name and choose View Documentation in the context menu. Analogously, you can right click on a method's name in the Methods panel to see it's documentation. Some of the problems will require you to use VTK modules you might not have previously seen. These are indicated in the problems.

Starting with this assignment, grad students will have to perform extra work and this is indicated with Grads only headings.

General Hints

Some of the fields in this assignment are such that most of the points in the field have values in a small region of the range. Because of this, a linear path through the color space might be inappropriate. You might consider using vtkColorTransferFunction for more effective results.

When generating visualizations that overlay multiple actors, it will be convenient to displace some of them along the Z direction so they "stack" the right way. Use the "AddPosition" method on the vtkActor module to do that.

Data

The data for the four problems of this assignment are in four files: grand_canyon.vtk and grand_canyon_small.vtk (problems 1 and 2), vector_field_2008.vtk and vector_field_norm_2008.vtk (problems 3 and 4).

  • grand_canyon.vtk is DEM of the Grand Canyon National Park.
  • grand_canyon_small.vtk is a downsampled version of the above file.
  • vector_field_2008.vtk is a 2D vector field
  • vector_field_norm_2008.vtk is the normalized version of the above 2D vector field

The four files are packed into a single zip file called Hw2data.zip. The task of unzipping and locating these files is already done in the starting vistrails file for this assignment: Assignment2.vt. You should solve the problems by working directly in this vistrails file.

Exercise 1: Basic scalar field techniques

You will design colormaps for a dataset. In particular, you will design two different colormaps for two different tasks. The dataset you are given is a digital elevation map (DEM) of the Grand Canyon National Park. To give you context for this problem, we include here a google map of the area:

<googlemap version="0.9" lat="36.503013" lon="-112.519226" type="terrain" zoom="9" width="400" height="450"> </googlemap>

The elevations are given in meters, and the range of the data is [548.0, 2835.0].

Hint: as the original dataset is large, you should test your visualizations using the 
downsampled version (grand_canyon_small.vtk). It will work better on slower machines.

(a) Apply the colormap design principles described in class to create a visualization where it is easy to tell which of two points are higher. Tag the final version of this visualization as Problem 1a and describe in the notes why you chose this colormap.

(b) Apply the colormap design principles described in class to create a visualization where it is easy to tell the height of any given point. Tag the final version of this visualization as Problem 1b and describe in the notes why you chose this colormap.

(c) Generate a visualization that is suited to both previous tasks. Tag the final version of this visualization as Problem 1c and describe in the notes why you chose this colormap.

Grads only

(d) Generate colormaps that give a good visualization of the plateau (the green area in the google map in terrain view) on the east part of the DEM. Tag the final version of this visualization as Problem 1d and describe the technique used on the notes. Potentially relevant modules for this task: vtkColorTransferFunction.

Exercise 2: Differential visualization in scalar fields

Using the same dataset as in the previous exercise, now you will design and implement visualizations that answer the following question: How steep is the canyon?

(a) Generate a colormap that portrays the canyon steepness directly. Tag the final version of this visualization as Problem 2a. Potentially relevant modules: vtkImageGradientMagnitude

(b) Generate a visualization based on your solution to 1(c) that portrays the canyon steepness without sacrificing the height information. Tag the final version of this visualization as Problem 2b. Potentially relevant modules: vtkContourFilter, vtkWarpScalar.

Grads only

(c) You know that from their source, rivers flow downhill. Based on 2(b), design a visualization that shows the variance of the elevation of the stream bed of the Colorado river and that also emphasizes the borders of the cliff, without sacrificing the existing information. Tag the final version of this visualization as Problem 2c. Potentially relevant modules for this task: vtkColorTransferFunction.

Hint: the vtkProperty module has a method called SetLineWidth 
that you can use to make a set of lines stand out.

Extra credit

(d) Generate another visualization for problem 2b that uses a different technique and tag the final version of this visualization as Problem 2d.

Exercise 3: Basic vector field techniques

In this task you will use basic vector field visualization techniques to investigate a 2D vector field.

Hint: vector_field_norm_2008.vtk is the vector field computed by normalizing 
vector_field_2008.vtk. Using this as the source for streamlines will result in 
much more efficient visualizations (can you see why?)

(a) Create a visualization that uses arrow glyphs to effectively portray the overall shape of the 2D vector field. Tag the final version of this visualization as Problem 3a.

(b) Build on 3(a) by placing a set of streamlines in places that help portray more information about the visualization. Tag the final version of this visualization as Problem 3b.

Hint: depending on how observant you are, there will be either four or 
six "features" you should be able to pick out with streamlines 
(Finding four is fine, six is extra fine).

Grads only

(c) Generate a visualization of the gradients of the Grand Canyon DEM. Use any technique you might find appropriate. Will there ever be a streamline that connects to itself? Why (or why not)? Answer these questions in the notes for your visualization and tag it as Problem 3c. Use the PythonSource module from the Gradient Generation visualization in Assignment2.vt to create a gradient vector field from the grand canyon dataset. It's OK to copy and paste this module.


Exercise 4: Differential information in vector fields

(a) Generate a visualization that builds on 3(b) and uses the background to portray the magnitude of the vectors in the field. Tag the final version of this visualization as Problem 4a. Potentially relevant modules: vtkVectorNorm.

Grads only

(b) Generate a visualization that portrays divergence, and one that portrays curl. Choose an appropriate colormap, and justify it in your notes. Tag your final visualization as Problem 4b. Use the PythonSource module from the Divergence Generation and Curl Generation visualizations in Assignment2.vt to create divergence and curl fields. It's OK to copy and paste these modules.

Extra credit

(c) Try to generate a visualization that portrays both divergence and curl at the same time. There are (at least) two issues we want you to solve creatively here - occlusion and colormap interference. This is your chance to explore anything you might feel like doing. Here is a set of places to get you started: vtkProbeFilter, opacity values, vtk clipping algorithms, interactive visualizations (look up terminator.vt in the examples). Tag this visualization Problem 4c and describe what you did in your notes.