$Id: README,v 1.1 1992/05/04 15:21:50 alan Exp $

---------------------------------------------------------------
     MIMPS Interactive Image Processing and Display Tool
---------------------------------------------------------------

1. INTRODUCTION

MIMPS was written by Ernie Armstrong, an employee of 
KRUG International / TSSI, near Dayton, Ohio.

MIMPS is used for comparing and analyzing infra-red images, however
it can be used for displaying and comparing any type of raster images. 
It was written entirely with PV-WAVE Command Language on
a Sun SPARCSTATION 2, running OpenWindows.  The user interface
widgets used throughout the application (buttons, cascading menus,
icons, etc.) were constructed entirely with PV-WAVE graphical primitives.

2. OVERVIEW

This application allows the user to interactively import one or two 
raster images for subsequent display, analysis, and manipulation.
While the package easily handles the display and manipulation of
single images, it was designed for the comparison of two images.
Typically, a control image (ideal conditions) and an experimental
image.  Buffers within the package allow images to be modified and
stored for later use. Functions are available to allow the user to
create images from within MIMPS.

File functions allow the user to load and save various images and 
image buffers to/from files, delete images, and create hardcopy
plots of images.

MIMPS contains functions for perfoming arithmetic (+, /, *, +, etc.),
logical (AND, OR, XOR, relational operations, and Boolean operations),
and mathematical (SIN, COS, TAN, ABS, LOG, SQRT, etc.) on images 
or between images.  These funtions are designed for analytically
comparing images.  Fast Fourier Transforms are also supplied.
Another function allows the user to perform filtering and
smoothing operations on images.

Visual functions such as edge detection, image profiling, rotation,
zoom, and image shift are supported.  Aside from being able to display
raster images, MIMPS also supports 3-D shaded surface(s), contour
(isobar) plots, and the ability to display a table of statistical
information about a particular image (MIN, MAX, Sum of the squares,
Standard Deviation, etc.)

Other operations allow users to align two images, cut and paste
parts of images, normalize images, and resize an image.

NOTE: In addition to being a useful image display, manipulation, and
analysis tool, MIMPS is an excellent example of how PV-WAVE window
and graphics functions can be used to build a user interface.
MIMPS is modular enough that developers may want to use certain parts 
of the MIMPS user interface procedures in their own applications. 
For example, the buttons, cascading menus, surface display widget,
image rotation/zoom widget, image profile widget, etc., can be very
useful in the construction of other applications that need similar
user interface elements.

3. USAGE

Currently, MIMPS can read 512x512 8-bit byte grayscale raster images.
MIMPS can be modified to accept different sized images. 
See section 6 below, "MODIFYING MIMPS".

Make sure you are in the directory that contains the MIMPS files
(look for ms_main.pro).  At the WAVE prompt, type: ms_main
A dark blue window will be displayed with buttons across the top.

The following is taken from the comment header in ms_main.pro.

	Use:	MS_MAIN, demo =, save =

	In:	
	demo		(i)	The switch to activate the demostration.
	save		(i)	The switch to activate the save 
					procedure for the demostration.
	Abstract:	
		MS_MAIN is used as the main driver for processing part of
	the MIMPS image data.  The user selects option using the cursor and
	mouse button.  The user also has the option to create a demostration
	by setting the SAVE switch to a value greater than zero.  The the 
	cursor information will be saved into a file (DEMO.SAVE) where by
	the user can play back the save demostration by setting the DEMO switch
	to a value greater than zero.

4. MENU ITEMS

The following is a brief description of what each menu button does.
It is important to note that some of the functions in the menus are
inoperable (indicated by the menu disappearing and nothing happening).
This is because certain functions in MIMPS are targeted for future
development, but were not implemented with this release.  Functionality
may be added to MIMPS.  See section 6 below, "MODIFYING MIMPS".

Menus are synchronous, i.e., you must be "out of" a menu or set of
menus before you are allowed to select another menu item.  CANCEL in
all menus allows you to "back out" of a menu.  To continue after
displaying graphics, you will be asked to click in the graphics area.

IMPORTANT: When asked to enter data such as a filename or numerical
value, your mouse cursor MUST be clicked in the shell window from which
PV-WAVE and MIMPS were started (i.e, that window must have keyboard
focus).  MIMPS actually takes it's keyboard input from your shell 
window, but echoes the characters into the menu window that is
requesting the keyboard input.  For this reason, it may be a good
idea to move the window from which you started MIMPS to a place on the
screen where it can easily be accessed without having to obscure the
main "MIMPS Simulation/Processing" window each time.

