comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: What exactly is ENVI format?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: What exactly is ENVI format? [message #56549] Mon, 29 October 2007 13:54
rpertaub@gmail.com is currently offline  rpertaub@gmail.com
Messages: 43
Registered: January 2007
Member
No Message Body
Re: What exactly is ENVI format? [message #56550 is a reply to message #56549] Mon, 29 October 2007 13:33 Go to previous message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
rpertaub@gmail.com wrote:
> Hi,
> Since I know this forum is consulted by many experts, I thought I'd
> inquire here. First, I use IDL, and do not have ENVI. However, I do
> know I can work with envi format images in IDL. I know that because I
> was told that, and was provided with algorithms to convert my raw
> images into envi format images. I know envi format is a standard
> format used by the imaging community and has a header. That's all I
> know. What exactly is an envi format anyway?
> Any answer would be great, the more info I have the better...
> Thanks,
> RP

The Envi help file says:

ENVI Image Files
ENVI uses a general raster data format consisting of a simple flat
binary file and a small associated ASCII (text) header file. This
enables ENVI's flexible use of nearly any image format, including those
with embedded header information. Because ENVI uses ASCII header files
that are built on-the-fly if required, you typically do not need to
convert your image file formats. ENVI supports MSS, TM, SPOT, ERS-1,
AVHRR, AVIRIS, GERIS, GEOSCAN, TIMS, digitized aerial photographs, DEM
data, AIRSAR, RADARSAT, and SIR-C data in their native formats (byte,
signed and unsigned integer, long integer, floating point, double
precision, 64-bit integer, unsigned 64-bit integer, complex, or double
complex). The general raster data is stored as a binary stream of bytes
either in Band Sequential Format (BSQ), Band Interleaved by Pixel Format
(BIP), or Band Interleaved by Line Format (BIL) formats.
BSQ
BSQ format is the simplest format, where each line of the data is
followed immediately by the next line in the same spectral band. This
format is optimal for spatial (x,y) access of any part of a single
spectral band.
BIP
BIP format stores the first pixel for all bands in sequential order,
followed by the second pixel for all bands, followed by the third pixel
for all bands, and so forth, interleaved up to the number of pixels.
This format provides optimum performance for spectral (z) access of the
image data.
BIL
BIL format stores the first line of the first band, followed by the
first line of the second band, followed by the first line of the third
band, interleaved up to the number of bands. Subsequent lines for each
band are interleaved in similar fashion. This format provides a
compromise in performance between spatial and spectral processing and is
the recommended file format for most ENVI processing tasks.





Working with Header Files
The ENVI header file contains information ENVI uses to read an image
data file. ENVI typically creates a header file the first time you
access a data file in a format that it does not automatically recognize.
You enter the required information in the Header Info dialog, which
appears when the file is opened (see Creating Header Files). You can
later edit the information using the Edit ENVI Header option (Editing
Header Files).
You can also generate an ENVI header outside ENVI using a text editor.
The file must start with the text string ENVI for ENVI to recognize it
as a native file header. Keywords within the file indicate critical file
information. You can add comments to the file by inserting a line with a
semicolon as the first character. ENVI ignores these lines when parsing
the header file. Comments can appear anywhere within a header file, but
they must be on their own line, and the semicolon must be the first
character of that line. Comments cannot follow a keyword/value pair.
A description of the keywords for an ENVI header file follows. See
Example ENVI Header File for an example header file.
Table 5-1: Header File Keywords

Field
Description
description
A character string describing the image or the processing performed.
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.
header offset
The number of bytes of imbedded header information present in the file
(for example, 128 bytes for ERDAS 7.5 .lan files). ENVI skips these
bytes when reading the file.
file type
The ENVI-defined file type, such as a certain data format and processing
result. The available file types are listed in the filetype.txt file
(see ENVI File Type File). The file type ASCII string must match an
entry in the filetype.txt file verbatim, including case.
data type
The type of data representation, where 1=8-bit byte; 2=16-bit signed
integer; 3=32-bit signed long integer; 4=32-bit floating point; 5=64-bit
double-precision floating point; 6=2x32-bit complex, real-imaginary pair
of double precision; 9=2x64-bit double-precision complex, real-imaginary
pair of double precision; 12=16-bit unsigned integer; 13=32-bit unsigned
long integer; 14=64-bit signed long integer; and 15=64-bit unsigned long
integer.
interleave
Refers to whether the data are BSQ, BIP, or BIL.
sensor type
Instrument types, such as Landsat TM, SPOT, RADARSAT, and so on. The
available sensor types are the sensor.txt file described in ENVI Sensor
File. The sensor type ASCII string defined here must match one of the
entries in the sensor.txt file verbatim., including case.
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:
Byte order=0 (Host (Intel) in the Header Info dialog) is least
significant byte first (LSF) data (DEC and MS-DOS systems).

Byte order=1 (Network (IEEE) in the Header Info dialog) is most
significant byte first (MSF) data (all other platforms).
x start and y start
Defines the image coordinates for the upper-left hand pixel in the
image. Images that are spatial subsets of larger images often use an
image coordinate system that references the parent (or larger) image so
that you can link and dynamically overlay the two images. The default
values are (1,1) so that the upper-left hand pixel has an image
coordinate of (1,1).
Note - Changing these values does not affect the way ENVI reads the
image data from the file.
map info
Lists geographic coordinates information in the order of projection name
(UTM), reference pixel x location (in file coordinates), pixel y, pixel
easting, pixel northing, x pixel size, y pixel size, projection zone,
North or South (UTM only).
Note - In ENVI, pixel values always refer to the upper-left corner of
the pixel. Map coordinates also typically refer to the upper-left corner
of the pixel. However, if you entered "magic pixel" coordinates in the
ENVI header, the map coordinates would refer to the x,y coordinates
entered. For example, x=1.5, y=1.5 would make the map coordinates refer
to the center of the pixel.
projection info
Describes user-defined projection information. This keyword is added to
the ENVI header file if a the file uses a user-defined projection
instead of a standard projection. ENVI uses this information to read the
file on machines that do not contain this user-defined projection in the
map_proj\map_proj.txt file.
default bands
If set, indicates which band numbers to automatically load into the
Available Bands List gray scale or R, G, and B fields every time the
file is opened. By default, a new image is automatically loaded when a
file that has default bands defined in its header is opened. If only one
band number is used, then ENVI loads a gray scale image.
wavelength units
Text string indicating the wavelength units.
reflectance scale factor
The value that, when divided into your data, would scale it from 0-1
reflectance.
z plot range
Values indicating the default minimum and maximum values for Z plots.
z plot average
Values indicate the number of pixels in the x and y directions to
average for Z plots.
z plot titles
Allows entry of specific x and y axis titles for Z plots.
data ignore value
Currently used only in ENVI programming (see ENVI_FILE_QUERY for more
information).
pixel size
Indicates x and y pixel size in meters for non-georeferenced files.
default stretch
Determines what type of stretch (% linear, linear range, Gaussian,
equalization, square root) to use when ENVI displays the image.
band names
Allows entry of specific names for each band of an image.
wavelength
Lists the center wavelength values of each band in an image. Units
should be the same as those used for the fwhm field (described next) and
set in the wavelength units parameter.
fwhm
Lists full-width-half-maximum (FWHM) values of each band in an image.
Units should be the same as those used for wavelength and set in the
wavelength units parameter.
bbl
Lists the bad band multiplier values of each band in an image, typically
0 for bad bands and 1 for good bands.
data gain values
Gain values for each band.
data offset values
Offset values for each band.
Class Keywords
Classification results files contain the following additional keywords:
classes
Defines the number of classes, including the unclassified.
class lookup
Lists RGB color definitions for each respective class, and class names.
class names
Lists the classification names.
Spectral Library Keyword
Spectral library files will contain the following additional keyword:
spectra names
Contains a comma-separated list of ASCII names enclosed in {curly
brackets}.

Example ENVI Header File
A typical ENVI header file looks like this:
ENVI
description = {
Registration Result. Method1st degree Polynomial w/ nearest
neighbor [Wed Dec 20 23:59:19 1995] }
samples = 709
lines = 946
bands = 7
header offset = 0
file type = ENVI Standard
data type = 1
interleave = bsq
sensor type = Landsat TM
byte order = 0
map info = {UTM, 1, 1, 295380.000, 4763640.000, 30.000000,
30.000000, 13, North}
z plot range = {0.00, 255.00}
z plot titles = {Wavelength, Reflectance}
pixel size = {30.000000, 30.000000}
default stretch = 5.0% linear
band names = {
Warp (Band 1:rs_tm.img), Warp (Band 2:rs_tm.img), Warp (Band
3:rs_tm.img), Warp (Band 4:rs_tm.img), Warp (Band 5:rs_tm.img),
Warp (Band 6:rs_tm.img), Warp (Band 7:rs_tm.img)}
wavelength = {
0.485000, 0.560000, 0.660000, 0.830000, 1.650000, 11.400000,
2.215000}
fwhm = {
0.070000, 0.080000, 0.060000, 0.140000, 0.200000, 2.100000,
0.270000}
Classification results files include the following additional keywords:
classes = 4
class lookup = { 0, 0, 0,255, 0, 0, 0,255, 0,255,255, 0}
class names = {
Unclassified,
region 1,
region 2,
region 3}
Spectral library files include the following additional keywords:
spectra names = {
ACTINOLITE IN-4A, ALBITE TS-6A, ALMANDINE GARNET NS-4A, ALUNITE
SO-4A,
AMBLYGONITE P-3A, ANALCIME TS-18A, ANATASE SYNTHETIC O-12A,
ANDESINE TS-4A, ANGLESITE SO-10A, ANHYDRITE SO-1A, ANORTHITE TS-
5A,
ANTHOPHYLLITE IN-8A, ANTLERITE SO-11A, APATITE P-1A, APHTHITALITE
SO-9A}


Jean
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: What exactly is ENVI format?
Next Topic: IDL + Leopard

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:07:16 PDT 2025

Total time taken to generate the page: 0.00673 seconds