User's Guide

ZIP

Perform mappings on selected classes and selected training sites of an image

Function:

Performs mappings on the selected classes and selected sites of an image. Each pixel value within the selected polygons is replaced by either the mean value, a user-specified constant, or a user-specified piecewise linear stretch. The pixel values outside the polygonal sites retain their original values. Other site-modification programs must be run first in order to create an input statistics file for the selection of classes and sites.

Parameters:

IN
The input image on which polygons have previously been selected. Its data type may be BYTE, INTEGER*2, INTEGER*4, or REAL*4. No window may be applied to IN since the polygons may fall outside of the image.

INSTAT
Input statistics file containing the coordinates of the polygon vertices.

OUT
The output image which contains the specified pixel mappings for selected polygons. It has the same size and data type as the input image.

NCLASS(-- )
The number of classes to which mappings will be applied. If default, all available classes and all sites within each class in the statistics file are processed. If NCLASS > 0, the user is prompted NCLASS times for class names. See the Description/Algorithm section for further information.

REPLOPT("MEAN" )
Replacement option. Specifies pixel replacement method.

  = MEAN:  Replace by mean.  Each pixel in the sites
           is replaced by the mean value.
           (See User Note 3.)
  = CONST: Replace by PIXVAL.  Each pixel in the sites
           is replaced by the user-specified constant.  
           (See parameter REPLMODE)
  = MAP:   Replace by mapping.  Replacement is deter-
           mined by the user-specified piecewise 
           linear stretch.  (See parameters FROM and
           TO and User Note 5.)

REPLMODE("SAME" )
Replacement mode. REPLMODE specifies whether or not the one constant value will be assigned to all selected polygons. It is only used when REPLOPT=CONST; otherwise, it is ignored.

  = SAME: Same pixel value  
  = DIFF: Different pixel values (See User Note 4)

PIXVAL(0.0)
Pixel value to be specified when REPLOPT=CONST and REPLMODE=SAME; otherwise, it is ignored.

FROM(0.0,255.0)
Input mapping pair values. Ranges of input values for applying piecewise linear stretch. Must be specified with TO for REPLOPT=MAP; otherwise, it is ignored. At least two values must be specified; and at most 50 values may be entered. Values must be given in ascending order.

TO(0.0,255.0)
Output mapping pair values. Ranges of output values for applying piecewise linear stretch. Must be specified with FROM for REPLOPT=MAP; otherwise it is ignored. At least two values must be specified; and at most 50 values may be entered.

Examples:

  1. LAS> zip in=image.in instat=stat.dat out=image.out nclass=1

    Mapping is performed using polygonal sites in one class selected from the input statistics file, STAT.DAT, for the input image, IMAGE.IN. The mean value for the selected sites in that class is computed first. In the output image, IMAGE.OUT, the selected polygons are filled with the mean value and the pixels in outside areas retain their original values.

  2. LAS> zip in=image.in instat=stat.dat out=image.out replopt=const replmode=diff

    Mapping is performed on all polygonal sites in all classes contained in the input statistics file, STAT.DAT, for the input image, IMAGE.IN. The polygons on the output image, IMAGE.OUT, are filled with constants that the user is prompted for and the areas outside the polygons retain their original values. The polygonal sites in the same class have the same constant. Sites in different classes have different constants as specified by the user.

  3. LAS> zip in=image.in instat=stat.dat out=image.out nclass=2 replopt=map from=(50,100,200,225) to=(60,120,210,240)

    This example applies a piecewise linear stretch to the polygons inside of the BYTE image, IMAGE.IN. The outside areas retain their original values as in the input image, and the inside pixels are changed as follows:

             o  Pixel values from 0 to 50 are mapped to 0 to 60
             o  Pixel values from 50 to 100 are mapped to 60 to 120
             o  Pixel values from 100 to 200 are mapped to 120 to 210
             o  Pixel values from 200 to 225 are mapped to 210 to 240
             o  Pixel values from 225 to 255 are mapped to 240 to 255
    

Description/Algorithm:

