A Visualization

A Visualization Write the program for either the Image Visualization or the Data as Wheat Visualization.

Image Visualization

Write a program to produce a visualization of the data values in an image. You are to read in an image, display the image on a sheet and over the image display objects with a dimension proportional to the average display value under the indicator object. You should be able to read in any well formed ppm or pgm image (your choice). Demonstrate your program with an image you have scanned. Take the pgm image (see following) and display it and 3D bar charts and an overlaying (semi transparent) gray scale image map. The bars (or rectangle solids or other shape) are to average the values of a 10x10 set of input pixels with the height representing that average.

If you prefer, you can read in a ppm (color) file and convert it to a gray scale image by averaging the three values (RGB) for each pixel. Note, this is a sloppy, inaccurate way to do this. However, it is also good enough for most uses. See the book for the correct conversion formula.

The full process after you have the programs working is

image  -------------> image.pgm -------> OpenGL display
        use xv, giftopnm        your              
	or other                program            
	image converter
As an example, if you have a 20 x 20 (pixel) image.

Then average the pixel values in each of the four 10 x 10 blocks. Then place above the image the bar to represent the block average. In a pgm file each pixel can have a value in the range 0 to 255.

part of a pgm (ascii) file
---------------------------------------------------
P2
# CREATOR: XV Version 3.10  Rev: 12/16/94
480 270
255
109 109 109 109 109 109 109 109 109 109 109 109 109 109 109 109 109 
109 109 109 109 109 109 109 109 109 109 109 109 109 109 109 109 109 
...

BNF for a pgm (ascii) file.  
pgm-p2-file :: P2<cr> <comments>* <num-rows> b <num-cols><cr>255<cr><data>
<comment>   :: # <text> <cr>
<data>      :: (<number><white-space>)^(<num-cols><num-rows>)

This is the man page for pgm file format. And this is the man page for ppm file format.

There is an example of using a ppm image as a texture in the program teatex2.

Your program should include the trackball movement support. It also should have a menu to make some adjustments in the image. It probably would be a good idea to have a wire frame vs solid choice on the glyphs and a couple of transparency choices to make the visualization easer to use.

Data as Wheat Visualization

Write a program to display data as wheat stocks. The data is initially to be displayed in order presented. There are to be controls to sort the data by any of the dimensions of the data. The wheat field is to be rectilinear and displayed in 3D. Pick angle of view and wheat properties for good presentation of the information. You are to support the trackball movement system. You also are to have a menu that will sort the data by each of the data dimensions (and back to the original order).

Function mapping:
The wheat stock is based on a function mapping of the data into the stock. The parameters are the:

||     ||  beard
||     ||
\\ === //
   ===     head
   ===
    |
    |
    |      stock
    |
    |

You can find some data sets at: The Machine Learning Repository http://www.ics.uci.edu/~mlearn/MLSummary.html The abalone data set or the Pima Indians data set might be the easiest to process.



FOLLOWING NOT PART OF THE ASSIGNMENT

Useful visualization programs would also allow you to probe into the data. For example it might allow you to pick out a single glyph and find out which data item it is. In addition, a full system would allow selecting and de-selecting portions of the data. One version of this might be to pick a single glyph and display its parameters. Then click on parameter will turn off all items with that value for that parameter. To get the values back you could have a box popup in the display area. If that box is picked, it will show a list of blocked values. If one of these is selected from the list, those values will be redisplayed. The above features will allow work to get done, but probably need to be redesigned to make them convenient for the user. These ideas can be extended by providing clustering filters that are used in data mining. These filters would then be selectable in the view to select and group portions of the data.