DataTransform

Description

A DataTransform provides the capability to change the input raster's quality of display and improve its contrast.

Context

Table 1 lists the elements that can contain, or be contained by, a DataTransform element.

Table 1. Context
Contained by Element Contains

DataTransformList

DataTransform

ColorBreaksList

Attributes

Table 2 lists the attributes of a DataTransform element.

Table 2. Attributes
Attribute Description

type

Represents various types of color transformation options. There are five types:
  1. Linear: In this stretch method, all cell values of the raster are rescaled to new values in the output raster. For example, in any single-band, greyscale raster, the possible cell values range from 0-255. In practice, however, not all of these values will appear in the input raster. In input raster, the cell values range from 70-180, the linear stretching method will bring the minimum input value of 70 to the output value 0, and bring the maximum input value of 180 to output value 255.

    All intermediate values will change accordingly. When the image is displayed, it will have better contrast.

  2. Logarithmic: In this method, the smaller cell values in the raster will be mapped to a wider range of colors. The larger values will be mapped to similar colors. The intermediate values are mapped to a shorter range of colors. The formula for calculating logarithmic stretch depends on the minimum and maximum values specified in the stretch range.

    Any values in the input raster that are smaller than the specified minimum stretch range value will obtain the same color as the minimum stretch range value. Similarly, any values in the input raster that are larger than the specified maximum stretch range value will obtain the same color as the maximum stretch range value.

  3. Histogram Equalization: In this method, the values of an raster are converted into a number of output intervals. In doing so, all output intervals will contain an equal amount of cells. In other words, Histogram Equalization equalizes the intensity distribution of an image.
  4. Custom (only for LUTColor): The user-defined breaks enable to apply custom coloring to the input raster through a variety of techniques, such as, absolute, percentage, and percentile. As the method changes and the clips/breaks are altered, the color distribution will be altered automatically. Can be used only with LUTColor render style.
  5. DirectMapping: Can be used only with RGB render style.
    Note: This attribute is required.

name

Specifies the name of the data transform.
Note: This attribute is required.

Example

This example specifies a grid image style that contains a RenderStyle of type LUTColor, a Custom DataTransform having a collection of six color breaks, and a collection of three grid inflection points.

<?xml version="1.0" encoding="UTF-8"?>
<NamedStyle xmlns="http://www.mapinfo.com/mxp" version="MXP_WorkSpace_1_5">
   <GridStyle id="migridstyle" name="migridstyle" contrast="0.5" brightness="0.5" opacity="1" grayscale="false" show-hillshade="false" null-color="black" null-transparent="true">
      <RenderStyle type="LUTColor" underviewInterpolation="None">
         <Component type="color" field="0" band="1" dataTransform="MapInfoDataTransform">
            <ColorTable>Pseudocolor.lut</ColorTable>
         </Component>
         <Hillshade>
            <SunShadow enable="True" />
            <Highlight enable="True" />
         </Hillshade>
      </RenderStyle>
      <DataTransformList>
         <DataTransform type="Custom" name="MapInfoDataTransform">
            <ColorBreaksList>
               <ColorBreak value="-182.586959838867" color="#0000ff" />
               <ColorBreak value="57420.302986145" color="#1919ff" />
               <ColorBreak value="115023.192932129" color="#5e5eff" />
               <ColorBreak value="172626.082878113" color="#eeeeff" />
               <ColorBreak value="230228.972824097" color="#7f7f7f" />
               <ColorBreak value="287831.862770081" color="#a5a5a5" />
            </ColorBreaksList>
         </DataTransform>
      </DataTransformList>
      <GridInflectionList>
         <GridInflection value="0.4" color="yellow" />
         <GridInflection value="0.5" color="green" />
         <GridInflection value="0.6" color="blue" />
      </GridInflectionList>
   </GridStyle>
</NamedStyle>