A BBB image consists of two files, a binary file containing only the raw sample values of the image and a text file describing the image properties. The raw data may be organized in one of three layouts: "band-interleaved by pixel" (BIP), "band-interleaved by line" (BIL), and "band sequential" (BSQ). The three formats are collectively referred to as the BBB file format.
Because BBB files only contain raw data with an easily editable header format, they are often used as a "least common denominator" interchange format. However, there is no set standard for the keywords that may be contained in the header. This document describes the header format that GeoExpress supports.
GeoExpress recognizes four filename extensions: ".bip", ".bil", ".bsq", and ".bbb". The first three imply the layout is BIP, BIL, or BSQ respectively; the ".bbb" extension implies the default layout, which is BIP. The header file for a BBB image has the same name as the image, but with a ".hdr" extension.
The header file is a simple text file containing keywords and their associated value, one keyword/value(s) set per line. All keywords and values are case-insensitive. Blank lines are ignored. Leading and trailing whitespace is ignored. A line that begins with a '#' character, possibly preceded by whitespace, indicates a comment line. Comment lines are ignored.
The keywords and their allowed values are as follows:
Keyword | Description | Notes |
---|---|---|
BANDGAPBYTES | Corresponding metadata tags are created, but the actual values are not used in setting the geocoordinates of the input image | |
BANDROWBYTES | Corresponding metadata tags are created, but the actual values are not used in setting the geocoordinates of the input image | |
BANDS | Same as NBANDS |
|
BYTE_ORDER | Endianness interpretation of data |
Allowed values: The value Default: host endianness |
BYTEORDER | Same as BYTE_ORDER |
|
COLORSPACE | The colorspace of the image |
Allowed values: Default: |
COLS | Same as NCOLS | |
DATATYPE | The data type of the samples |
Allowed values: Default: |
DYNAMICRANGELEVEL | The midpoint of the range of the data |
Allowed values: a single floating-point value (applies to all bands) Default: (none) |
DYNAMICRANGEMAX | The maximum dynamic range |
Allowed values: a single floating-point value (applies to all bands) Default: |
DYNAMICRANGEMIN | The minimum dynamic range |
Allowed values: a single floating-point value (applies to all bands) Default: |
DYNAMICRANGEWINDOW | The size of the range of the data |
Allowed values: a single floating-point value (applies to all bands) Default: |
E_SQUARED | Sphere eccentricity squared, for georeferencing | Corresponding metadata tags are created, but the actual values are not used in setting the geocoordinates of the input image |
INTERLEAVING | Same as LAYOUT | |
LAYOUT | The data layout; use of this keyword overrides the layout implied by the filename extension |
Allowed values: The value Default: |
MAP_UNITS | Measurement unit for georeferencing | Corresponding metadata tags are created, but the actual values are not used in setting the geocoordinates of the input image |
NBANDS | The number of bands in the image |
Allowed values: 1-65535 Default: (none; this keyword is required) |
NBITS | Number of bits used per sample |
Allowed values: 1 to (total number of bits per sample) Default: the total number of bits per sample |
NCOLS | Width of image, in pixels |
Allowed values: 1 to 2^31 Default: (none; this keyword is required) |
NROWS | Height of image, in pixels |
Allowed values: 1 to 2^31 Default: (none; this keyword is required) |
PIXEL_HEIGHT | Same as YDIM | |
PIXEL_WIDTH | Same as XDIM | |
PROJECTION_NAME | Name of projection system, for georeferencing | Corresponding metadata tags are created, but the actual values are not used in setting the geocoordinates of the input image |
PROJECTION_PARAMETERS | Numeric projection parameters, for georeferencing | Corresponding metadata tags are created, but the actual values are not used in setting the geocoordinates of the input image |
PROJECTION_ZONE | Projection zone number, for georeferencing | Corresponding metadata tags are created, but the actual values are not used in setting the geocoordinates of the input image |
RADIUS | Sphere radius, for georeferencing | Corresponding metadata tags are created, but the actual values are not used in setting the geocoords of the input image |
ROWS | Same as NROWS | |
SEMI_MAJOR_AXIS | Semimajor axis, for georeferencing | Corresponding metadata tags are created, but the actual values are not used in setting the geocoords of the input image |
SEMI_MINOR_AXIS | Semiminor axis, for georeferencing | Corresponding metadata tags are created, but the actual values are not used in setting the geocoords of the input image |
SKIPBYTES | Number of bytes at top of image file to skip |
Allowed values: 0 to (image size in bytes) Default: 0 This can be used for raw formats which contain a fixed number of "header" bytes at the top of the data file |
SPHEROID_NAME | Name of projection system, for georeferencing | Corresponding metadata tags are created, but the actual values are not used in setting the geocoordinates of the input image |
TOTALROWBYTES | Not currently supported – value is ignored | |
UL_X_COORDINATE | Same as ULXMAP | |
UL_Y_COORDINATE | Same as ULYMAP | |
ULXMAP | Upper-left x-position, for georeferencing |
Allowed values: (any floating point value) Default: (none) |
ULYMAP | Upper-left y-position, for georeferencing |
Allowed values: (any floating point value) Default: (none) |
WORDLENGTH | Number of bytes per sample |
Allowed values: 1 or 2 Default: 1, unless overridden by DATATYPE |
XDIM | Size of pixel in x-direction, for georeferencing |
Allowed values: (any floating point value) Default: (none) |
YDIM | Size of pixel in y-direction, for georeferencing |
Allowed values: (any floating point value) Default: (none) NOTE: this is expected to be a positive value |
These keywords are required: NBANDS
, NCOLS
, NROWS
. All other keywords have default values.
If dynamic range is used, either both DYNAMICRANGEMIN
and DYNAMICRANGEMAX
must be set or both DYNAMICRANGEWINDOW
and DYNAMICRANGELEVEL
must be set.
This BBB header file describes a 640x480 RGB color image, using 16 unsigned bits per sample.
NROWS 480
NCOLS 640
NBANDS 3
DATATYPE U16
Note that some of the header syntax supported by GeoExpress may not be supported by other vendors' BIP/BIL/BSQ implementations. In particular, the following features and keywords may be somewhat specific to LizardTech:
COLORSPACE
keyword DYNAMICRANGEMIN
, DYNAMICRANGEMAX
, DYNAMICRANGEWINDOW
, and DYNAMICRANGELEVEL
keywords