				-----------------

				TS-IP USERS GUIDE

				version 2.8

				-----------------



	Documented by Rob Urzi for T. S. Kelso and Yupo Chan

	Updated by Yupo Chan and Brad Smith 05/1997 

	And again by Yupo Chan 06/2011





TABLE OF CONTENTS



1.      Introduction

2.      Loading

3.      The Program Screen 

4.      The Main Menu

5.      Selecting Windows & Loading Images

6.      Blank, Copy, and Redisplay Commands

7.      The Show All & Overlay Commands

8.      The Examine Command

9.      Histograms

10.     Zooming

11.     Contour Plots

12.     Palette/Color Scale

13.     The Filter Menu

14.     Saving an Image

15.     Quitting the Program





I.  INTRODUCTION



	The TS-IP program is a program that loads and manipulates computer-

digitized satellite images.  The initials TS-IP stand for Training 

System\Image processing.  This program allows for a variety of mathematical 

options that may be applied to image data, thus transforming raw spatial-data 

into useful information. Up to three different images may be loaded and used 

at the same time.  The current version of TS-IP in use is version 2.8. This 

program was written by T. S. Kelso for the sole intention of instructional 

use at the Air Force Institute of Technology.  Since this program was written 

"in-house," it continues to be revised and improved.  Therefore, you may find 

additional options, commands and loopholes that have not been addressed in 

this version of the user?s guide.  The program is copyrighted 14 Jan. 1993. 

Permission is obtained from T. S. Kelso for use in this book.



	For convenience, the adaptation here includes the executable code and 

only one image file, PENTAGON.IMG. Additional images will Obviously, the 

users can supplement the image file with his/her own image selections, 

including those included in the IMAGEFILES subdirectory.



II.  LOADING TS-IP



	The TS-IP program runs under MS-DOS on any PC that has a 256 color VGA 

graphics card and a VGA monitor.  Over the years, changes in hardware 

