Created: 6/5/2000
Last Modified: 6/23/2000
Version: cpmed 03d
Page from cpmed notes, Jim Nash, Synergy Research Inc.
Back to Contents
Our NIAAA reader was derived from inspection of the .hdr files that accompany .img files, and from the header description (ImHeader.h) that represents the first 1024 bytes of the img files. The .hdr file is optional on read and always provided on write. The header in .img files are thought to be very limited as regards attributes outside of the dimensions and format of the image pixels. In particular, the strings are too short. Thus, most information should be drawn from the .hdr file.
An NIAAA 'generic' image data-set consists of a .img file that contains a 1024 byte header followed by pixel data as a long array that represents a cube in space. The 1024 byte header is described in the code file ImHeader.h. An optional text file having the extension .hdr may accompany the .img file. The .hdr file (called the 'text header' file), duplicates the information in the first 1024 bytes of the .img except that strings are longer and hence, not truncated. In addition, the text header (.hdr) file contains other attributes of the image. The text header file is organized in a LISP language format with open and close parenthesis and value pairs. The type of value (int, float, string), is either known by the program or assumed to be string. The length of the value is from the first printing character after the name of the value up until the next close parenthesis. In LISP, a value may consist of an open parenthesis, a list of value pairs and a close parenthesis. The .hdr file underuses the LISP structure: value pairs are organized in two groups: GENERIC, which duplicates fields in the first 1024 bytes of .img; and FILEHDR, which contains attributes of interest to medical images such as SCANNER, MANUFACTURE, MODALITY, etc.
ImHeader.h - code file that describes the binary .img file.
*.hdr - optional LISP formated text header.
*.img - NIAAA "generic" image file.
The following description may differ from that of a LISP file. It reflects the limited way in which we use the LISP data structure. A LISP file is a list.
List - a sequence of value pairs.
Value Pair - an open parenthesis followed by a name, followed by a value, followed by a close parenthesis. White space is ignored except in a string in which case all white space is included up to the close parenthesis.
Name - the name of the attribute (FILE_NAME, NUM_SLICES, etc.).
Value - a list, an integer, a floating point number, a string without delimeters (but terminated by a close parenthesis).
Only 3D datasets are supported. The Synergy-IP program is our standard.
| type | name | description |
| string | FILE_NAME | at the time of acquisition or creation |
| string | PATIENT_NAME | |
| string | PATIENT_ID | |
| string | SCAN_DATE | |
| int | X_SPACING | separation between pixel centers in microns |
| int | Y_SPACING | |
| int | Z_SPACING | |
| float | T_SPACING | delay between start of exposures in seconds |
| int | XPIXEL_SIZE | point spread function, in microns |
| int | YPIXEL_SIZE | |
| int | ZPIXEL_SIZE | |
| float | TPIXEL_SIZE | exposure duration or point spread |