Description of hyperspectral file format
This document contains a short description of the default file format that Prediktera Evince and Breeze software use to save and load hyper/multi-spectral data cubes.
The format has its origin from a format called ENVI, but only a subset of that format is used. The file format uses two files:
-
a header file with the extension
.hdr. This is a text file that can be viewed for example in Notepad. -
a binary file with the extension
.raw.
For example: measurement.hdr and measurement.raw.
Header file specification
The required parts that must be in the header file are specified below:
-
description-
Description of the header file. With additional Breeze specific fields.
-
-
file type-
Should always be
ENVI.
-
-
interleave-
Refers to whether the data are
BSQ,BIP, orBIL(default).
-
-
samples-
The number of samples (pixels) per image line for each band.
-
-
lines-
The number of lines per image for each band
-
-
bands-
The number of bands per image file.
-
-
default bands-
Band Index for Red, Green and Blue default bands, used for visualizations.
-
-
header offset-
Offset in bytes if raw file contains binary header
-
-
data type-
Valid data type representation:
-
|
|
Explanation |
|---|---|
|
|
8-bit unsigned byte |
|
|
16-bit signed integer |
|
|
32-bit signed long integer |
|
|
32-bit floating point |
|
|
64-bit unsigned double precision floating point |
|
|
16-bit unsigned integer |
|
|
32-bit unsigned long integer |
|
|
64-bit signed long integer |
|
|
64-bit unsigned long integer |
-
byte order-
The order of the bytes in integer, long integer, 64-bit integer, unsigned 64-bit integer, floating point, double precision, and complex data types. Use one of the following:
-
|
|
Explanation |
|---|---|
|
|
(Host (Intel) in the Header Info dialog) is least significant byte first (LSF) data (DEC and MS-DOS systems). |
|
|
(Network (IEEE) in the Header Info dialog) is most significant byte first (MSF) data (all other platforms). |
-
Wavelength-
Lists the center wavelength values of each band in an image.
-
You can read the full ENVI header file specification at the ENVI web site: ENVI Header Files.
Example of header file
The Wavelength entry has been truncated for brevity.
ENVI
description = { Exported from Breeze. Converted to Reflectance
origfile = C:\Users\oskar\Downloads\mica_hyspex\Box 128_ref.raw }
file type = ENVI
interleave = BIL
samples = 867
lines = 384
bands = 288
default bands = {50, 130, 220}
header offset = 0
data type = 4
byte order = 0
errors = {none}
Wavelength = {
952.7185146625646,
958.163523875658,
963.6085330887516,
969.0535423018451,
974.4985515149386,
979.9435607280323,
985.3885699411258,
....
2482.7661035418473,
2488.2111127549406,
2493.6561219680343,
2499.101131181128,
2504.5461403942213,
2509.9911496073146,
2515.4361588204083
}
Binary file specification
The binary file format is written using one of the data types specified in the header file. How the data is stored is depending on the interleave flag. Prediktera uses the interleave BIL as default which stores one frame (samples * bands) after each other (lines).