Lispixrawreadr: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Donal
No edit summary
imported>Donal
Line 22: Line 22:
Parameter names are case-insensitive.
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>.  
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:
For example:  
:key            value
key            value
:width          849
width          849
:height        846
height        846
:depth          4096
depth          4096
:offset        0
offset        0
:data-length    1
data-length    1
:data-type      unsigned
data-type      unsigned
:byte-order    dont-care
byte-order    dont-care
:record-by      vector
record-by      vector


This .rpl file indicates the image is 849 pixels wide and high, with 4096 levels in the depth dimension.
This .rpl file indicates the image is 849 pixels wide and high, with 4096 levels in the depth dimension.
Line 38: Line 38:
This is useful when reading large images on a system with a small amount of memory (RAM).
This is useful when reading large images on a system with a small amount of memory (RAM).
These additional parameter names are:
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.  
:'''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
:'''width1'''       : lower width pixel
:width2      : upper width pixel. Read data between width1 and width2 in the width dimension.
:'''width2'''       : upper width pixel. Read data between width1 and width2 in the width dimension.
:height1      : lower height pixel.
:'''height1'''     : lower height pixel.
:height2      : upper height pixel. Read data between height1 and height2 in the height dimesnion.
:'''height2'''     : upper height pixel. Read data between height1 and height2 in the height dimesnion.
:depthscaleorigin    : Origin of axisscale for depth dimension
:'''depthscaleorigin'''   : Origin of axisscale for depth dimension
:depthscaleincrement : Increment for depth axisscale
:'''depthscaleincrement''' : Increment for depth axisscale
:depthscaleunits    : Units symbol for depth axisscale
:'''depthscaleunits'''     : Units symbol for depth axisscale


The compression in the depth dimension is achieved by averaging bins of "depthbindsize" points.
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:
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
depthbinsize             20
:width1             200
width1                 200
:width2             600
width2                 600
:height1           200
height1                 200
:height2           500
height2                 500
:depthscaleorigin     0
depthscaleorigin         0
:depthscaleincrement    0.02
depthscaleincrement    0.02
:depthscaleunits   keV
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".
For this example LISPIXRAWREADR loads an image dataset object where the image size is 301x401 (301 pixesl high, 401 pixels wide) and 205 layers deep (4096/20, rounded). An axis scale is specified for the depth dimension which ranges from 0 to 81.92 (=4096*0.02), with units of "keV".


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

Revision as of 12:08, 13 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

For this example LISPIXRAWREADR loads an image dataset object where the image size is 301x401 (301 pixesl high, 401 pixels wide) and 205 layers deep (4096/20, rounded). An axis scale is specified for the depth dimension which ranges from 0 to 81.92 (=4096*0.02), 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