User's Guide

MAP

Perform a piecewise linear transformation on an input image

Function:

Performs a piecewise linear transformation on an input image. The input image data type may be BYTE, INTEGER*2, INTEGER*4, or REAL*4 and may be a single- or multi-band image. Two through one thousand separate mapping ranges may be specified through the combination of the FROM and TO parameters, or the values may be entered via a text file.

Parameters:

IN
Input image. IN may be a single- or multi-band image and may contain BYTE, INTEGER*2, INTEGER*4, or REAL*4 pixel data. Window and/or band options may be specified.

NOTE:  If the data type of the output image is to be 
       the same as the input image(s), all input 
       images are required to be of the same data 
       type.  The window size of all input images are 
       required to be the same.

OUT
Output image. The output image is the same size as the input image specification. Output data type is determined by ODTYPE.

ODTYPE(SAME)
Output data type. The data type of the output image. If the input image is REAL*4 and the output data type is INTEGER or BYTE, the data is rounded or truncated depending on the value set for ROUNDOPT.

  = SAME: Same as input 
  = BYTE: BYTE        (8-bit unsigned integer)  
		      (0 through 255)
  = I*2: INTEGER*2    (16-bit signed integer)
		      (-32768 through 32767)
  = I*4: INTEGER*4    (32-bit signed integer)
		      (-2147483648 through 2147483648)
  = R*4: REAL*4	      (32-bit signed real)
		      (System dependent)

ROUNDOPT(ROUND)
Round option. If the input data is REAL*4 and the output data type is INTEGER*4, INTEGER*2, or BYTE, the input data values are either rounded or truncated when converted.

  = ROUND:  Round the input data.
  = TRUNC:  Truncate the input data.  

FROM(--)
Input pixel values. Specifies the input values of the mapping pairs. At least two and no more than one hundred values may be given. FROM must contain the same number of values as specified in TO. When FROM and INFILE are both defaulted to NULL, a single FROM pair is created containing the min and max values of the input image(s).

TO(--)
Output pixel values. Specifies the output values of the mapping pairs. At least two and no more than one hundred values may be given. TO must contain the same number of values as specified in FROM. When TO and INFILE are both defaulted to NULL, a single TO pair is created containing the min and max values of the output data type.

INFILE(--)
Input file. INFILE may be either an ASCII text file of FROM/TO pairs or a display and look-up table file (DLTF). When this file name is specified, the values in FROM and TO are ignored and the contents of the file are used.

If it is an ASCII file, it contains the input and output pixel values normally found in FROM and TO. The file may be created by a text editor, FORTRAN program, or a C program using unbuffered I/O and variable length, carriage-return control. The values in the file must be placed in two columns: one for the FROM values and one for the TO values. Up to 1,000 pairs may be specified. If it is a DLTF file, the look-up table that is needed to map the input image(s) is read from this file, rather than calculated from FROM/TO pairs. INDLTF must contain the key field of this DLTF entry. When INDLTF contains the key field of the DLTF but no file name has been specified in INFILE, INFILE is assumed to be the same name as the image name in IN as long as only one image file name was specified as input to IN. The default extension for INFILE is ";txt".

INDLTF(--)
Input display and look up-table file entry. The DLTF entry from a previously created look-up table stored on disk in DLTF format. The number of look-up tables in the INDLTF entry must equal the total number of input bands in IN, must be a single entry that is used to map all input bands, or a multiple entry if the input image is a single band. INDLTF is required if INFILE contains a DLTF file name and must have the default value if INFILE cannot be defaulted to the input image name (see INFILE).

OUTFILE(--)
Output display and look-up table file. The look-up table used by MAP is only stored on disk if OUTFILE is specified, or the output DLTF key field is specified in OUTDLTF. In the latter case, OUTFILE is given the same root name as the output image name in OUT with an extension of ";dltf". The data type of the DLTF may be BYTE or INTEGER*2. There can be only one OUTFILE for each output image.

OUTDLTF(--)
Display and look-up table file entry. The name of the entry in the images' associated DLTF specified by OUTFILE. OUTDLTF is required if the look-up table used to map the image(s) is to be saved to disk in DLTF format. OUTDLTF must be NULL if OUTFILE is NULL.

TEXT(--)
Text string. This contains the contents of the COMMENT field of the DLTF entry.

Example:

  1. LAS> map in=dc out=mapped odtype=4 from=(1.0,20.0,200.0,255.0) to=(20.0,110.0,190.0,250.0)

    The input image DC is transformed and output to the REAL*4 image MAPPED as follows:

             o  Gray levels less than 1.0 are set to 20.0.
    
             o  Gray levels greater than or equal to 1.0 and less 
                than 20.0 are linearly mapped into the range 
                (20.0:110.0).
    
             o  Gray levels greater than or equal to 20.0 and less 
                than 200.0  are linearly mapped into the range 
                (110.0:190.0).
    
             o  Gray levels greater than or equal to 200.0 and less 
                than 255.0 are linearly mapped into the range 
                (190.0:250.0).
    
             o  Gray levels greater than 255.0 are set to 250.0.
    