configuration has rendered this `legacy? programs inoperable on newer 

machines. Fortunately, there is a software called DOS BOX which will simulate 

an old DOS machine. To use this feature, please go to the README file at the 

root of this suite of software. 



        To begin TS-IP, you must follow these steps: It is important to 

repeat that TS-IP only runs under an appropriate DOS environment.  To run TS-

IP on a machine running a version of Windows you must open an appropriate DOS 

window.  If the window is not already in full-screen mode you must change it 

to full-screen by holding the ALT key down and pressing ENTER.



	From the DOS prompt, switch to the drive the software is in.  For most

users, this is drive C:.  Change to this drive by typing c:.  Change the 

directory by typing the regular change directory command cd 

book\space\images, whichever options apply.  (This will put you in 

the images sub-directory of the space directory).  Type the command ts-ipx28  

(This is the name of the .exe file that will run the program). TS-IP will now 

load.  A parallel procedure is followed when using DOS BOX.



	NOTE: If you encounter difficulties in loading TS-IP, check the

settings in the file named ts-ip.cfg in the images directory.  Make sure that

the drive letter settings are correct.  Also, if your video card cannot 

display 640x480 resolution at 256 colors, you may try to change the video 

mode setting. TS-IP is best run from DOS, so if you are running a newer 

Windows machine you should boot into DOS mode (or use DOS BOX) before 

running.



III. THE PROGRAM SCREEN 



	The first screen you will see is an informational screen about TS-IP.  

Hit the return key to get past this screen once you are done reading it.  The 

next screen displayed is your program screen.  This screen is divided into 

four sections called windows.  The lower left hand window should contain a 

series of commands and options.  This is the main menu.  The other three 

windows, which are blank, are your working windows.  It is in these three 

windows where the images will be loaded and displayed.  Each of these windows 

is assigned a number.  The upper left-hand corner is window number 1, the 

upper right-hand corner is window number 2, and the bottom right-hand corner 

is window number 3.  The main menu window is not assigned a number because it 

can be accessed at all times.  When commands are registered by the computer 

the program will signal with a beep.     



IV.  THE MAIN MENU



	The Main Menu (in the lower left-hand corner) provides options for 

image manipulation.  These options are presented in a format from A to Z.  

You need only to press the corresponding key to load that particular option.  

For example, if you wished to leave TS-IP, then you would press the Q key for 

the quit option.  The following is a list of options and a brief description:

	

A) Add Image:       Adds an image to the image in current window.

B) Blank Window:    Blanks out current window.                      

C) Copy Window:     Copies the contents from one window to another.

E) Examine Image:   Gives either a line chart or a point chart for the x,y 

and z coordinates.

F) Filters:         Brings up a sub-menu of filtering techniques.           

G) Group Images:    Groups multi-spectral images together.

H) Histograms:      Brings up a sub-menu of options for a histogram.

I) Invert Image:    Inverts selected image (loading upside down)

J) Contour Plot:    Allows for a fixed or variable plot to be drawn.

K) Classification:  Classifies image (histogram, 1D, 2D) Note: this function 

is currently not implemented and will cause the program to crash. To perform 

classification, please use the software in the PATTERN folder.

L) Load Image:      Loads an image into a the selected window.      

O) Overlay:         Overlays one image on top of another.  Has a sub-menu of 

choices.

P) Palette:         Changes the color scale.

Q) Quit:            Exits you from TS-IP, brings you back to MS-DOS.

R) Redisplay Image: Redisplays the original image loaded in a particular 

window.

S) Show All:        All windows display selected image, or view a very large 

image.

W) Select Window:   Selects a window for you to work on. 

X) Cut Section:     Selects a portion of an image and writes it to disk.

Z) Zoom:            Magnifies a certain section of an image.

?) Help Menu        Redisplays main menu in bottom left-hand corner.



	Note that every letter does not have an option.  These options are 

stored for later use in future revisions of TS-IP.

 

V.  SELECTING WINDOWS & LOADING IMAGES



	Before you can load an image, you must first select one of the working 

windows where you would like the image to be placed.   You do this by hitting 

the W key off the main menu (select a window).  A little box will appear in 

the middle of your screen.  This box is a visible representation of the 

window that is currently selected.  You select the first, second or third 

window by either pressing the 1, 2, or 3 keys, respectively, and hit return.  

The illustration box will show your change and then disappear off the screen.  

The window you selected will remain as your working window until you change 

it again by using this same procedure.  

	Images and image manipulations will remain in the selected window even 

if you change to another working window.  A new image loaded into the same 

working window with an old image will replace the old image with the new one.  

The default working window is the number one window.  Once a working window 

has been selected, you may load in an image by hitting the L key.  A list of 

image data files will be displayed onto the screen.  Scroll through the list 

with the up/down arrow keys until you find the image you wish to load.  This 

file will be highlighted.  Then hit the return key.  The image will then load 

into your selected working window.   



	Example:  You wish to load the file Pentagon.img into the number 3 

window.  First hit W to select a window and then press 3 to select the third 

window.  Next, hit L to load the image and scroll through the list until the 

file Pentagon.img is highlighted.  Once it is highlighted, hit the return 

key.  The image will load onto the screen at the bottom right-hand corner.    



VI.  BLANK, COPY, AND REDISPLAY



	The blank command will clear the selected working window.  It is 

important to note that a working window does not have to be blanked before 

another image is displayed in the same space.  The Redisplay command will 

reload the image currently loaded in that particular working window.  The 

copy command will fill one working window with the contents of another.  

Therefore, the same image will be shown in multiple windows.  To use the copy 

command, first select the working window where the image to be duplicated is 

located.  Then select the copy command by pressing the C key and hitting 

return.  A representation box will then appear on the screen.  Press the 

button (1, 2, or 3) corresponding to the window where you would like to see 

the duplicated image located.  The window does not have to be blanked; the 

new image will replace the old one.



	Example:  An image is loaded into the second working window and you 

would like to use it in both the second and third working windows.  First, 

select the second window by hitting the W key and then the 2 key.  Next, hit 

the C key for the copy command.  Then press the 3 key to signify where you 

would like to put the duplicate image.  The same image will now be located in 

the second and third windows.

    

VII.  THE SHOW ALL & OVERLAY COMMANDS



	Some images, such as the Pentagon.img file, are very large and would 

take all four windows to display.  In such a case, the Show All command can 

fill all the working windows with the image.



	Example:  The pentagon.img file is actually broken down into four 

different sections.  When it is loaded normally into the first window, you 

are actually viewing only the top-left corner of the entire image.  You would 

need to use the Show All command to view the remainder of the image.



	To view the remainder of an image, you first must load the image using 

normal procedures as discussed in part five of this document.  Make sure the 

current selected window is the one with the desired image to view.  Then 

press the S key for the show all command.  The remaining windows will fill 

with the remaining parts of the image.  If there are no remaining parts, the 

same image section will be duplicated in the other windows instead.  By 

selecting different working windows, you are able to manipulate and view the 

various sections of a image.

	

	Example:  The pentagon.img file is loaded normally into the first 

window.  To view the remainder of the image, press the S key to activate the 

Show All command.  The top-right hand corner of the entire image will load 

into the second window, while the bottom right-hand corner of the image loads 

into the third window; thus forming one complete image.  However, the bottom 

left-hand corner image does not fill in the fourth window due to the main 

menu.  If you needed to view this corner, you would load the image 

pentagon.img file into the second window instead of the first window.  Then 

when you select the show all command, the bottom left-hand corner would load 

into the third window while the first window would remain blank.  



	 The Overlay command allows you to place one image over that of another 

to form a third image.  It also allows one to view a portion of a large image 

that was loaded using the Show All command.  The Overlay sub-menu can be 

accessed by pressing the O key.  This sub-menu has the following options:



	0)      Average

	1)      And

	2)      Or

	3)      Xor

	4)      Maximum

	5)      Minimum

	6)      Difference

	7)      Subtract

	8)      Dis Last (display last)

	9)      Dis All (display all)



	The desired option can be chosen by pressing the corresponding numeric 

key.  The program will then ask you which image file that you would like to 

use.  Select the window where you would like to overlay the image.



VIII.  EXAMINE IMAGE



	The Examine Image command allows you to view an image by its x, y and z 

(gray shading) coordinates for any given pixel (point).  It also allows you 

to examine the image by a vertical line-by-line representation of the peaks 

and valleys.  To run the examine command, first select the window with the 

desired image.  Then hit the E key.  A small sub menu will appear and list 

out two options:  either 0) Point or 1) Line.  Hit the 0 key if you wish to 

examine the xyz coordinate or 1 if you wish to examine by using the "peaks 

and valleys" line.  If you hit the 0 key, a small cross-hair arrow will 

appear over the image.  You may move this arrow to any point over the image 

by using the arrow keys.  A corner box will appear on the monitor and display 

the x, y, z value of the current spot.  When you are done examining the image 

press the escape (Esc) key.

	By pressing the second option a vertical line will be drawn across the 

face of the image.  A vertical line bar will also appear in the window over 

the main menu.  A second line will be drawn over the window where the main 

menu is located.  This is the "peaks and valleys" line representing the data 

points along the line that was placed over the image.  The line over the 

image can be moved from left and right with the arrow keys.  Once your 

examination is done press the escape (Esc) key.  Then hit the ? key to bring 

back the main menu.



	Example:  You wish to examine the xyz coordinates of an image that is 

located in the third working window.  After you select the third window hit 

the E key.  Then press the 0 key.  A cross-hair appears in the image along 

with the coordinate box.  Note again that the z coordinate is the gray 

shading value, where the lower the number then darker the image.  Once you 

are done examining the image hit the Esc key.

      

IX.  HISTOGRAMS



	You may display a histogram of the image by pressing the H key.  You 

will be presented with a sub-menu of four options: 



	0.  Display

	1.  Linstretch

	2.  Logstretch

	3.  Equalize



	Press the corresponding numeric key for the desired choice.  The 

histogram will appear over the window with the main menu.  Do not be alarmed 

if it takes several minutes for it to load.  When you are finished hit the 

escape key and the ? key.  The main menu will then appear.



	Example:  You wish to examine the histogram of an image using the 

linear stretch option.  After you select the appropriate window hit the H 

key.  Then press the 1 key.  The histogram will appear with a diagonal line 

through the middle and a vertical line at the left edge of the box.  Using 

the arrow keys, move the vertical line to the position you want it and press 

enter.  A vertical line will then appear at the right edge of the box. Again, 

move this to the correct position and press enter.  The pixel values 

remaining between the vertical bars will then be stretched out linearly among 

the entire palette, and the image will be redrawn.  Once you are done 

examining the image hit the Esc key.



NOTE:  This might take several minutes (it acts as if the system crashed but 

that is not the case - it just takes a while to load back in).   



X.  ZOOMING



	The zoom command allows you to magnify a certain area of an image.  To 

use the zoom command, first select the window with the desired image, and 

then press the Z key.  Four zooming options will appear:



	0. Blow Up

	1. Neighbor

	2. Bilinear

	3. Cubic



	Press the numeric key for the desired choice.  A square will appear 

over the image.  Position the square over the area of the image in which you 

would like to magnify by using the arrow keys.  Once it is in position, hit 

the return key.  The window selection box will now appear; select the window 

in which you would like to place the magnified image.  The magnified image 

will now appear in the desired window.  



	Example:  The image Pentagon.img is loaded in the third window, and you 

wish to zoom in on the right-most corner and place magnification in the 

second window.  First, you select the third window and press the Z key.  

Next, position the box in the corner by moving it with the arrow keys.  Then 

press the return key and select the second window by hitting the 2 key.  The 

magnification will now appear in the second window.



Note:  The cut section command is almost identical to the zoom command in 

operation but is different in that it cuts out a certain area rather than 

magnifying it.   

     

XI. CONTOUR PLOTS



	TS-IP allows you to examine a contour plot of an image.  To use this 

command, first select the window with the desired image to contour.  Then 

press the J key.  A sub menu of choice will appear. The plot may be loaded as 

either being fixed (1 through 5) or variable (1-5).  Choose the desired 

option by pressing the corresponding numeric key.          

	0.      Fixed 1

	1.      Fixed 2

	2.      Fixed 3

	3.      Fixed 4

	4.      Fixed 5

	5.      Variable 1

	6.      Variable 2

	7.      Variable 3

	8.      Variable 4

	9.      Variable 5

	

	These numbers represent the number of gradations which will be shown.  

Once you have made your choice, the program will prompt display the 

gradations in the fourth window along with the shading graph.  Press the 

return key to cycle through these lines.  Next, the program will ask you for 

the window in which to display this plot.  Select this desired window by 

pressing either 1, 2 or 3. and hitting return.  When you are finished with 

your examination press the escape key and then ? to return the main menu.



	Example:  You wish to view the contour plot using 3 fixed gradation 

values of the pentagon.img image, which is currently loaded onto window one.  

Select the first window and then hit the J key, then press the 2 key.  The 

line gradation plot will appear over the main menu.  Press the return key 

three times to view the three different separation lines.  Then select the 

desired output window by pressing either 1, 2 or 3.  After you are done, 

return to the main menu by pressing the Esc key followed by the ? key.

	

XII. PALETTE/COLOR SCALE



	The color scale may be changed depending on the image clarification 

and/or personal taste.  This scale is based on the principle of either 

shading from light to dark or using a color spectrum.  The program defaults 

on a 256 gray-shading scale.  The color scale may be changed by pressing the 

P key, which will give you a list of 30 various color schemes from which to 

choose from.  You may circulate through this list by using the arrow keys.  

Press return when you highlight a scheme of your choosing.  The scheme may be 

changed as often as you desire.



	Example:  You wish to change the 256 Gray shading scheme to a color 

rainbow scheme.  Therefore, press the P key and cycle through the list with 

the arrow keys until the choice Rainbow is highlighted.  Hit the return key, 

and the screen will instantly change to the new scheme.



XIII.  THE FILTER MENU



	Filtering is one of the most important parts of image manipulation.  

Various commands such as Sobel convolution, fast Fourier transform, Laplacian 

transformations, and noise removal are just some examples of how an image can 

be clarified.  The Filter option will bring up a sub menu of choices which 

will perform these commands.  The sub-menu is presented in a format identical 

to that of the main menu.  The options off this menu are:

	A)      Average

	B)      Blur    

	C)      Crispen

	D)      Line Detection

	F)      FFT

	L)      Laplacian

	M)      Median

	N)      Noise Removal

	S)      Sobel 

	X)      Sharpen

	Z)      Special 



	The options are chosen by pressing the appropriate letter key. Many of 

these options will give you a sub-menu of choices.  Average & Median (options 

A & M) will give you a 3x3 and a 4x4 option.  Crispen and Sharpen will give 

you a high, medium, and low option.  Line detection can be horizontal, 

vertical, diagonal (top-left to bottom right) or diagonal2 (top right to 

bottom left).  Noise removal can be primary, secondary, 3x3, or 4x4.  Sobel 

convolution will present a sub-menu of G(x) and G(y) options.  Regardless of 

which of these commands that you give the program, it will prompt you for the 

destination display window.  Once the filtered image is displayed, the main 

menu will reappear in the bottom-left corner. 



	Example:  You wish to filter an image using the 3x3 noise removal 

algorithm.  Therefore, you would select the appropriate window and press the 

F key to bring up the Filters menu.  Then press the N key to select Noise 

Removal, and choose 2 for Median 3x3.  The program will process the image 

from left to right as you watch.  You can then continue to work with this 

window.



XIV.  SAVING AN IMAGE



        There are two ways to save an image.  You may either save the window

or save the entire screen.  To save a window first highlight the appropriate

window using the 'W' command and then press the comma key.  To save the 

screen simply press the period key at any time.  These commands create 

several files in the \book\space\images\work subdirectory.  For example, if 

you saved a window and there were no previous saved files in the directory, 

the files created would be named window-a.raw and window-a.bat.  Subsequent 

files would be named window-b.raw, window-c.raw, and so on.  Screen saved 

files are named screen-a.raw and screen-a.bat, for example.  The raw format 

is not used by most software, but by using these two files it is possible to 

create a gif file, which is a common image format.  After you exit TS-IP 

change directories to the work subdirectory by typing cd work.  Then execute 

the batch file corresponding to the name of the image you saved.  In the 

above example, you would type window-a which would create a file named 

window-a.gif.



XV.  QUITTING THE PROGRAM



	You may leave TS-IP by selecting the quit option off of the main menu 

(pressing the Q key).  This will bring you back to DOS at the following 

location:



                c:\book\space\images>



	You can exit the TS-IP program at any time by pressing down the control 

key and hitting the pause/break key (i.e. Ctrl-Break).  This is useful if the 

program locks up or crashes.

