Endmembers are spectra that represent pure surface materials in a spectral image. Use the Endmember Collection tool to perform different classification techniques using endmember spectra from a variety of sources.

All the incoming spectra are stored at their native resolution, so that the same collection can be used with rasters with different wavelength ranges and spacings. Also, ENVI saves both the mean spectra and the associated statistics of the ROI (standard deviation, covariance, eigenvectors, and eigenvalues). This means that a saved spectral collection will work with classification methods that require these statistics (Maximum Likelihood, Mahalanobis, and Parallelepiped).

  1. From the Toolbox, select Classification > Endmember Collection. The Spectral Collection Classification dialog appears.
  2. Click the Endmembers folder in the dialog to enable the Import option in the menu.
  3. From the Import drop-down list, select the sources to use for the classification. You can import spectra from more than one source.

    • From Spectral Library: In the Import from Spectral Library dialog, select a Library select one or more Spectra from that library, then click OK.

    • From ROIs: In the Data Selection dialog, browse to select the ROI file for the input raster or, if the ROI file was already open, select the input raster and click OK. In the Import Spectra from ROIs dialog, enable the check boxes for the spectra to import, then click OK.

    • From Vector: In the Data Selection dialog, browse to select the vector file for the input raster or, if the vector file was already open, select the input raster and click OK. In the Convert Vector to ROIs dialog, select the conversion options for the vectors, then click OK.

    • From ASCII file: In the Select ASCII for Input dialog, select a .txt file to open. The ASCII file format is a columnar text file, described below.

    • From Stats file: In the Select ENVI Statistics Filename dialog, select a .sta file to open.

    • From Plot Window: With a Plot or Profile window open, import spectra with one of the following:

      • From the Import menu: Select From Plot Window. From the Import spectra from plot window dialog, select the plot(s) to import and click OK.

      • Drag and drop from the plot key: Click the arrow on the right side of the plot to expand the properties panel, then click and drag the plot key(s) to include onto the Spectral Collection Classification dialog.

      • Right-click menu: Right-click on the Spectral Collection Classification dialog and you will see the plot key(s) of the current plot at the bottom of the list. Select the plot key(s) to use.

    All import selections are added under the Endmembers folder. To remove a selection from the list, right-click on it and select Remove. To remove all spectra from the list, right-click Endmembers and select Remove Spectra.

  4. You can optionally change spectrum names and colors for the classification output. Use one of the following:

    • Select the Endmembers folder, then click the Edit names and colors button . A list of the imported spectra appears.

    • Right-click an individual spectrum in the Endmembers list and select Edit.

    To change the name, enter a new one in the field provided. To change the color, click the color icon and select a new one. Click OK to save the changes.

  5. To plot endmember spectra, select one of the following:

    • Select one or more spectra to plot and click the Plot Spectra button on the toolbar.
    • Right-click on the Endmembers folder and select Plot Spectra to plot all imported spectra.
    • Right click on an individual spectrum under the Endmembers folder and select Plot Spectra to plot it.

    See Spectral Collection Plot for additional details.

  6. Select a Raster and perform optional spatial and spectral subsetting, and/or masking.
  7. Click the Classify button, select one or more methods of classification to perform, then click OK.

    Note: Maximum Likelihood, Mahalanobis Distance, and Parrallelepiped classification require covariances. You need to provide ROIs in the Import step to run these methods.

  8. To save a spectra collection to a .json file for use in a future ENVI session, click the Save Collection button and specify a location and filename. To restore a saved collection, click the Restore Collection button and select a .json file.

ASCII File Format

The ASCII file format should include a header part and a data part.

  • The header part has lines that describe the data fields and related information, such as data source, units, timestamp, names, and colors of endmembers.

  • The data part is a table of all numerical values where column 1 stores the wavelength and columns 2 through x (where x is number of endmembers included in file) store the endmember spectral data.

An example ASCII file:

ENVI ASCII Plot File [Thu Oct 26 14:23:35 2023]
Column 1: Wavelength
Column 2: Min: ROI #1~~2##255,0,0
Column 3: Mean-StdDev: ROI #1~~21##0,200,0
Column 4: Mean: ROI #1~~0##0,0,0
Column 5: Mean+StdDev: ROI #1~~21##0,200,0
Column 6: Max: ROI #1~~2##255,0,0
   365.929800  0.000000  -0.002840  0.000594  0.004028  0.035500
   375.594000  0.000000  -0.003664  0.000866  0.005396  0.041400
   385.262500  0.000000   0.001473  0.012179  0.022884  0.075800
   394.935500  0.006000   0.014289  0.026053  0.037817  0.092100
   404.612900  0.010500   0.017070  0.029485  0.041900  0.099400
   414.294600  0.012500   0.020445  0.033426  0.046407  0.108000
   423.980800  0.015900   0.025730  0.039122  0.052515  0.114200
   433.671300  0.021600   0.032261  0.046269  0.060276  0.124100
   443.366200  0.024900   0.036815  0.051492  0.066169  0.132200

    and so on.