Use Pixel Purity Index (PPI) to find the most spectrally pure (extreme) pixels in multispectral and hyperspectral images. These typically correspond to mixing endmembers. The PPI is computed by repeatedly projecting n-D scatter plots on a random unit vector. ENVI records the extreme pixels in each projection (those pixels that fall onto the ends of the unit vector) and it notes the total number of times each pixel is marked as extreme. A Pixel Purity Image is created where each pixel value corresponds to the number of times that pixel was recorded as extreme.

The PPI function can create a new output band or continue its iterations and add the results to an existing output band. The PPI is typically run on an MNF transform result, excluding the noise bands. The results of the PPI are usually used as input into the n-Dimensional Visualizer.

You can write a script to create a PPI image using the PixelPurityIndex task.

Note: See Spectral Hourglass Workflow for instructions on the ENVI hourglass processing flow, including the PPI, to find and map image spectral endmembers from hyperspectral or multispectral data.

See the following sections:

FAST Pixel Purity Index


You can choose a disk-based PPI method or a FAST PPI method. The FAST PPI method places the image data into memory and performs the computations in memory, which is much faster than the disk-based PPI method, but requires adequate memory. Use spatial and spectral subsetting or a more sparse array of the data (through subsampled resolution) to fit the image data into memory. ENVI informs you of the amount of memory necessary to perform the FAST PPI and prompts you for continuation. When using FAST PPI, you also have the option to create a new output file or to add to an existing output band.

Selecting Input Files


Use New Output Band the first time you run the PPI. ENVI creates an output band containing the number of times each pixel was found to be extreme (pure). You can use this as input into the n-D Visualizer.

  1. From the Toolbox, select one of the following options:
    • Spectral > Pixel Purity Index > Pixel Purity Index (PPI) New Output Band
    • Spectral > Pixel Purity Index > Pixel Purity Index (PPI) [FAST] New Output Band.
  2. Select the input file and perform optional spatial and spectral subsetting, and/or masking, then click OK.
  3. Note: You typically run the PPI on an MNF transform result and use spectral subsetting to exclude noise bands based on the eigenimages and eigenvalue plot.

  4. Click OK. The Pixel Purity Index Parameters or FAST Pixel Purity Index Parameters dialog appears, depending on which menu item you selected in step 1.

Setting the Number of Iterations

  1. Enter a Number of Iterations value. The maximum number of iterations is 32,767. With more iterations, ENVI does a better job of finding the extreme pixels. Balance the number of iterations against the time available, as each iteration can take some time depending on the CPU and system load. Typically, thousands of iterations are required for imaging hyperspectral data. The resulting image header file will list the number of iterations run.
  2. The Iterations per Block field, which appears only in the Pixel Purity Index Parameters dialog, indicates how many iterations ENVI should perform at once, and it determines the resolution of the PPI plot. Specifying a block size means that data points are plotted every nth iteration instead of each iteration. The default value of 250 provides reasonable performance; you should not change this value.

Setting the Threshold Factor

Enter a Threshold Factor value in data units for extreme pixel selection.

For example, a value of 2 flags all pixels greater than two DN values from the extreme pixels (both high and low) as extreme. This threshold selects the pixels on the ends of the projected vector. The threshold should be approximately two to three times the noise level in the data. Landsat TM data, for example, typically have less than 1 DN of noise, so a threshold value of 2 or 3 works well. When using MNF data, which normalizes the noise, a DN is equivalent to one sigma, so a threshold value of 2 or 3 works well. Larger thresholds cause the PPI to find more extreme pixels, but they are less likely to be pure endmembers.

Subsampling the Data

The X Resize Factor and Y Resize Factor fields are only available when you select the [FAST] New Output Band option. To subsample the data and help fit them into memory, enter X Resize Factor and Y Resize Factor values less than 1. For example, a resize factor of 0.5 uses every other pixel. However, you should not subsample less than 0.25 (every fourth pixel) because extreme pixels may be discarded.

Starting the Processing

  1. In the Pixel Purity Index Parameters dialog, select output to File or Memory.
  2. Click OK. If you are using the FAST PPI, a dialog appears that indicates the amount of memory needed and prompts you to continue if that amount of memory is acceptable.
  3. A processing status dialog appears with the PPI plot. This plot shows the total number of extreme pixels satisfying the threshold criterion found by the PPI processing as a function of the number of iterations. It should asymptotically approach a flat line (zero slope) when all of the extreme pixels are found.

Restarting or Continuing PPI


Use Existing Output Band or [FAST] Existing Output Band if you clicked Cancel and PPI was interrupted during processing, or use either option if you want to continue additional iterations on a PPI result.

  1. From the Toolbox, select one of the following options:
    • Spectral > Pixel Purity Index > Pixel Purity Index (PPI) Existing Output Band
    • Spectral > Pixel Purity Index > Pixel Purity Index (PPI) [FAST] Existing Output Band.
  2. Select an input file (a spectrally subsetted MNF is recommended).
  3. Click OK. The Pixel Purity Index Previous Result dialog appears.
  4. Select a previous PPI image as the input file.
  5. Click OK. The Pixel Purity Index Parameters dialog appears.
  6. Enter the parameters as described in Setting the Number of Iterations and Setting the Threshold Factor.
  7. Click OK. A processing status dialog and Pixel Purity Index Plot appear. ENVI adds the resulting output to the Layer Manager.