ReadPyr
DESCRIPTION
ReadPyr reads in a pyramid from a file in IRIS Explorer pyramid format (either
ASCII or binary encoding), such as that created by WritePyr, or from a file in
`plain' ASCII pyramid format.
The plain file format is as follows. The first line of the file must be
#!/usr/explorer/bin/explorer cxPyramid plain 1.0
Comment lines begin with a `#'
character, and whitespace is ignored. The file should contain the
following fields, in this order:
- base lattice
- This can be either included in the same file, if the
lattice keyword is present, indicating that the lattice data (in plain
lattice format) follows, or may be sourced from another file,
if the include filename
keyword is present, in which case the lattice data is read from the
file filename.
The lattice data in filename
may be in plain or IRIS Explorer lattice format and will be read in by ReadLat.
- count
- This is the number of layers in the pyramid.
- ref
- The type of compression of the pyramid. A value of 0 indicates no
compression; a value of 1 indicates unique compression; and a value of
2 indicates multiple compression.
If compression is unique, the next field in the
input file should be index
which specifies the type of compression element. For example, a value
of 0 indicates an element of type cx_pyramid_dict_point, 1 indicates
cx_pyramid_dict_line, 2 indicates cx_pyramid_dict_triangle; and so on (see
the Module Writer's Guide for the full list of elements and their indices).
If compression is of type multiple, the next field in the input file
should be numIndices followed by a vector indices
with numIndices values, specifying the dictionary reference elements as above.
- layer data
- The next part of the file should contain layer data in the
following format, for each layer
from 1..count.
- numElements numConnections
- The number of elements and connections at this layer. If both of these
fields are zero, the layer is assumed to be compressed, and there are
no further fields for this layer.
- elements
- The vector of element data; with (numElements+1) values.
- connections
- The vector of connections data; with numConnections values.
- layer lattice
- The lattice of data at this layer. As for the base lattice, the data can
be included using the lattice
keyword, or can be sourced from another file using the include filename
keyword. Finally, the absence of lattice data at this level
is indicated by the NULL keyword.
Example data in this format can be found in the
${EXPLORERHOME}/data/pyramid (UNIX) or
%EXPLORERHOME%\data\pyramid (NT)
directory. The source code for the module can be found in the
${EXPLORERHOME}/src/readers (UNIX) or
%EXPLORERHOME%\src\readers (NT) directory.
INPUTS
WIDGETS
Port: Filename
Type: Text
The name of the file to be read.
OUTPUTS
Port: Output
Type: Pyramid
Constraints: 1..-layer
Constraints: optional-baseLat
Constraints: n-D compression
Constraints: n-compression type
The output pyramid.
KNOWN PROBLEMS
The file browser widget does not correctly browse files on
remote machines. The remote filename can be entered in the selection
box, but the option menu is inoperable. Only crude error checking is
done for plain format files. If the input file is malformed, the
module may crash.
SEE ALSO
WritePyr,
CropPyr,
PrintPyr,
ReadLat.
[Documentation Home]
© The Numerical Algorithms Group Ltd, Oxford UK. 2000