Visualization Assignment 1 for 22C:251 Course - Spring 2009 - Prof. Christopher Wyman, Assignments of Computer Graphics

An assignment for the visualization course (22c:251) in spring 2009. Students are required to compile a program using the visualization toolkit and explore various coloring schemes for visualizing univariate data in 2d images. The assignment includes two problems: compiling the cone example and visualizing images using different color scales.

Typology: Assignments

Pre 2010

Uploaded on 09/17/2009

koofers-user-wcs-2
koofers-user-wcs-2 🇺🇸

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Spring 2009
22C:251 Visualization
Assignment 1
Due: Tuesday, February 24th at 11:59pm
Goal: Compile a program using the Visualization Toolkit. Explore various coloring schemes for visualizing univariate
data in 2D images.
Problem 1 (10 points): Compile the Cone example shown in class. The code is posted online. Rotate, translate, or
scale the cone some random amount and post an image on a publically-accessible webpage you create to display your
results.
You can use any utility you want to capture screenshots. (Good ways include using GIMP (FileAcquireScreen Shot) or,
“PrintScreen” + “Paste” inside MS Paint in Windows.)
You must send me an e-mail with the address of your webpage.
I plan to link all web pages from the class homepage, unless you explicitly ask me not to.
Problem 2 (40 points): Create a program that loads an image from a file and visualizes it using the following
techniques. You must test these techniques on the following images (see webpage): MR knee.png,CT chest.png,
usincome.png,flow density.png, and rose 512.png. I encourage you to write your code so that it loads an image
specified on the command line. This way you will not need to modify your code independently for each image.
Part A: Convert the images to a luminance scale (Hint: vtkImageLuminance), then create a lookup table (Hint:
vtkImageMapToColors + vtkLookupTable) that classifies the image into 3, 5, 7, or 9 grayscale categories. Use
the following three methods for this classification:
1. Equal intervals. (i.e., for 3 categories: gray values [0..85] are colored 42, [86..170] are colored 127,
[171..255] are colored 212)
2. Separate quantiles. (i.e., for 3 categories: the dimmest 1
3of pixels are colored one value, the middle 1
3
another, and the top 1
3another)
3. Mean + Standard Deviation. (i.e., for 3 categories: within 1 standard deviation of the mean are colored
the middle gray, less than 1 standard deviation below the mean are colored a darker gray, greater than 1
standard deviation above the mean a lighter gray)
Note: For the quantiles and mean/standard deviations, the appropriate values will be posted online so you need not compute
them. On your webpage, you must post 5 images for each classification method (one for each of the input PNG files). This
image can either have 3, 5, 7, or 9 categores but must be the one you think conveys the most information for that image and
classification scheme.
Part B: Implement the following color scales (Hint: vtkImageMapToColors +vtkLookupTable). For each input
image and color scale, test it with the original 256-color grayscale image and the three grayscale categories
from Part A. Of these four tests, put the one you think conveys the most information on your webpage.
1. A perceptually linear gray scale. (See webpage)
2. A single-hue color scale (e.g., just magenta, red, or blue of varying saturations)
3. A two-hue opponent color scale (e.g., yellow-blue, red-green, red-cyan)
4. A rainbow scale (e.g., (1,0,0)(1,1,0)(0,1,0)(0,1,1)(0,0,1)(1,0,1))
REMEMBER: Send me an e-mail listing your web address where I can go to see your images.
pf2

Partial preview of the text

Download Visualization Assignment 1 for 22C:251 Course - Spring 2009 - Prof. Christopher Wyman and more Assignments Computer Graphics in PDF only on Docsity!

Spring 2009

22C:251 Visualization

Assignment 1

Due: Tuesday, February 24th at 11:59pm

Goal: Compile a program using the Visualization Toolkit. Explore various coloring schemes for visualizing univariate data in 2D images.

Problem 1 (10 points): Compile the Cone example shown in class. The code is posted online. Rotate, translate, or scale the cone some random amount and post an image on a publically-accessible webpage you create to display your results.

  • You can use any utility you want to capture screenshots. (Good ways include using GIMP (FileAcquireScreen Shot) or, “PrintScreen” + “Paste” inside MS Paint in Windows.)
  • You must send me an e-mail with the address of your webpage.
  • I plan to link all web pages from the class homepage, unless you explicitly ask me not to.

Problem 2 (40 points): Create a program that loads an image from a file and visualizes it using the following techniques. You must test these techniques on the following images (see webpage): MR knee.png , CT chest.png , usincome.png , flow density.png , and rose 512.png. I encourage you to write your code so that it loads an image specified on the command line. This way you will not need to modify your code independently for each image.

  • Part A: Convert the images to a luminance scale ( Hint: vtkImageLuminance ), then create a lookup table ( Hint: vtkImageMapToColors + vtkLookupTable ) that classifies the image into 3, 5, 7, or 9 grayscale categories. Use the following three methods for this classification: 1. Equal intervals. (i.e., for 3 categories: gray values [0..85] are colored 42, [86..170] are colored 127, [171..255] are colored 212) 2. Separate quantiles. (i.e., for 3 categories: the dimmest 13 of pixels are colored one value, the middle (^13) another, and the top 13 another) 3. Mean + Standard Deviation. (i.e., for 3 categories: within 1 standard deviation of the mean are colored the middle gray, less than 1 standard deviation below the mean are colored a darker gray, greater than 1 standard deviation above the mean a lighter gray)

Note: For the quantiles and mean/standard deviations, the appropriate values will be posted online so you need not compute them. On your webpage, you must post 5 images for each classification method (one for each of the input PNG files). This image can either have 3, 5, 7, or 9 categores but must be the one you think conveys the most information for that image and classification scheme.

  • Part B: Implement the following color scales ( Hint: vtkImageMapToColors +vtkLookupTable ). For each input image and color scale, test it with the original 256-color grayscale image and the three grayscale categories from Part A. Of these four tests, put the one you think conveys the most information on your webpage. 1. A perceptually linear gray scale. (See webpage) 2. A single-hue color scale (e.g., just magenta, red, or blue of varying saturations) 3. A two-hue opponent color scale (e.g., yellow-blue, red-green, red-cyan) 4. A rainbow scale (e.g., (1,0,0)→(1,1,0)→(0,1,0)→(0,1,1)→(0,0,1)→(1,0,1))

REMEMBER: Send me an e-mail listing your web address where I can go to see your images.

HINT: To make your web page easiest to view, I would structure your images for Problem 2 into either a five row (or five column) table – one for each of the five images. Each separate classification method would then have its own column (or row).

Your webpage should have 1 image for Problem 1, and 35 images for Problem 2 (3×5 for Part A and 4×5 for Part B). For Problem 2, you may wish to show the unmodified images for comparison, giving a total of 40 images.

NOTE: Please submit your code using ICON to the 22C:251 site into the dropbox for Homework 1. Make sure there is a “README” file telling me how to compile your code, and where you compiled your code. For Windows-based submissions, I would appreciate precompiled executables. For Linux-based submissions, I would appreciate if you either test that your work compiles (using the instructions in you README) on the MacLean Hall 301 lab machines or you use the Makefile I posted on the class webpage for “compiling VTK using CMake and g++.”