Perform mappings on selected classes and selected training sites of an image
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.
- 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.
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.
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.
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
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.
The user is given three chances to enter a valid name.
The user is given three chances to enter a valid name.
Specify same number of values in FROM and TO parameters.
The user asked to process more classes than there are available.
The user has been given three chances but still did not enter the valid class name. Restart the program.
The user has been given three chances but still did not enter the valid site name. Restart the program.
Respecify first FROM value within the minimum/maximum pixel values of the input image.
Respecify all FROM values within the minimum/maximum pixel values of the input image.
Respecify all FROM values within the minimum/maximum pixel values of the input image.
Respecify last FROM value within the minimum/maximum pixel values of the input image.
Respecify FROM values in correct order.
Respecify the values for "FROM" or "TO" parameters so that they are within the valid range of the input data type.
ZIP processes a maximum of 1023 polygons.
Either specify the input image without a window or use EDITSTAT to regenerate the polygons on the desired subimage.
The parameter PIXVAL contained an invalid value - respecify PIXVAL.
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.
Respecify with lower number of classes.