Listed below are the currently available major menu options.

CONTROL -
   Controls internal aspects of the MIMPS application (e.g., colortable).

FILE/DISPLAY - 
   Allows loading/saving images to/from disk, creating images internally,
   controlling hardcopy output, and deleting images from disk.

OPERATIONS -
   For performing "physical" operations on images, such as alignment,
   Cut and Paste, normalizing, and resizing.  The Apod functions allows
   for a variety of image filtering and smoothing.  See file apod.pro.

PROCEDURES - 
   For displaying images as 3-D surface(s), contour (isobar) plots,
   and raster images.  Also allows analysis of image(s) via FFT,
   image profiling, power function, and edge detection.  Functions
   such as Rotate and Zoom and image shifting are supported here.
   Image statistics (MIN, MAX, MEAN, Standard Deviation, sum of the
   squares, etc.) can also be obtained from this menu.

CALCULATIONS - 
   The following sub-menus perform many useful operations on images:
   Arithmetic Options - 
      Unary negation (like +/- key on a calculator)  
      Algebraic add (+)
      Algebraic subtract (-)
      Algebraic multiply (*)
      Algebraic divide (/)
      Exponentiation
   Logical Options -
      Logical AND, OR, XOR
      Boolean operators EQ, NE, LT, LE, GT, GE (returns image w/ 1's and 0's)
      Relational operators > and <  (for thresholding and filtering) 
   Mathematical Functions -
      Absolute Value
      Arc Cosine
      Natural Logarithm
      Base-10 Logarithm
      Arc Sine
      Arc Tangent
      Cosine
      Hyperbolic Cosine
      Natural Exponentiation
      Sine
      Hyperbolic Sine
      Square Root
      Tangent
      Hyberbolic Tangent

HELP -
   A help function is not supported at this time.  However, the DOC_LIBRARY
   procedure in PV-WAVE can be used to extract the comment headers
   from each .pro file, for example, from the PV-WAVE prompt:

   DOC_LIBRARY, 'ms_main'  ; Prints descriptive comments to the screen.
   DOC_LIBRARY, 'ms_main', Print='cat >abcd'  ; Prints descriptive comments
					      ; to a file called abcd.

5. IMAGE BUFFERS
      
In general, the five available image buffers can be described
as follows.  The current image size is limited to 512x512 pixels, 
however MIMPS could be modified to allow different image sizes.
The image buffers are essentially identical, but are defined
functionally to make it easier to keep track of several images as
they are displayed or modified:

Primary Image:  Usually, the control or "standard" image.

Secondary Image: Usually, the image being compared.

Work Image A: Storage space for any modified image.

Work Image B: Storage space for any modified image.

Resultant Image:  Usually, a modified image is stored here
automatically after an operation, procedure, or calculation
has been performed on it.

6. MODIFYING MIMPS 

MIMPS was written entirely using PV-WAVE Command Language.

It is possible to add functions to MIMPS and modify the operation
of the program by exploring the init_*.pro startup files.
In general, the menus will resize themselves to accomodate
new options.  You must also add the "callback" to your new function
in the CASE statement in the menu pulldown file pertaining to the
the new function.  See the ms_*.pro files.

The size of images read from a file may be modified.  See the files
ms_read_file.pro and ms_write_file.pro.  Also, there are window size
definitions in ms_create_image.pro and init_params.pro.  Best to grep
for the string "512" (the current value): % grep 512 *.pro | more
Or, one may wish to build in a menu option that allows the definition
of image sizes other than 512x512.

Colortables may be modified and changed by looking at the init_colors.pro
and init_greys.pro files.  Colors for the interface are defined there.

"cntrl_*.pro" files can be changed to modify the behavior of the 
various options in MIMPS. 

"draw_*.pro" files contain the PV-WAVE code used to draw buttons, menus,
and interactive widgets used throughout MIMPS.  These may be most
useful for developers who wish to include a user interface
into their application.

The *.inc files are include files that contain common block definitions
used throughout MIMPS.  If a module is used in another application,
the values described by these common blocks will have to be modified
so the routine will work properly in the new application.

Most of the other *.pro files are the actual algorithms that perform
operations on images.  These were for operations that are not available 
directly from PV-WAVE, and may also be useful in other image processing
applications.

7. DISCLAIMER

This application and its component parts are freely available 
to any PV-WAVE user or developer to use at their own discretion, 
except that MIMPS may not be sold outright as a whole.

