09/01/2009
|
THE RAW FILE FORMAT
Note - the Lispix Raw File Format is not the same as the Raw Image files obtained from digital cameras, which are used to save all of the brightness levels (perhaps 12 or 14 bits worth) from the imaging chip, rather than just the 256 levels per color (8 bits) that the JPEG file format format supports. These photographic file formats may be highly encoded and their structure is often propriatery, requiring software from the particular camera manufacturer to read them.
On the other hand, ...
Images and spectral images or data cubes that are written in the (Lispix) raw file format are just a continuous string of numbers – no header, no compression, no encoding to eliminate blocks of zeros, etc. Data cubes can be stored image by image, or spectrum by spectrum. Single images are stored row by row, vector cubes are stored row by row (each row spectrum by spectrum), image cubes are stored image by image. All of the numbers are in the same format, such as 16 bit signed integer, IEEE 8-byte real, 8-bit unsigned byte, etc.
A typical file name might be "image-001.raw".
The "raw" file will be accompanied by text file with the same name and ".rpl" extension. This file lists the characteristics of the raw file so that it can be loaded without human intervention.
RPL stands for "Raw Parameter List", an ASCII text, tab delimited file in which Lispix records or reads the image parameters for a raw file.
The .rpl file or "Ripple" file, is a short ASCII (text) file listing the parameters that characterize a .raw file with the same name. Whenever Lispix writes a raw file, it also writes a .rpl file with the same name so that Lispix can later open the raw file using the File / Open menu without recourse to the Import - Export Tool. A typical file name might be "image-001.rpl".
To read a cube stored in raw format, either the user needs to know the various parameters of the cube, or there must be an accompanying *.rpl file (for “Raw Parameter List”) described below, which lists the parameters.
When data-length is 1, the byte order is not relevant as there is only one byte per darum, and byte-order should be dont-care.
When depth is 1, the file has one image, record-by is not relevant and should be dont-care. For spectral images, record-by is vector. For stacks of images, record-by is image.
Example
This is an example RPL file. There are eight rows (lines) in the file, with two words or numbers per line, separated by a tab and any number of spaces. The first line is "key <tab> value", for example. The following lines list one parameter each, with the parameter name and the parameter value.
Note - spaces between key and value should include one tab character. This example has no tabs, a restriction of vanilla HTML, in which this is written.