Import Spectra
You can import endmember spectra from the following:
- Spectral libraries
- ROIs or vectors
- ASCII files
- Statistics files
- Plot windows
- ASD binary files
- Endmember Collection files
When using the Mahalanobis distance or maximum likelihood classifiers, you can only import the endmember spectra from ROIs or statistics files because these classifications use the endmember covariance statistics.
Import Spectra from Spectral Libraries
- Select Import > from Spectral Library. The Input File dialog appears.
- Choose the spectral library name.
- Click OK. The Input Spectral Library dialog appears. If the desired spectral library was not previously opened, select File > Open Spectral Library in the Input File dialog.
- Select endmember spectra by selecting the spectrum names.
-
Change the Wavelength Units and Y Scale Factor parameters as needed.
If the Reflectance Scale Factor parameter is set in both the spectral library header and the image data header, then ENVI will automatically scale the library data to match the image data. If one of the two data sources has no scale factor in its header, then no scaling will be done.
- Click OK to enter the selected spectra into the Endmember Spectra list.
Import Spectra from ROIs and Vectors
You can import mean spectra from previously defined ROIs or vectors open in the Available Vectors List. You can associate these ROIs and vectors with either the current input file or another file.
Import ROIs and Vectors Associated with Current File
- From the Endmember Collection dialog menu bar, select Import > from ROI/EVF from input file. The Select Regions for Stats Calculation dialog appears. The Select Regions for Stats Calculation dialog is only provided if more than one ROI or vector is available.
- Select endmember spectra (ROI or vector averages) by selecting the ROI or vector names. To open an ROI or EVF file, click Open ROI/EVF file. The Enter ROI/EVF Filenames dialog appears. Use this dialog to select and open ROI and EVF files. The Select Regions for Stats Calculation dialog is updated with the ROIs and vectors from the open files.
- Click OK to enter the ROI and vector means into the Endmember Spectra list.
Import ROIs and Vectors Associated with Another File
- From the Endmember Collection dialog menu bar, select Import > from ROI/EVF from other file. The Input File of associated ROI/EVF dialog appears.
- Select the input file. The Select Regions for Stats Calculation dialog appears. The Select Regions for Stats Calculation dialog is only provided if more than one ROI or vector is available.
- Select endmember spectra (ROI or vector averages) by selecting the ROI or vector names. To open an ROI or EVF file, click Open ROI/EVF file. The Enter ROI/EVF Filenames dialog appears. Use this dialog to select and open ROI and EVF files. The Select Regions for Stats Calculation dialog is updated with the ROIs and vectors from the open files.
- Click OK to enter the ROI and vector means into the Endmember Spectra list.
Import Spectra from ASCII Files
- From the Endmember Collection dialog menu bar, select Import > from ASCII File. The Select ASCII Files to Import dialog appears.
- Select an ASCII file or a group of ASCII files of the same format and click Open. The Input ASCII File dialog appears, with a list of the number of columns and rows and the first few data values of each column of data.
- Enter the X Axis Column number that contains the x axis data.
- Select the endmember spectra to import in the Select Y Axis Columns area.
- Change the Wavelength Units and Y Scale Factor parameters as needed.
- Click OK to enter the selected endmember spectra into the list on the Endmember Collection dialog.
Import Additional ASCII Files
To select another ASCII file and read the data using the settings previously defined the Input ASCII File dialog:
- From the Endmember Collection dialog menu bar, select Import > from ASCII file (previous template). The Select ASCII Files to Import dialog appears.
- Select an ASCII file and click Open. This option reads the data directly into the Endmember Collection dialog without the intermediate parameter dialog.
Import Spectra from ASD Binary Files
- From the Endmember Collection dialog menu bar, select Import > From ASD Binary File. The Enter ASD Files to Import dialog appears.
- Select the ASD file or files and click Open. ENVI automatically resamples the file to match the wavelengths from a data file, ASCII file, or first imported spectrum as designated when the Spectral Library Builder function was started. If importing the ASD file from the Endmember Collection dialog, ENVI automatically resamples the first input spectrum.
If the range of the ASD file does not match the range of the input wavelengths, all zeroes will result.
Import Spectra from Statistics Files
Use from Stats file to import the mean spectrum from a previous classification result that was calculated using the Statistics option in the Toolbox.
-
Select Import > from Stats file. The Enter Statistics Filename dialog appears.
-
Select one or more statistics files.
-
Click OK. The mean spectrum from the statistics file is entered into the list on the Endmember Collection dialog.
Import Spectra from Plot Windows
You can import spectra from plot windows by using the right-click menu, by dragging and dropping the spectra from the plot window to the Endmember Spectra table, or by using a dialog box menu option, as described in the next sections.
Right-Click Menu
Use the following steps to derive spectra from the Spectral Profile plot window for your displayed image and import them into the Endmember Spectra table.
- If your image is displayed in a display group (only available from certain tools), you can right-click in the display group and select Z Profile (Spectrum). The Spectral Profile plot window appears.
- From the Spectral Profile plot window menu bar, select Options > Collect Spectra.
- Click on the spectra you want to collect for the Endmember Spectra table.
-
In the Endmember Collection dialog, right-click on either an empty space in the table or on the upper-left corner of the table. The resulting menu contains all the available spectra from every displayed plot window.
If no spectrum was available in any plot window, the right-click menu states that no spectrum is available.
- Left-click on the spectra you want to import into the table. The selected spectra appears in the Endmember Spectra table.
- Use the right-click menu to import all of the spectrum you want to include in the table.
Drag and Drop Spectra
You can also drag-and-drop a spectrum from the Spectral Profile plot window key to the Endmember Spectra table to collect it in the Endmember Collection dialog.
- From the Spectral Profile plot window menu bar, select Options > Plot Key. The key (legend) for the plot window appears to the right of the spectral plot.
- Click and drag the key of a spectrum into the Endmember Spectra table. The spectrum appears in the Endmember Collection table.
Endmember Collection Dialog Menu Option
You can also import multiple spectra by using an Endmember Collection dialog menu option.
- From the Endmember Collection dialog menu bar, select Import > from Plot Windows. The Import from Plot Windows dialog appears.
- Select one or more spectra.
- Click OK. The selected spectra appear in the Endmember Collection dialog.
Import Spectra from Endmember Collection Files
Use from Endmember Collection file to import an Endmember Collection file.
- From the Endmember Collection dialog menu bar, select Import > from Endmember Collection file. The Select Endmember Collection File to Import dialog appears.
- Select and open an Endmember Collection
.txt
file. ENVI updates the Endmember Collection dialog with the spectra from the specified file.