The volume rendering application implemented for this project can read volume in Analyze format. An Analyze image database consists of two files, a header file with extension .hdr, and an image file, with extension .img. The header file needs to be parsed to find out how to read the image file and how to interpret the values of the volume. First, the data type of the image binary file needs to be discovered, in order to read the right number of bytes for each density value of the volume. Also, it is necessary to get the dimensions of a cross-section image and the total number of slices in order to create the corresponding volume array. Furthermore, information about the sampling density must be acquired. The real space in millimeters separating the samples needs to be know, i.e. distance separating image pixels and distance between the slices. These information is needed to resample the data to isometric voxels, which simplify the subsequent computation.
To parse the header file, a standard C programming language structure is given by the Mayo Clinics (May). They provide code and instructions that were used in this project for the reading of Analyze format volumes. The project software can read Analyze files of unsigned char and and signed short data type using standard C++ reading and casting. Usually, byte order conversion from little to big endian was necessary. All density values also needed to be mapped to values in the range of 0 to 255.
Once the density values are converted, the volume is resampled in order to form isometric voxels. Resampling is done by trilinear interpolation relative to the samples distances, acquired from the header file. This pre-processing removes many complications that are otherwise encountered in the visualization pipeline. It may not be the best solution, but it gives satisfactory results for data set that are close to isometrically sampled.