McIDAS Programmer's Manual
Version 2015

[Search Manual] [Table of Contents] [Go to Previous] [Go to Next]

McIDAS system overview

Now that you've seen McIDAS-X from a user's perspective, you need to understand how McIDAS-X operates at the system level. When McIDAS-X is started, it creates the environment in which it will run. In this section, you will learn about the system-level components of the McIDAS-X environment and how they fit together.

The McIDAS-X environment consists of these three components:

Each is described below.

Shared memory

When a McIDAS-X session is started, a block of shared memory is created as an inter-process communication mechanism between McIDAS-X applications, resident programs and the display environment. This shared memory block is composed of:

The shared memory key associated with the memory is stored in the environment variable MCENV_POSUC.

User Common

User Common (UC) contains information about the McIDAS-X session, such as the current image frame in view, the maximum number of image frames and the cursor position. UC has two parts:

Positive user common

Positive UC contains the current state of the McIDAS-X session. This information is available as long as the session that created positive UC is active. Values in positive UC may change. For example, if frames are looping or you're moving the cursor on the screen, the values in positive UC related to the current frame number or cursor position will change.

Negative user common

Negative UC is not part of the shared memory block created when the McIDAS-X session is started. It is created by mmap when a McIDAS-X command is started, and is initialized with the values in positive UC at the time the command is entered. The file descriptor key associated with negative UC is then placed in the environment variable MCENV_NEGUC.

Negative UC values are not changed by other activities in the McIDAS-X session, such as frame looping or cursor motion. When a command finishes running, its copy of negative UC is deleted if it was not inherited from a parent process.

Visibility and inheritance

As a McIDAS-X programmer, you need to understand the concepts of visibility and inheritance when accessing positive and negative UC.

The User Common policy for visibility and inheritance when running a McIDAS-X command is described below.

Does positive UC exist?

Should this application inherit negative UC?


For a complete list of the contents of User Common, see Chapter 6, Format of the Data Files.

Image frame objects

Image frame objects contain information describing the contents and appearance of a frame displayed on the McIDAS-X Image Window. McIDAS-X provides a variety of library functions and commands to manipulate the contents of frame objects. An individual frame object contains not only pixel values to display, but also tables for image color enhancements, graphics color enhancements and stretching tables.

Redirection tables

Redirection tables are stored on disk in the file $HOME/mcidas/data/LWPATH.NAM. When McIDAS-X is started, the contents of the current redirection table are loaded into shared memory. This is where the McIDAS-X disk file system retrieves its redirection information.

Resident programs

The second component of the McIDAS-X environment is resident programs. When a user types the mcidas command, the user-specified configuration information, which is in the text file $HOME/.mcidasrc, is determined.

Once the configuration information is extracted, the resident programs below are started.


The mcenv program performs the following procedures to start a McIDAS-X session:

The temporary directory created by mcenv stores session-dependent files such as frame directories, string tables and frame enhancement tables.


The mctext program performs the tasks below, as shown in Figure 2-8:

Figure 2-8. The mctext program controls command line input from the keyboard and displays text output on the Text and Command Window, while mcimage controls the McIDAS-X Image Window for displaying images and graphics.


The command line arguments for mctext can alter the number of text lines in the window buffer and recall the number of previously run commands. mctext can also start several other commands once it initializes its window environment.

When the mcidas script starts a session, one of the command arguments passed to mctext is mcimage.


As shown in Figure 2-8, the mcimage program does the following:

Applications programs

The third component of the McIDAS-X environment is applications programs. A McIDAS-X applications program is any program that runs from the McIDAS-X command line. McIDAS-X provides Application Programming Interface (API) functions that interact with all the McIDAS-X components described in this chapter. These API functions interact with the Image Window, Text and Command Window, and mouse. The programs access data both locally and through ADDE, and manipulate the contents of the session, as shown in Figure 2-9 below.

Figure 2-9. McIDAS-X applications rely on the API functions to read data files for them.

Figure 2-10 combines the three components of the McIDAS-X environment: the shared memory, resident programs and applications. The arrows represent APIs and imply the flow of data or information.

Figure 2-10. The McIDAS-X environment consists of shared memory, the resident programs mctext and mcimage, and user applications.

[Search Manual] [Table of Contents] [Go to Previous] [Go to Next]