MLx Home | MLx menu | MLx
buttons | Widgets | Index | What's New
PGT RAS Format
-- files have '.ras' extension --
SUN Raster (Image) File Format
as implemented by PGT
Written for John Small, to read image files written on his Hitachi S-4500
FESEM by the PGT IMIX image collection and processing system.
The RAS file format can have more than one file. This widget currently
reads one image with its header. The (gray level) image dimensions
and (unsigned integer) bit depth are variable. (Bit depths of 8 and 16 have
bee tested as of 9/4/97).
The information in the header called im->name is put in the MacLispix
Note slot for the image,
which appears as an overlay on top of the image, and which will be put in
the Comments box (Get Info window) of the file if it is saved in TIFF format.
Dale routinely puts documentation information in this slot, as he collects
the images on the scope.
Updates might include RGB color and multiple images per file. 9/4/97
File format information, from source code supplied by Margie Mott, PGT,
The format of PGT images is based on Sun raster files, with PGT-specific
If the file is a multi-image file, such as an X-ray map, the file format
is similar, like this:
- Sun raster image 1
- PGT data for image 1
- Sun raster image 2
- PGT data for image 2
- until end-of-file.
RAS Header - bytes 0-31: eight 4-byte signed integer
- magic (RAS magic). x59A66A95 This is a code to identify
the file as a RAS file.
- width - image width in pixels. (when read into MacLispix, image
- height - image height in pixels.
- depth - pixel depth: 1,8,16,or 32 bits? (I've seen 8 and 24
bits. 24 bit data stored as 32 bit data). MacLispix does not read bit images.
- length - height * [width * bytes_per_pixel]. Note: round 
up to a multiple of 4.
- type - 0 - ?"RT Standard" ?
- maptype - 1 - denotes 256 bytes of red, green and blue each,
in the map.
- maplength - 768 - = 3 * 256
PGT Header appended to the RAS header. Consists
of display list and collection header.
Information on all graphics items that are overlayed on the image such
as numbers, boxes and text.
- display_list_magic (4 bytes, signed) - x59A66A96
- number of display list nodes (4 bytes, signed)
- node - structure of 120 bytes. Following items are 4-byte int each
except where noted.
- text (a location? for a label)
- ... other stuff
Image label. Distance calibration.
- collection_header_magic - x59A66A98
- version (8 bytes - double float?)
- name_length (4 bytes signed int)
- units_length (4 bytes signed int)
- cal_filename_length (4 bytes signed int)
- im->mag (8 bytes double float)
- im->units_per_pixel (8 bytes double float)
- * source has choices on
- name - string, length given above (This is put in the note slot of
the MacLispix window and displayed as the annotation to the image.)
- units - string, with length given above (Not yet used by MacLispix)
- cal_filname (Not yet used by MacLispix)
Display list node types:
- 0 - mark - spectrum analysis point locations.
- 1 - text
- 2 - box
- 3 - line
- 4 - pr (?)
- 5 - scale bar
- 6 - no type
- 7 - draggable type
- 8 - any type
- * MacLispix does not dispatch on version