help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MATLAB script for parsing ENVI headers?


From: Miroslaw Kwasniak
Subject: Re: MATLAB script for parsing ENVI headers?
Date: Sun, 9 Jan 2005 13:25:46 +0100
User-agent: Mutt/1.5.6+20040907i

On Sat, Jan 08, 2005 at 03:45:32PM -0800, Jonathan Greenberg wrote:
> I was wondering if anyone knew of a MATLAB/Octave script which can parse an
> ENVI header file, retrieving all of the info necessary to import the file
> into MATLAB (number type, endian, samples, lines, bands, etc...)

If you wrote about ENVI by rsinc it's a simple structured text file.
I attached a prototype of function.

Example of run:

octave:1> OCTAVE_VERSION
OCTAVE_VERSION = 2.1.63

octave:2> hdr=read_envi_hdr('x.hdr'); fieldnames (hdr)
{
  [1,1] = band_names
  [2,1] = bands
  [3,1] = byte_order
  [4,1] = data_type
  [5,1] = data_type_txt
  [6,1] = description
  [7,1] = file_type
  [8,1] = fwhm
  [9,1] = header_offset
  [10,1] = interleave
  [11,1] = lines
  [12,1] = samples
  [13,1] = sensor_type
  [14,1] = spectra_names
  [15,1] = wavelength
  [16,1] = z_plot_range
}

Mirek

Attachment: read_envi_hdr.m
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]