label3d is a shell script that processes a Raster3D input file containing label descriptors (object types 10, 11, 12) into a TIFF image label3d.tiff containing both the molecular graphics image and the associated labels.

label3d can accept input either from a file or from stdin.

label3d render_input_file.r3d; display label3d.tiff or cat list-of-files | label3d - Unfortunately, the Raster3D render program cannot process labels. To overcome this lack, earlier Raster3D distributions includes an auxilliary program r3dtops that complements render in that it can process the labels but not the graphics objects. The r3dtops code is now part of the render program itself, and is invoked if the -labels command line switch is present. In this case the labels are converted to PostScript commands and placed in a file The label3d script automates the process of rendering the image, running the resulting PostScript file through ghostscript, and then recombining the two component images into a single TIFF image containing both the molecular graphics objects and the associated labels.

Several intermediate files are produced by label3d:


Example 7 (figure at right) in the Raster3D distribution illustrates the use of the label3d script. The example script actually produces a stereo pair that shows labels positioned in three dimensions.


This script requires TIFF support in render, the unix utility sed, the ImageMagick image processing package, and ghostscript. The intermediate files listed above are created each time the script is run. Any exiting files by these names will be destroyed.


The whole nature of label handling in Raster3D is not yet settled. It would be much nicer if all the label processing were taken care of by the render program itself.

The script assumes that the image is being prepared for printing at 300 dpi (r3dtops is called with -fontscale 3.0).

Labels always appear on top of the molecular graphics image, even labels which should be occluded by a foreground object.


Ethan A Merritt.
Back to top Raster3D homepage