Data Type: Lattice ()

Description:

This class represents regular 3D data arrays. Every node of a regular data array can be addressed by an index tuple (i,j,k). The data array is characterized by its dimensions (the number of nodes in each direction), the primitive data type (e.g., bytes or shorts), the number of data variables per node, and by its coordinates, compare section Coordinates and Grids in chapter Program Description of the user's guide. In uniform, stacked, rectilinear, and curvilinear coordinates are supported, compare Section "Coordinates and Grids". Lattice is a simple but powerful data type. In particular, all 2D and 3D images in are represented by this type.

As a technical detail it should be mentioned that in contrast to other data types Lattice is not a data class by itself, i.e., it is not derived from Data or Object. Instead it is a so-called interface class which is used by other classes such as Reg Scalar Field, Reg Vector Field, or RegColorField3. Usually this fact will not be important for end-users, but only for users.

Commands:

Data objects using this class inherit all commands of Field.

getDims
Returns three numbers indicating the number of nodes in each direction of the 3D array.

coordType
Returns a number indicating the coordinate type of the lattice, 1 = uniform, 2 = stacked, 3 = rectilinear, 7 = curvilinear.

getValue <i> <j> <k>
Evaluates the field at the index position <i> <j> <k>. As many numbers are returned as there are data variables in the lattice.

setValue <i> <j> <k> <value1> [<value2> ...]
Sets the field values at the index position <i> <j> <k>. The number of values specified by this command must match the number of data variables of the field.

swapByteOrder
Swaps the byte order of the lattice's data values from little endian to big endian or vice versa.

clearSlice <k>
Sets all values of slice <k> to zero.

exchangeSlices <k1> <k2>
Swaps the contents of the slices <k1> and <k2>.

crop -auto [<threshold>] | <imin> <imax> <jmin> <jmax> <kmin> <kmax> [<value>] [-enlarge <adjustValue> | -reduce <adjustValue>]
Crops the lattice. The <auto> option computes the smallest box containing all voxels >= <threshold>. The next six arguments specify the index bounds of the subvolume to be cropped. It is possible to enlarge the data set by specifying negative lower bounds or upper bounds exceeding the current size of the lattice. In this case, the last slice is replicated unless <value> is specified. If this is the case the new slices are initialized with <value>. The <enlarge> and <reduce> options will crop a bigger or smaller region from the current min and max indexes for the given <adjustValue>.

flip {0|1|2}
Flips the lattice in i-, j-, or k-direction, depending on whether the argument was 0, 1, or 2.

swapDims <iIdx> <jIdx> <kIdx>
Performs a kind of rotation about 90 degrees. The arguments tell at which position an index was before, i.e., they must be a permutation of 0, 1, 2. For example, to convert ijk into jki you have to use the arguments 1 2 0.

setBoundingBox <xmin> <xmax> <ymin> <ymax> <zmin> <zmax>
Sets the bounding box of the lattice. The bounding box encloses the centers of all voxels of the lattice (not the complete voxels). In case of stacked, rectilinear, and curvilinear coordinates the coordinates of inner points are scaled appropriately.