User's Guide

RENUMBER

Renumbers specified pixel values

Function:

Creates an output image by reassigning specified pixel values in an input image. If OUT is not specified, the input image is updated. Values not specified may remain the same or be reassigned to a specified background value. RENUMBER allows only BYTE or INTEGER*2 data.

Parameters:

IN
Input image. The input data type must be BYTE or INTEGER*2. The input image pixel values in FROM are reassigned to the respective user specified values in TO in the output image.

OUT(--)
Output image. Name of the output image to be created. If NULL, IN will be updated with the changes.

ODTYPE(SAME)
Output data type. The data type of the output image.

  = SAME: Same as input
  = BYTE: BYTE      (8-bit unsigned integer)
  = I*2:  INTEGER*2 (16-bit signed integer)

FROM(--)
Input pixel values. The values in the input image to be reassigned to the corresponding values in TO. The number of values entered must equal the number of values entered in TO.

TO(--)
Output pixel values. New values for corresponding entries in FROM. TO must contain the same number of values as FROM. The number of values entered must equal the number of values entered in FROM.

INFILE(--)
Input file. INFILE is an ASCII text file containing FROM/TO pairs. When INFILE is specified, the values in FROM and TO are ignored and the contents of the file are used. The file contains the input and output pixel values normally found in FROM and TO. The values in the file must be placed in two columns: the first for the FROM values and the second for the TO values. Up to 65,536 pairs may be specified. The default extension for INFILE is ";txt".

BACKGRND(--)
Background value. The value assigned to the output pixel when the input pixel value is not specified in FROM. When BACKGRND is NULL the output pixel value is the same as the input pixel value.

Examples:

  1. LAS> renumber in=alaska out=-- from=(1,2,6) to=(3,3,3)

    The pixel values 1, 2, and 6 in the image ALASKA are reassigned to the value 3. Any other values remain unchanged.

  2. LAS> renumber in=wash out=mask from=10 to=255 backgrnd=0

    All pixel values of 10 in the image WASH are reassigned to 255 in the output image MASK. All other values are set to 0 (zero).

  3. LAS> renumber in=testin out=testout odtype=i*2 infile=fromto

    The from-to pairs listed in the file fromto;txt are used to modify the image data in TESTIN and write it out to image TESTOUT in I*2 format.

Description/Algorithm:

The input image is processed line by line. A look-up table is used to search the input image, and the values in FROM are replaced with the corresponding entries in TO. The FROM and TO values may optionally be specified in an ASCII text file in INFILE. If BACKGRND is specified, the values not in FROM are replaced with BACKGRND. If OUT is NULL, the input image will be updated.

Nonfatal Error Messages:

  1. [renumber-warn] Nonfatal error encountered

    A nonfatal error was encountered. The preceding message is the specific error that occurred.

Fatal Error Messages:

  1. [renumber-alloc] Error allocating dynamic memory

    There has been a problem allocating dynamic memory. Contact the system administrator if problem persists.

  2. [renumber-diff] Different number of FROM and TO inputs

    Restart, using the same number of inputs for FROM and TO

  3. [renumber-dtype] Cannot update image with different data type

    The data type of an existing image cannot be changed. Either set ODTYPE to be the same as the input image data type or specify a different output image.

  4. [renumber-dtype] Input image data I*2 cannot be output as BYTE

    The output data type cannot be smaller than the input data type. For I*2 input images, ODTYPE must be either SAME or I*2.

  5. [renumber-dtype] Input image data type must be BYTE or INTEGER*2

    Restart, using a BYTE or INTEGER*2 input image.

  6. [renumber-fatal] Fatal error encountered

    A fatal error was encountered. The preceding message is the specific error that occurred. Processing terminates.

  7. [renumber-invbgval] BACKGRND must be between <XXX> and <YYY> inclusive

    The BACKGRND must be between <XXX> (minimum for image data type) and <YYY> (maximum for image data type). Respecify BACKGRND and rerun.

  8. [renumber-open] Error opening INFILE

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

  9. [renumber-pairs] The FROM and TO values in INFILE must be in pairs

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

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

    INFILE can have a maximum of 65,536 pairs of values. Reduce the number of pairs and rerun the program.

  11. [renumber-range] FROM and TO values must be between <XXX> and <YYY> inclusive

    The FROM and TO values must be between <XXX> (minimum for image data type) and <YYY> (maximum for image data type). Respecify FROM and TO and rerun.

  12. [renumber-siz] All input images must be same size

    The input images were not the same size. Reenter images with correctly sized windows.

User Notes:

  1. For reassigning ranges of data, the program MAP may be more convenient to use.

  2. The COPY module may be used to change the input image data type to BYTE or INTEGER*2 if necessary.