3DSoftware.com > Programming > File Formats > FIN > Page 6
FIN File Format  Page 6
 
File Ranging and Biasing
 
In an integer grid FIN file, dynamic ranging and biasing can be applied to the entire grid, or to tiles. In this page we cover how that is done for an entire grid (the entire file).
 
 
File Dynamic Range
 
The Pointer to File Dynamic Range in the file header is the offset in bytes (from beginning of file) to the Dynamic Range of the file integer grid, which is a block of bytes containing dynamic range information.
 
The first 16 bytes of the dynamic range information are two double length ANSI/IEEE floating point numbers (which are only 8 bytes each but will be referred to as double in accordance with ANSI/IEEE terminology that refers to a 4-byte ANSI/IEEE floating point number as single length). After that are two integers which are each the same size (number of bytes) as a grid node.
 
The first of those two integers specifies a low integer. The second specifies a high integer. The first double corresponds (ties to) the low integer. The second double ties to the high integer. Other floating point numbers can then be scaled from this.
 
If the two integers are zero, the second integer is considered to be the maximum possible integer (for that number of bits). For example, if both integers are zero and the integer grid consists of 32-bit integers, then the second integer is considered to be (2^32)–1.
 
Continuing with the same example, if the first double is –15.0, and the second double is 85.0, then application programs that use the file can assume an integer value of zero equals –15.0, an integer value of (2^32)–1 equals 85.0, and scale the intermediate values accordingly, assuming you previously stretched the contrast of the integer grid to the data bounds.
 
 
File Bias
 
The Pointer to File Bias in the file header is the offset in bytes (from beginning of file) to the bias for the entire file integer grid, which is an integer that is the same size (number of bytes) as a grid node.
 
Application programs can subtract the file bias from each integer in the grid to recover original signed data.
 
For example, assume you are storing a data set with range [–300, 5000]. The minimum value is –300, and the maximum value is 5000. To store that data as all positive numbers, the File Bias can be 300. The minimum integer in the grid is then zero, and the maximum integer is 5300. To recover the original data, subtract 300 from each grid node value.
 
—  Page 6  —
 « Page 5 Contents Page 7 » 
 
Copyright © 2008 by 3D Software. All rights reserved.
3D Software, P.O. Box 221190, Sacramento CA 95822 USA
www.3DSoftware.com     Contact us
Tuesday, 06-Jan-2009 03:07:21 GMT