Description/Algorithm:

MAP computes the transformation coefficients needed to map the input image over the user-specified ranges. Once these values are computed, they are applied to each input band in a line-by-line fashion.

Nonfatal Error Message:

  1. [map-warn] Nonfatal error encountered

    A nonfatal error was encountered during processing. The image data is probably valid and therefore saved. The message that is displayed immediately preceding this message is the specific error that was encountered. Processing continues.

  2. [map-create] Output DLTF will not be created

    An output DLTF was specified but will not be created. The input or output image were either INTEGER*4 or REAL, but a DLTF may only be BYTE or INTEGER*2.

Fatal Error Messages:

  1. [map-fatal] Fatal error encountered

    A fatal error was encountered during processing. The output image is not deleted, and processing is terminated. The error message that is displayed immediately preceding this message is the specific error that was encountered.

  2. [map-window] Input images do not have the same window sizes

    The images in the input image specification must have the same window size.

  3. [map-type] Input images are not of same data type

    The output image's data type was to be the same as the input image, but the input images are not of the same data type. The user can either ensure all input images have the same data type or specify the data type of the output image by assigning a value to ODTYPE.

  4. [map-dltfentr] Output DLTF file requires key field from OUTDLFT.

    When OUTFILE is specified, user input is required for OUTDLTF and TEXT, which are used for the key of the output DLTF and comment fields.

  5. [map-dltfname] Input DLTF file name cannot be defaulted if IN specifies more than one image name

    When a DLTF entry name is specified in INDLTF and more than one image file name was specified in the IN, the input DLTF file name in INFILE cannot be defaulted to that of the input image file name. The input DLTF file name must be specified in INFILE.

  6. [map-dimension] FROM and TO must have at least two values

    FROM and TO cannot be specified with only one value. Each parameter must have at least two values specified for it.

  7. [map-unequal] The number of FROM values must equal the number of TO values

    The FROM and TO parameters work as a pair and must contain the same number of values.

  8. [map-order] FROM values must be specified in ascending order

    The values specified for FROM must be in ascending order.

  9. [map-range] TO value is outside the output data type range

    The values specified for TO must be in the range of the output data type.

  10. [map-open] Error opening map point file

    An error was encountered while attempting to open the file specified in INFILE.

  11. [map-pairs] The FROM and TO values in the text file must be in pairs

    The file specified in INFILE is required to be an ASCII file containing a single FROM and TO pair per line, separated by a blank(s).

  12. [map-points] Text file of FROM and TO pairs contains too many values

    The file of FROM and TO values specified by the INFILE can have a maximum of 1,000 pairs of values.

  13. [map-entries] Improper number of DLTF entries

    The input DLTF entry must have: the same number of look-up tables as the number of input image bands specified; only one look-up table, which will be used for all image bands; a multiple entry if the input image is a single band.

  14. [map-lutsml] First LUT position specified in partial LUT is too small

    The first FROM/TO pair specified contains a value that is less than the range of the data type of the look-up table required to map the image.

  15. [map-lutbig] Final LUT position specified in partial LUT is too large

    The last FROM/TO pair specified contains a value that is greater than the range of the data type of the look-up table required to map the image.

  16. [map-alloc] Error allocating buffer space for DLTF record

    An error was encountered attempting to allocate enough memory to read in the input DLTF data.

  17. [map-lutdata] DLTF data outside input image range

    The starting point and ending point of the input DLTF entry data are outside of the range of the data type of the lookup table required to map the image.

  18. [map-lutmnmx] DLTF min/max values inconsistent with data type

    The minimum and/or maximum values of the input DLTF entry data are outside of the range allowed by its data type.

User Notes:

  1. If either the input or output data type is INTEGER*4 or REAL, the input image(s) are linearly interpolated pixel by pixel; otherwise, mapping is done with a look-up table. Therefore, the processing times for INTEGER*4 and REAL data will be substantially greater.

  2. When scaling an image up to a higher order data type or down to a lower order data type, the FROM pairs, TO pairs, or both may be defaulted to NULL. A FROM pair is created whose values are the minimum and maximum pixel values of the input image. A TO pair in created whose values are the minimum and maximum allowable values for the output data type of the output image (ODTYPE). For example, an input byte image whose pixel values range from 10 to 200 being mapped to an I*2 image would have 10 mapped to -32768 and 200 mapped to 32767, with a look-up table having been constructed for all values in between.