Use Stretch Data to perform file-to-file contrast stretching. The data stretching function is a flexible method for changing the data range of a given input file. You have full control over both the input and output histograms and the output data type (byte, integer, floating-point, and so forth).

  1. From the Toolbox, select Raster Management > Stretch Data.
  2. Select an input file and perform optional spatial and spectral subsetting, then click OK. The Data Stretching dialog appears.
  3. To calculate the statistics based on a statistics subset or the area under an ROI, click Stats Subset.
  4. Select the Stretch Type (Linear, Equalize (histogram equalized), Gaussian, and Square Root) from the appropriate radio button.
  5. If you select Gaussian, enter a standard deviation in the Stdv field.

  6. Select a Stretch Range value of By Percent or By Value from the appropriate radio buttons.
  7. Enter the minimum and maximum values in the Min and Max fields, respectively, to control the input data range.
  8. Set the Output Data Range in the Min and Max fields. The values must match the ranges of the data type selected from the Data Type drop-down list (see next). If out-of-range values are entered, low values are automatically corrected to the minimum and high values are automatically corrected to the maximum of the selected data type.
  9. From the Data Type drop-down list, select the appropriate data type (byte, integer, unsigned integer, long integer, unsigned long integer, 64-bit integer and unsigned 64-bit integer, floating-point, double precision, complex, or double complex).
  10. Select output to File or Memory.
  11. Click OK. If no statistics file exists for the selected input file, ENVI calculates the image statistics before data stretching and an Image Statistics window shows the percent processing complete as a slider that moves from 0 to 100%. If a statistics file already exists (or when the image statistics are calculated) a Data Stretching window shows the percentage of data stretching completed. When complete, ENVI adds the resulting file to the Layer Manager.

Applying Stretches Using the ENVI API


The following tasks are available for ENVI programmers: