ImportEnviData

Declaration: ImportEnviData(FName, FExt: string; SpecType: TLayerType; MirrorY, FeedBack: boolean): integer;
Imports a data file stored in the ENVI format. The parameter FName specifies the full file path of the ENVI header data. The parameter FExt specifies the file extension of the binary data part of an ENVI file. Setting it to '*' forces the function to search for data files having the extensions '.dat', '.img' or no extensions at all.

The parameter SpecType determines the type of expected spectra.1) It may assume one of the following values:

ctUndefined .... undefined/unknown property type
ctIRspec ....... IR spectrum
ctMSPos ........ MS positive spectrum (lines)
ctMSPosRaw ..... MS positive spectrum (continuous)
ctMSNeg ........ MS negative spectrum (lines)
ctMSNegRaw ..... MS negative spectrum (continuous)
ctMSsim ........ MS single ion monitoring (lines)
ctRaman ........ Raman spectrum
ctUvVis ........ UV/VIS/NIR spectrum
ctColor ........ individual color
ctRGBcolors .... red green and blue from a color image (always three layers!)
ctBwImg ........ black and white image (gray scale 0..255 per pixel)
ctPixMask ...... pixel mask (deprecated!! masks are managed in an extra structure from version 1.0 upwards)
ctPhysProp ..... physical properties
ctTHzSpec ...... THz spectrum
ctImpulse ...... impulse over time
ctOESRaw ....... optical emission spectroscopy (single lines)
ctOESsl ........ optical emission spectroscopy (single lines)
ctEDX .......... energy dispersive xray
ctSIMS ......... SIMS lines
ctAFM .......... AFM layers
ctIRdiscrete ... discrete infrared lines
ctClassMap ..... classification results
ctChemMap ...... chemical map
ctSpecDesc ..... spectral descriptor
ctPhaseSpec .... phase spectrum
ctMagSpec ...... magnitude spectrum
ctPowerSpec .... power spectrum
ctLibsRaw ...... LIBS raw data (continuous spectrum)
ctLibssl ....... LIBS single line data
ctInvalid ...... indicates an invalid layer type

The parameter Feedback controls whether a visual feedback is provided during the import of the data. The parameter MirrorY allows to mirror the image in y direction. The function returns the following error codes:

 0 ... everything is OK, variable parameters are filled accordingly
-1 ... the file does not exist
-2 ... the file is not an ENVI header file
-3 ... the time stamp specification does not conform to the expected format
-4 ... unrecognized file type
-5 ... the size of the binary file does not match the header specifications
-6 ... the binary file contains an invalid number (NaN)
-7 ... the binary file contains an infinite number
-8 ... the binary file contains complex numbers



1) The type of the spectra in an ENVI file is not fully specified in the ENVI header file. ImageLab supports the proprietary keyword sensor type, which contains information of the spectral type. However, as this is a non-standard keyword, the information on the spectral type is overwritten by the value of SpecType when importing ENVI data.


Last Update: 2020-Jšn-25