User Tools

Site Tools


jvs:cigal:manual:chapter1:cigal

CIGAL Reference Manual, Chapter 1 (Topics): CIGAL

CIGAL -- Compilable Imaging, Graphics, and Analytical Language

CIGAL (Compilable Imaging, Graphics, and Analytical Language) is an interactive computer programming language designed for manipulating and analyzing visual information. CIGAL provides immediate access to its built-in repertoire of almost 200 commands, plus on-screen menus, and a powerful command line interpreter. The language's strength lies in the fact that it allows you to dynamically create, manipulate, and display data variables ranging in size from a single bit, to an enormous 4 gigabyte 3-dimensional floating point array. This ability to handle any amount of data as single variables is what makes CIGAL well suited for handling visual information and pictures, which involves very large data sets.

In addition to its ready-made features, what makes CIGAL a programming language is the fact that you can combine any number of commands into more complex programs. These programs are generally referred to as “macro” commands (or “macros”) because they involve building up new commands by combining pre-existing commands (including other macros). Macro commands can be executed just like any other CIGAL command. Writing macro programs is easy, and CIGAL comes with hundreds of macros that can be used as examples. Even non-programmers can quickly learn to write their own customized commands, quickly and easily.

CIGAL's macro programming language includes an internal macro compiler in addition to its standard command line interpreter. The compiler can be used to do all of the overhead of syntax checking and interpreting the meaning of each command line. The compiler then creates a new “compiled” version of the macro which runs much more efficiently than the original. Compiling a complex macro can therefore result in dramatically shorter execution times, overcoming the major drawback of most macro-based programming.

General Purpose Programming Language:

Although originally intended for image processing and graphics applications, only about one-third of the CIGAL program is specifically related to imaging or graphics. The rest of CIGAL is devoted to defining a general-purpose programming language for manipulating data variables (see [VARIABLES](1)). Within this context, graphics and imaging data are simply analogous to large variables. Most CIGAL commands consist of functions capable of operating on any size or type of data variable. For example, variables can be combined arithmetically (e.g., added, divided, etc.), they can be transferred to and from disk files, or they can be operated on by a wide variety of functions. Most functions are general data analysis operators (e.g., sqrt, max, mean). However, there are also other internally defined commands that are specifically designed for graphics or image processing operations (e.g., rotate, scale, convolve). These specialized commands can act on a wide range of CIGAL variables just like any other function. These commands are only different in that they produce visually significant transformations.

Image Processing and 3-Dimensional Graphics:

CIGAL can handle “visual information” in two different forms: as 3- dimensional graphic vectors or as 2- or 3-dimensional image matrices. In general, CIGAL defines the vector-based approach as “graphics” and the matrix-based approach as “images”. Many CIGAL commands are specifically designed to be used for either graphics or images, and there are also some commands designed for transferring data from one form to the other. See [GRAPHICS](1) and [IMAGES](1) for more information on each of these approaches.

Easy to Use Commands and Menus:

CIGAL is intended to be extremely flexible so as to provide for a greater ease of use. For this reason, the ready-to-use commands are capable of meeting a wide range of applications. (For a list of the ready-to-use internal commands see [COMMANDS](1).) You can execute commands either by selecting from menus displayed on the screen, or by typing in the command you want. The menus are generally easier to use while you are learning, whereas typing in commands is more efficient when you know what you want to do.

Flexible Design:

CIGAL's power comes from the ease with which you can create new commands for specific applications. You can create new commands in a variety of ways, depending on the nature of the task and the preference of the user. For example, you can customize commands via:

Macros
-programs made by combining CIGAL commands
Menus
-a list of cursor selectable commands
Keyboard function keys
-the 10 function keys can be assigned any commands
Preprocessor functions
-character string shorthand for a command
CIGAL subroutines
-writing C-language routines to modify CIGAL itself

Of these, the most flexible and powerful method to create new commands is the ability to write macro programs, as described above. However, new menus are also easy to make and are generally the preferred way to organize groups of related commands. Menus come in several forms: 'pull down' menus selectable from a line, or toolbar, displayed across the top of the screen; 'full-screen' menus which can display more information and remain visible until you turn them off; 'function' menus which control the meaning of the keyboard's function keys and the mouse buttons; and, 'tablet' menus which define commands associated with specific regions on the surface of a digitizing tablet (if you have one). See [MENUS](1) for more information about menus.

CIGAL also has a command pre-processor which allows you to substitute simpler words or functions in place of other, more complicated words or commands. This feature is most useful when writing macro programs, but it can also be useful at times for creating simple command shorthand. For more on the preprocessor see [PREPROCESSOR](1).

If you really want to maximum processing efficiency you can write your own C-language subroutines (if and have an appropriate C compiler). Your compiled subroutines can be incorporated as new, internal commands by re-linking the CIGAL object modules, thereby replacing the dummy user routines with your own. For more information on how to make customized commands, see [CUSTOMIZE](1).

Machine Independent:

Finally, CIGAL is designed to be essentially machine independent. This is due to the fact that all machine dependent features are confined to a small software interface involving relatively few subroutines. These subroutines are themselves dependent on a very small number of truly device dependent calls. This approach means that modifying CIGAL to work with new or different equipment only requires making relatively few changes to the software itself (see [DEVICES](1) and [CUSTOMIZE](1).

CIGAL is also machine independent in another sense. That is to say, almost all CIGAL commands work just as well in the presence or absence of any particular piece of peripheral hardware. This is accomplished in three ways.

1) All data transfers to and from hardware devices, disk files, or any part of core memory are handled as if they are writing to or reading from standard CIGAL variables. Therefore you can easily read and modify data anywhere in the system without needing to know the details of how those data are stored or accessed – the same syntax is used for accessing variables regardless of the physical location of your data.

2) Similarly, with only a few exceptions, individual CIGAL commands function regardless of where their data variables are stored. For example, you can add two images together just as easily whether they are stored in main memory, image processor memory, or disk files. The routines that pass data between variables and commands look after all the details of finding and storing the data, so that the commands themselves will work on any type of variable.

3) Thirdly, an important feature of CIGAL is that commands that benefit from the presence of a particular type of peripheral hardware device will use that device if it is available, but will also work just as well, albeit slower, if the hardware is not present. For these commands, CIGAL first checks whether the specialized hardware is present and capable of operating on the specified variables and if so it will be used. If the specialized hardware is not available, CIGAL automatically emulates the operation in software. This means, for example, that most image processing operations can be performed using CIGAL without any image processing equipment. (The one major exception to this is the DIGITIZE command which does require some specialized hardware to acquire a digitized image.) The advantage to this approach is that you are generally not limited in what you can do by what equipment you have.

Adding extra hardware can provide enormous and frequently essential increases in speed, but CIGAL should always perform the operations you want with whatever equipment you have.

For more information on CIGAL, see:

  • CHAP1(1) - table of contents for general help topics

See Also:
CIGAL Home, CIGAL Manual, Topics List, Manual Help

jvs/cigal/manual/chapter1/cigal.txt · Last modified: 2023/02/23 18:43 (external edit)