Lispixrawreadr: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Scott
(New page: ===Purpose=== Import Lispix Raw formatted image. ===Synopsis=== :imagedso = lispixrawreadr(filename) ===Description=== Read in a Lispix Raw image file. The file format consists of two ...)
 
imported>Donal
No edit summary
Line 8: Line 8:


===Description===
===Description===
Read in a Lispix Raw image file. The file format consists of two files: a data file (.raw) and a raw parameter list file (.rpl). It is assumed that the two files are named the same thing with only the extension being different. The filename input can point to either the .raw or the .rpl file.
Read in a Lispix Raw image file. The data file consists of an uncompressed string of numbers all saved in the same format, for example one byte per number.
It is necessary to have a second file which describes the layout of the raw data file contents.
Thus, the file format consists of two files: a data file (.raw) and a raw parameter list file (.rpl).  
It is assumed that the two files are named the same thing with only the extension being different.  
The filename input to LISPIXRAWREADR can point to either the .raw or the .rpl file.
 
Note that this file format is different from the Physical Electronics .raw file and also different from the RAW files output by some digital cameras.
 
The Lispix RAW file format is described at: http://www.nist.gov/lispix/doc/image-file-formats/raw-file-format.htm
Please see this for details of the .raw and .rpl file formats.
 
A typical .rpl file contain 9 lines, where there is one tab (and possibly extra spaces) between the parameter name and parameter value.
Parameter names are case-insensitive.
The first line is "key <tab> value", and the following 8 lines identify parameters and their values in the form <param-name> <tab> <param-value>.
For example:
:key            value
:width          849
:height        846
:depth          4096
:offset        0
:data-length    1
:data-type      unsigned
:byte-order    dont-care
:record-by      vector
 
This .rpl file indicates the image is 849 pixels wide and high, with 4096 levels in the depth dimension.
 
In addition to these 8 Lispix standard parameter names the LISPIXRAWREADR importer recognizes the following non-standard parameters names which may be specified to allow reading only a sub-rectangle of the image in height and width and reducing the resolution in the depth dimension.
This is useful when reading large images on a system with a small amount of memory (RAM).
These additional parameter names are:
:depthbinsize : number of points per bin in the depth dimension. For example, a value of 4 means the depth dimension is reduced by x4.
:width1      : lower width pixel
:width2      : upper width pixel. Read data between width1 and width2 in the width dimension.
:height1      : lower height pixel.
:height2      : upper height pixel. Read data between height1 and height2 in the height dimesnion.
:depthscaleorigin    : Origin of axisscale for depth dimension
:depthscaleincrement : Increment for depth axisscale
:depthscaleunits    : Units symbol for depth axisscale
 
The compression in the depth dimension is achieved by averaging bins of "depthbindsize" points.
 
The following lines could be added to the example .rpl file above to read a sub-rectangle of the image and to reduce the depth dimension by a factor of 20:
:depthbinsize        20
:width1            200
:width2            600
:height1            200
:height2            500
:depthscaleorigin    0
:depthscaleincrement    0.02
:depthscaleunits    keV
 
In this example an axis scale is specified for the depth dimension which ranges from 0 to 4096*0.02 (=81.92), with units of "keV".


====Inputs====
====Inputs====

Revision as of 23:56, 12 June 2014

Purpose

Import Lispix Raw formatted image.

Synopsis

imagedso = lispixrawreadr(filename)

Description

Read in a Lispix Raw image file. The data file consists of an uncompressed string of numbers all saved in the same format, for example one byte per number. It is necessary to have a second file which describes the layout of the raw data file contents. Thus, the file format consists of two files: a data file (.raw) and a raw parameter list file (.rpl). It is assumed that the two files are named the same thing with only the extension being different. The filename input to LISPIXRAWREADR can point to either the .raw or the .rpl file.

Note that this file format is different from the Physical Electronics .raw file and also different from the RAW files output by some digital cameras.

The Lispix RAW file format is described at: http://www.nist.gov/lispix/doc/image-file-formats/raw-file-format.htm Please see this for details of the .raw and .rpl file formats.

A typical .rpl file contain 9 lines, where there is one tab (and possibly extra spaces) between the parameter name and parameter value. Parameter names are case-insensitive. The first line is "key <tab> value", and the following 8 lines identify parameters and their values in the form <param-name> <tab> <param-value>. For example:

key value
width 849
height 846
depth 4096
offset 0
data-length 1
data-type unsigned
byte-order dont-care
record-by vector

This .rpl file indicates the image is 849 pixels wide and high, with 4096 levels in the depth dimension.

In addition to these 8 Lispix standard parameter names the LISPIXRAWREADR importer recognizes the following non-standard parameters names which may be specified to allow reading only a sub-rectangle of the image in height and width and reducing the resolution in the depth dimension. This is useful when reading large images on a system with a small amount of memory (RAM). These additional parameter names are:

depthbinsize : number of points per bin in the depth dimension. For example, a value of 4 means the depth dimension is reduced by x4.
width1  : lower width pixel
width2  : upper width pixel. Read data between width1 and width2 in the width dimension.
height1  : lower height pixel.
height2  : upper height pixel. Read data between height1 and height2 in the height dimesnion.
depthscaleorigin  : Origin of axisscale for depth dimension
depthscaleincrement : Increment for depth axisscale
depthscaleunits  : Units symbol for depth axisscale

The compression in the depth dimension is achieved by averaging bins of "depthbindsize" points.

The following lines could be added to the example .rpl file above to read a sub-rectangle of the image and to reduce the depth dimension by a factor of 20:

depthbinsize 20
width1 200
width2 600
height1 200
height2 500
depthscaleorigin 0
depthscaleincrement 0.02
depthscaleunits keV

In this example an axis scale is specified for the depth dimension which ranges from 0 to 4096*0.02 (=81.92), with units of "keV".

Inputs

  • filename = file name to read.

Outputs

  • imagedso = a DataSet object containing the image in the read file.

See Also

buildimage, rawread