enviinfo
R2026bRead metadata from ENVI header file
Syntax
Description
Add-On Required: This feature requires the Hyperspectral Imaging Library for Image Processing Toolbox add-on.
Examples
Read an ENVI header file into the workspace.
info = enviinfo("paviaU.hdr");Create a hypercube object using the Filename of the ENVI header file.
hcube = imhypercube(info.Filename)
hcube =
hypercube with properties:
ImageDims: "[610x340x103 double]"
Wavelength: [103×1 double]
Metadata: [1×1 struct]
BlockSize: [610 340]
Read an ENVI header file into the workspace.
info = enviinfo("indian_pines");Read from the ENVI binary data file by using the metadata from the ENVI header file.
data = multibandread('indian_pines.dat',... [info.Height info.Width info.Bands],... info.DataType,info.HeaderOffset,info.Interleave,info.ByteOrder);
Input Arguments
Name of ENVI header file, specified as a string scalar or character vector. An ENVI
header file must have the extension .hdr. If you do not specify a
file extension, then the function looks for a file with the specified name and the
.hdr file extension.
You can import valid data from URLs and remote locations, such as cloud services,
for easier collaboration and data management. Depending on the location of your file,
file can take one of these forms.
Location | Form | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Current folder or folder on the MATLAB path | Specify the name of the file in
Example:
| ||||||||
File in a folder | If the file is not in the current folder or in a folder on the MATLAB path, then specify the full or relative path name. Example:
Example:
| ||||||||
| Uniform resource locator (URL) | If you specify the file as an internet URL, then
Example:
| ||||||||
Remote location | If the file is stored at a remote location, then
Based on the remote location,
For more information, see Work with Remote Data. Example:
|
The function downloads each new remote file only once per session to a temporary directory. If you access the same remote data again during the same MATLAB session, the function uses the downloaded file from the temporary directory.
Data Types: char | string
Output Arguments
Information about ENVI data and metadata from the header file, returned as a structure array. If the header file contains any of these fields, they must be in the specified format.
| Field | Description |
|---|---|
Height | Height of the image or number of rows in the image, returned as a positive integer. |
Width | Width of the image or number of columns in the image, returned as a positive integer. |
Bands | Number of spectral bands, returned as a positive integer. |
DataType | Data type of data in the ENVI file, returned as any of these values:
|
Interleave | Data interleave, returned as any one of these values:
|
HeaderOffset | Zero-based location of the first element in the image file, returned as a positive integer. The header offset represents the number of bytes from the beginning of the image file to the start of the image data. |
ByteOrder | Endianness of the data, returned as the string
"ieee-le" for little endian or
"ieee-be" for big endian. |
Version History
Introduced in R2020aFor easier collaboration and data management, you can import valid data from URLs and remote locations such as cloud services.
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.
Amerika
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)