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.
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.
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.
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.