ColorBin

DESCRIPTION

ColorBin (version 1.0) allows the user to generate a color table that consists of descrete intervals, unlike GenerateColormap which generates a continuous colormap.

ColorBin also allows for the invidvidual manipulation of the opacity values for each bin. The output from ColorBin is a 1-dimensional Lattice datatype that is compatable with the output from GenerateColormap. This implies that you can use the output from ColorBin in the same situations that you use the output from GenerateColormap. (If desired, the output from ColorBin can be fed into the input for GenerateColormap.)

The descrete color bins can be given different opacity values for display. (0 = transparent, 1=opaque) This information can be entered either manually (via sliders next to the color bars) or with default opacity "ramps." These ramps are currently either linear or logarithmic, begin at color index #1 and end at the last color index for that particular colormap.

ColorBin gets its color information from ASCII input files that contain color information in 4-bit color format. (RGB intensities ranges from 0 to 15, rather than from 0 to 255.) In a future release, color information will be accepted in either 4- or 8-bit format.

The format of the color file corresponds to Lincoln Labotory Weather Shell Color Definition Files. (This is not coincidental.) The color definition file format is as follows:

Each line consists of either (a) a comment line, which consists of a line beginning with a semi-colon, (b) an alias line, which consists of a single word alias for the color that follows (any number of alias may preceed a color), (c) a color line, which consists of seven fields representing the actualy color name, the color index, the 4-bit red value, the 4-bit green value, the 4-bit blue value, the label for htat color, and the start of the color range. (NOTE: No white spaces are allowed in either the color names, aliases or the labels. This will be corrected in later release.)

So, the generic format looks as follows:

alias-1 alias-2 . . . alias-n ColorName Color# Red Green Blue Label Range Start

As an example, the first color set from a standard color definition file may look as follows:

; DEFAULT COLOR DEFINITION FILE ; ; Line format is: ; ;prod color# red,green,blue label start-of-range ; DB DZ dBZ dbz DBZ SN Reflectivity REFLECTIVITY REFL 1 6 6 6 _5_dBZ -19.0 REFL 2 9 3 14 10_dBZ 10.0 REFL 3 6 1 13 15_dBZ 15.0 REFL 4 0 6 15 20_dBZ 20.0 REFL 5 0 10 8 25_dBZ 25.0 REFL 6 0 9 0 30_dBZ 30.0 REFL 7 0 14 0 35_dBZ 35.0 REFL 8 15 15 0 40_dBZ 40.0 REFL 9 10 6 0 45_dBZ 45.0 REFL 10 15 10 0 50_dBZ 50.0 REFL 11 15 0 0 55_dBZ 55.0 REFL 12 15 6 15 60_dBZ 60.0 REFL 13 9 15 15 65_dBZ 65.0

This produces a descrete, 13 position color table entry for a color named "REFL," that can be referred to as "REFL," "DB," "dBZ," etc.

A sample WxShell Color Definition file can be found in /usr/local/explorer/colormaps/WxShell.colormap

Note: although a color definition file can have more than 16 entries, due to a descrepency in Explorer, only the first 16 entries will be recognized by ColorBin.

INPUTS

WIDGETS

Port: ColorFile
Type: File Browser
Enter the name of the color definition file.

Port: Colors
Type: Option Menu
Menu Item: --
Menu Item: --
Menu Item: --
Menu Item: --
Menu Item: --
Menu Item: --
Menu Item: --
Menu Item: --
Menu Item: --
Menu Item: --
Menu Item: --
Menu Item: --
Menu Item: --
Menu Item: --
Menu Item: --
Menu Item: ------------------------
Once a file is read, the user can select the color map to use via this port. This port can also obtain its input from another module that produces either the color name or one of the color aliases as output. (i.e. ReadCAR)

Port: Opacity Start
Type: Dial
This is the opacity value that will be assigned to the lowest color index in the color map.

Port: Opacity End
Type: Dial
This is the opacity value that will be assigned to the highest color index in the color map.

Port: Opacity Ramp
Type: Option Menu
Menu Item: LINEAR
Menu Item: LOGARITHMIC
This is the type of mathematically progression that will be used for increment through the color bins from Opacity Start to Opacity End. Currently, the only two choices are LINEAR and LOGARITHMIC.

Port: Color Window
Type: Drawing Area
This is a representational legend of the colors that the user has chosen to display. To the right of each color, is the label that appears in the color definition file. To the left of each color is a number and a small slider. This number represents the current opacity value for that color. The slider will allow the user to manipulate each individual slider value.

OUTPUTS

Port: ColorLattice
Type: Lattice
Constraints: 1-D.
4..5-vector.
float.
uniform.
This is the output colormap that can be used as input to any Explorer module that desires a colormap input. (Note: you can use this as input to GenerateColormap if you would like, but be warned that GenerateColormap will attempt to create a continuous colormap out of the output of ColorBin. This means that the output from GenerateColormap will by necessity not be equivalent to the output of ColorBin.)

PROBLEMS

- The sliders in the colormap are generated by me, as such they currently do not track the mouse as you move the slider along. You will, however, see the change once you release the mouse. - The WxShell color definition file does not allow white spaces in the labels. This will change at some point. - The colormap gets regenerated twice when the user closes the fully opened ColorBin panel. - Please send further bug reports to demillo@ll.mit.edu

SEE ALSO

GenerateColormap Legend VolumetoGeom
[ Documentation Home ]
© The Numerical Algorithms Group Ltd, Oxford UK. 1996