A simple procedure

Suppose, for example, a hypothetical user often executes a sequence of tasks to resize and enhance an image. Typically, this user creates a new database using the CIM task, copies data to it using the III1 task, computes a lookup table for enhancement using the FUN task, and then applies the lookup table to the image using the LUT task. Normally, the user sets the parameters for the first task manually, then executes it, then sets the parameters for the second task and executes it, and so on for each task in the list. Such a sequence of steps is an excellent candidate for automation using a simple EASI script. An example of such a script is presented below.

The script is created by entering the commands that form the script in a text editor. The script is then saved to a file with a maximum 8 character name, all which must be upper-case, and followed by the extension ".EAS". In the example below, the script is stored in the file ENHANCE.EAS. Once created, the script can be executed by entering its name with the RUN command, as follows:

EASI>r copprm
EASI>run enhance

Notice that the first line runs the procedure COPPRM.EAS which copies the parameter file PRM.PRM from the PRO directory to the current directory. The next line runs the ENHANCE.EAS procedure. You may also notice that the run command can be simplified to just typing 'r'.

The body of the script contains exactly the commands the user would enter manually in order to accomplish the desired task. Typically, this consists of setting parameters required by a particular task, running that task, and so on to obtain the final result. The example below is a listing of part of the ENHANCE.EAS script, in which the first step of the process is done, namely the creation of a new database file. The lines beginning with an exclamation mark "!" are comment lines and are ignored by EASI, as are blank lines.

! ENHANCE.EAS: image resizing and enhancement
! Set parameters for the CIM task
FILE = "Newname.pix"
TEX1 = "Down-sampled image"
TEX2 =
DBSZ = 512, 512
PXSZ = 1, 1
DBNC = 1
DBLAYOUT = "BAND"
! execute the CIM task to create and allocates space for a new 
! PCIDSK database file, for storing image data. 
RUN CIM

In order to locate the script in order to execute it, the script file must be located in the current working directory (this is usually the same directory where EASI is started).

When the script is run, EASI will execute the commands in ENHANCE.EAS in order starting at the beginning of the file and ending when there are no more commands to execute, at which time control will return to the EASI prompt.

Although the enhancement process is automated by the script, there are still a number of deficiencies:

The remaining topics of this section will describe techniques on how to specify input values for scripts and to create on-line documentation. Error handling will be left to a separate chapter. A complete version of the simple ENHANCE script will be presented at the end of this chapter.

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.