rawiv Data Format Description (.rawiv) |
|
The rawiv data format is used to represent 3D volumetric data of scalar fields defined on a regular grid. A rawiv file is created by adding the header (described below) to the raw format. Everything is in big-endian. Big endian is the byte order on Sun, SGI, IBM architectures. Intel's byte order is little endian. Header DescriptionOrder of information is as below, concatenated contiguously. |
|
(minX) (minY) (minZ) (maxX) (maxY) (maxZ) (numVerts) (numCells) (dimX) (dimY) (dimZ) (originX) (originY) (originZ) (spanX) (spanY) (spanZ)
|
|
where:
(minX, minY, minZ) are the co-ordinates of the 1st voxel. These define the bounding box of the data in co-ordinate space.
numVerts is the number of vertices in the grid.
numCells is the number of cells in the grid.
dimX = number of vertices in x direction
originX Warning: The existance of the origin co-ordinates is somewhat of a mystery. Some developers claim the origin co-ordinates are exactly the same as the co-ordinates of the first voxel. So please do not use this variable unless you know what it stands for. The spans are the spacing between one vertex and the next along the given description.
spanX = (maxX - minX)/(dimX - 1) The size of a rawiv header is 68 bytes. Conflict ResolutionThere are a number of fields in the header that are redundant. For example, numVerts = dimX * dimY * dimZ. If while reading the rawiv format, you find that numVerts != dimX * dimY * dimZ , then the appropriate action is to determine that the rawiv file is corrupted. Data PortionNext follows the actual data in the raw format. A rawiv file is created by concatenating a raw file to a file containing the rawiv header. The suffix on the name of a rawiv file .rawiv |
|
The raw portion of the rawiv file is in binary big-Endian format used to represent 3D volumetric data of scalar fields defined on a regular grid. It is simply a sequence of values. These values can be floats, unsigned shorts, or unsigned chars. The data is listed with the x co-ordinate varying fastest, and z varying slowest. So, in C++ syntax a reader would contain the following code snippet:
for (int z=0; z < dimZ; z++)
for (int y=0; y < dimY; y++)
for (int x=0; x < dimX; x++)
{
//read data here
}
|
| A byte is 8 bits. A float is 4 bytes. An unsigned int is 4 bytes. An unsigned short is 2 bytes. A character is a single byte. |
|
Please send comments/questions to jgsun@ices.utexas.edu |