### AutoGrayScale

Category

Transformation

Function

Automatically colors a field using a "gray" scale.

Syntax

    mapped, colormap = AutoGrayScale(data, opacity, hue, start, range,
                                     saturation, min, max, delayed,
                                     outofrange);

Inputs

Name | Type | Default | Description
--- | --- | --- | ---
`data` | data field | none | field to be colored
`opacity` | scalar | input dependent | opacity (between 0 and 1)
`hue` | scalar | 0.0 | hue
`start` | scalar | 0.0 | starting intensity
`range` | scalar | 1.0 | range of intensity
`saturation` | scalar | 0.0 | saturation (between 0 and 1)
`min` | scalar or data field | min of data | minimum of data to be colored
`max` | scalar or data field | max of data | maximum of data to be colored
`delayed` | flag | 0 | 0: apply maps 1: delay applying color and opacity maps (byte data only)
`outofrange` | vector list or string list | {"color of min, " "color of max"} | how to color out-of-range data values

Outputs

Name | Type | Description
--- | --- | ---
`mapped` | color field | color-mapped input field
`color`map | field | RGB color map used

Functional Details

This module maps the intensities of a color (`hue`) to the data values of a specified field (`data`).

`data` | is an input field with data. If the input is a vector field, the intensities are based on the magnitude of the data. If the input consists of matrices, the intensities are based on the determinants.
`opacity` | specifies the opacity of the resulting object. Allowed values range from 0 to 1. Its default value is 1 for surfaces and 0.5 for volumes.
`hue` | sets the hue. Blue is 0.6666, red is 0 or 1, and colors are defined cyclically from -&infinity; to &infinity (i.e., `hue` of -1 = `hue` of 0 = `hue` of 1, and so on). Note: This parameter will have no effect if `saturation` is set to 0 (see below).
`start` and `range` | specify the intensities applied to the minimum and maximum data values mapped. The value of `range` can be any positive number. By default, the minimum data value has an intensity of 0, and the maximum an intensity of 1. See also "Coloring Objects for Volume Rendering".
`saturation` | specifies the saturation of the colors used. This value must be between 0 (the default) and 1.
`min` and `max` | specify the minimum and maximum data values mapped. If neither is specified, the minimum and maximum values of `data` are mapped. If `min` is scalar, the minimum data value is mapped to that value. If `min` is a data field, the minimum data value of that field is used. The `max` parameter is interpreted in corresponding fashion. If `min` is a data field and `max` is unspecified, the module uses the minimum and maximum values of that field. For volumes, regions with values outside the `min`-`max` range are invisible; for surfaces, such regions are gray by default.
`delayed` | determines whether "delayed colors" are created. Such colors are available only for byte data and they use less memory. When `delayed` = 1: The "colors" component is a pointer to the "data" component, and a "color map" component is created. (This component is a color lookup table with 256 entries, representing the appropriate color for each of the 256 possible data values.) If `opacity` is also specified, an opacity map is created with 256 entries, while the "opacities" component is a copy of the "data" component. The module adds a "direct color map" attribute to the output object. (See "Using Direct Color Maps".)
`outofrange` | specifies the coloring of data that fall outside the `min`-`max` range. This parameter applies only to surfaces; out-of-range data values for volumes are always invisible. If the parameter value is a single color (RGB vector or color-name string), it is applied to both the upper and lower out-of-range points. If it is a list of two colors, then it is applied to the lower and upper out-of-range points, respectively. Color strings can be any of the defined color-name strings (see Color) or either of the strings "color of min" and "color of max."

Notes:

1. Directly displayed grayscale images will use more distinct colors if you take advantage of direct color maps by using the `delayed` parameter. Use Compute to convert your data to bytes if they are not already in that form.

2. AutoGrayScale adds colors to the "colors" component. For "front colors" or "back colors," use the Rename module following AutoGrayScale.

3. This module also outputs the RGB color map used, in the output `colormap`. The "positions" component contains the data values, and the "data" component contains the corresponding RGB colors. You can use this color map as an input to the ColorBar module. For byte data, the color map always contains 256 entries for the 256 possible data values. If the input to AutoGrayScale is a group, then a different color map will be constructed for each member of the group. In that case, the `colormap` output of the module is a group of color maps. Use the Select module to select the color map you want to display using ColorBar.

4. If you AutoGrayScale a group of volumes, you may find that the resulting image is black because the renderer does not support coincident volumes.

Components

Adds a "colors" component. An "opacities" component is added if `opacity` is less than 1 or the input data is a volume. If `delayed` = 1, the "colors" component is a copy of the "data" component, and a "color map" component is created. Likewise, an "opacity map" component is created if `opacity` is less than 1 or the input is a volume.

Example Visual Program

    AlternateVisualizations.net

See Also Color, AutoColor, ColorBar

[ OpenDX Home at IBM | OpenDX.org ]