Script commands may be embedded into IMG
files (or others) and execute image processor functions when a file is
loaded into the viewer. The script commands must start at the 80th byte
of the image file and contain AUTOSCRIPT as the first line.

This simple example will display a pop-up box and wait for the user
to click on OK or Exit:

AUTOSCRIPTpause “The script is
running”exit

When the script is executed it inserts the image filename into the text
variable: $imagefile The following is an example on how to
retrieve the filename:

AUTOSCRIPTpause “The name of this
file is: ” $imagefileexit

The next example loads the palette file: color1.pal and sets the
Window Width to 2.5, Level to 0.5:

The following is an example of how to place a series of CT images into
a single file of compressed images. Once the output file is created,
a script is placed in the image file. When the file is loaded into the
viewer, The images are de-compressed into individual files and loaded into
the viewer for normal viewing/processing.

Procedure:

1) The user loads the desired images into the viewer
2) The CTSET.imp script file is run
from the viewer.
3) The user specifies the output file and the images are compressed
into the file.
4) The script file: OPENCTSET.imp is
placed into the output file and the operation is completed.
5) When the file is loaded into a viewer at a later time (perhaps after
being sent as an E-Mail attachment) the original files are decompressed
into temporary files and loaded into the viewer.

Contents of CTSET.IMP

$cfile = $temppath "\ctemp.img"

# Clear out a block of
memorya = 0loop begin 4096 memory(a) = 0 a = a + 1loop end