gecon

convert a GE Signa scan series to Silicon Graphics RLE format

gecon converts a series of 16-bit images from a General Electric Signa MRI scanner to Silicon Graphics' 8-bit RLE format. Although the conversion from 16 bits to 8 bits entails the loss of eight significant binary digits, in practice there is little degradation of image quality. The reason for this is the 16-bit dynamic range available in the GE format is underutilised.

The user selects which one of two somewhat different conversion algorithms gecon will use. If the Looks Pretty button is pressed, gecon scans the entire series of images and computes a histogram of all the 16-bit pixel intensities. This is a single histogram that covers the entire volume. gecon then applies fromge to translate each image into an 8-bit image such that the middle 99.95% of the intensity values in the histogram are projected onto the unsigned 8-bit range 0..255, the least 0.025% are mapped to 0, and the greatest 0.025% are mapped to 255. If the scan is a double-echo series, separate histograms and conversion ranges are computed for each of the two echo types.

If the Segments Well button is pressed, gecon computes the histogram from the image at the middle of the range. The assumption is that this image will consist primarily of cerebral grey matter and white matter. The reason for using only one slice rather than the entire volume is that if other slices were included in the histogram then the peaks would be blurred because of the superior-inferior intensity decrease. Next, gecon iterates a three-point smooth of the histogram until the number of modes is less than or equal to five. The most common of these modes is assumed to be due to air. The most common mode whose intensity value is greater than the air mode is assumed to be due to grey matter. The lower limit of the conversion range is set to zero. The upper limit is set such that the grey matter mode is placed as close as possible to 128 in the resulting 8-bit image, subject to the constraint that the upper limit be a multiple of 256. This constraint is necessary in order to avoid spikes in the histogram of the 8-bit image which would be generated by variations in round-off. fromge is then applied with these limits.

The user must specify the name of the input directory, which must contain Signa images whose names are of the format "I.nnn", where "nnn" is the three-digit image number padded with zeroes on the left. The user must also specify the name of the output directory, where RLE images will be written with names of the format "N.bw", where N is the slice number (not padded with zeroes). If the double-echo option is selected, then odd-numbered images are assumed to be first (proton-density) echoes and even-numbered images are assumed to be second (T2) echoes. In this case, the proton-density images go in the first output directory, and a second output directory must be specified for the T2 images. If output directories do not exist, they will be created. If they do exist, any old data with conflicting names will be silently overwritten.

gecon uses the X window system, and can be displayed on any X terminal. For example, suppose you're running an X server on the machine 'pyramis' and have logged in from there to an SGI. To run gecon on the SGI but have it displayed on pyramis, simply setenv DISPLAY pyramis:0.0 before invoking gecon. (If you forget this setenv, then gecon will open its display on the console, and no doubt annoy whoever happens to be sitting in front of it at the time.)

An earlier version of this program, glgecon, uses the Silicon Graphics GL library rather than X. It can be used locally on earlier Silicon Graphics systems which aren't X-capable.

Authors: Matthew Belmonte (core algorithms); Brian Egaas & Mark Chaussee (forms interface). The concept for this program came from earlier implementations by Stuart Hinds, Brian Egaas, and Mark Chaussee.