Format of .img image files
1. Image file format for .img suffix files:
---------------------------------------
With y and x dimensions as shown on the GUI interface:
------> y-axis
|
|
v
x-axis
I read the .img files and access them as (in C++ language):
*(unsigned_char_pointer + x_location * y_dimension + y_location)
where unsigned_char_pointer is a pointer to the beginning of the
data read in from the file.
Each byte in the file is interpreted as a single pixel in the
image with grayscale range from 0 (black) to 255 (white).
NOTE: there is no "header" in the ".img" files, from the
first to last byte is all data.
Format of .inf information files
2. Information (.inf) files:
-------------------------
Several of the programs support "imformation" files. These files have
the suffix ".inf" and contain three ascii-text lines of information:
x-dimension of image
y-dimension of image
z-dimension of image
For example, the 256 x 256 pixel "pepper.img" file would have
a corresponding information file named "pepper.inf" containing
the following three lines:
256
256
1
Similarly, the 256 x 256 image "comp5.img" would have a
corresponding "comp5.inf" file with the same contents above.
NOTE: In the absence of a ".inf" file, the image is read in using
the values of x, y, and z dimensions as currently set in the
corresponding fields of the GUI interface.
Note on "slices"
Slices are numbered from 0 through Z-1, where Z is the z-dimension of the data.
So for the 256 x 256 x1 file pepper.img, set slice=0.