ZIP performs the following steps:

  1.  Lets the user select classes and sites if NCLASS > 0.  
      The user is prompted NCLASS times, as follows:

        ENTER CLASS NAME:  enter name of class to be processed
        ENTER CONSTANT FOR CLASS xxxxx:  applies if REPLOPT=CONST 
             and REPLMODE=DIFF
        ENTER NUMBER OF SITES FOR THIS CLASS (<CR> for all):   
             enter number of sites to be processed

      If the response to the number of sites is not <CR> and is 
      not equal to the number of available sites in this class 
      in the input statistics file, the user is prompted:

        ENTER SITE NAMES, ONE PER LINE:  enter names of sites to 
             be processed

  2.  If NCLASS=0 and REPLMODE=DIFF, the user is prompted
      for each of all available classes as follows:

        ENTER CONSTANT VALUE FOR CLASS xxxxx:  specify one 
             constant value for the requested class

  3.  Copies the image to the output and replaces the line
      segments inside the polygons according to the REPLOPT
      parameter.

      For piecewise linear stretching, a look-up table is built
      for BYTE and INTEGER*2 data.  For INTEGER*4 and REAL*4 
      data, linear mappings are applied directly.  If the user 
      specifies N pairs of values for FROM and TO, each of the
      (N+1) input ranges following is mapped linearly to the 
      corresponding output range.

  Input range of pixel values        Output range of pixel values

	Minimum to FROM(1)                   Minimum to TO(1)
	FROM(1) to FROM(2)                   TO(1) to TO(2)
        	  .                                 .
		  .		                    .
	FROM(N-1) to FROM(N)                 TO(N-1) to TO(N)
	FROM(N) to maximum                   TO(N) to maximum

For a BYTE image, (minimum,maximum) is (0,255); INTEGER*2 
(minimum,maximum) is (-32768,32767).  The actual minimum and 
maximum pixel values are used for other data types.

Nonfatal Error Messages:

  1. [zip-cname] Class not found; 3 chances to reenter a class name

    The user is given three chances to enter a valid name.

  2. [zip-sname] Site not found; 3 Chances to reenter a site name

    The user is given three chances to enter a valid name.

Fatal Error Messages:

  1. [zip-map] Incomplete mapping pair specified

    Specify same number of values in FROM and TO parameters.

  2. [zip-class] Too many classes requested; restart

    The user asked to process more classes than there are available.

  3. [zip-cname] 3 Errors for class name; restart

    The user has been given three chances but still did not enter the valid class name. Restart the program.

  4. [zip-sname] 3 Errors for site name; restart

    The user has been given three chances but still did not enter the valid site name. Restart the program.

  5. [zip-from] First "FROM" value smaller than minimum pixel value

    Respecify first FROM value within the minimum/maximum pixel values of the input image.

  6. [zip-from] Last "FROM" value smaller than minimum pixel value

    Respecify all FROM values within the minimum/maximum pixel values of the input image.

  7. [zip-from] First "FROM" value larger than maximum pixel value

    Respecify all FROM values within the minimum/maximum pixel values of the input image.

  8. [zip-from] Last "FROM" value larger than maximum pixel value

    Respecify last FROM value within the minimum/maximum pixel values of the input image.

  9. [zip-from] "FROM" values specified in wrong order; they must be entered in ascending order

    Respecify FROM values in correct order.

  10. [zip-range] Parameter values do not conform to input data type

    Respecify the values for "FROM" or "TO" parameters so that they are within the valid range of the input data type.

  11. [zip-nsites] Total number of selected sites for all selected classes exceeds 1023; restart

    ZIP processes a maximum of 1023 polygons.

  12. [zip-wind] No window permitted for the input image

    Either specify the input image without a window or use EDITSTAT to regenerate the polygons on the desired subimage.

  13. [zip-pixval] Specified constant is incompatible with input/output data type

    The parameter PIXVAL contained an invalid value - respecify PIXVAL.

  14. [zip-nosit] No sites within image bounds

    All input polygons are either partially or completely outside of the input image. This is probably caused by using an input image that differs from the image used to generate the polygons.

  15. [zip-nclass] Number of classes specified exceed number in file

    Respecify with lower number of classes.

User Notes:

  1. The output image has the same size, data type, and number of bands as the input image.

  2. ZIP allows one REPLOPT option per run. For each REPLOPT option, the mapping is applied to the classes and the sites selected from the statistics file by the user. A maximum of 1023 polygons can be processed.

  3. For mapping by mean value (REPLOPT=MEAN), the mean value is computed for each of the selected classes. Each mean value is the mean of the combined sites that have been selected in that class from the statistics file. The mean values are displayed on the terminal.

  4. For mapping by constant (REPLOPT=CONST), the user may specify one constant for each of the selected classes. All selected sites in the REPLMODE class use the REPLMODE constant. If REPLMODE=DIFF, the user is prompted for constants for each of the classes. ZIP must be run interactively if REPLMODE=DIFF

  5. For mapping by piecewise linear stretch (REPLOPT=MAP), one set of FROM and TO pairs applies to all selected sites in all selected classes.

  6. ZIP must be run interactively if the number of classes (NCLASS) is non-zero. The specific classes and/or sites are prompted for interactively.