home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Photo CD Demo 1
/
Demo.bin
/
imagetoo
/
imagtlch.asc
< prev
next >
Wrap
Text File
|
1992-07-17
|
22KB
|
640 lines
Learning to Use NCSA ImageTool 1.1
January 1991
1.1 NCSA ImageTool
Learning to Use NCSA ImageTool 1.1
National Center for Supercomputing Applications
January 1991
June 1990
Chapter 1 Learning to Use NCSA ImageTool
Chapter Overview
SunView Basics
Starting SunView
Using SunView Menus
Text Editing in SunView
Getting Started with NCSA ImageTool
TTY Window
Control Window
Message Window
Scroll Bars
Menu Window
Canvas
Loading Images
Specifying Load Information
Setting Load Origin Points
Loading an Image
Manipulating Images
Selecting Areas of the Canvas
Cut, Copy, Paste and Clear Options
Changing Magnification
Stacking Images
Saving Images
Options
Online Help
Chapter Overview
This chapter outlines how to use NCSA ImageTool on your Sun
Workstation through the SunView windowing system. Refer to the
Glossary for definitions of unfamiliar terminology. To use this
tutorial, you need to have a raster file. A raster file consists of a
stream of bytes representing the data matrix. The raster file
format is described in more detail in Chapter 2, "Formatting Your
Data Files."
You may continue your tutorial using Chapter 3, "Animation,
Palettes, and Plots," which covers more advanced display options
available in NCSA ImageTool.
SunView Basics
SunView is Sun's icon-based windowing system. It provides you
with a user interface that uses the mouse, keyboard, and graphics
capabilities of the Sun Workstation to create a user friendly,
menu-driven environment. NCSA ImageTool is designed to
operate under SunView. SunView handles all the windows, input
and screen drawings. NCSA ImageTool only handles those events
that SunView cannot. Following is a description of the basic usage
of the SunView windowing software. For more detailed
information on how to use SunView, refer to the Sun Microsystems
manual, Windows and Window Based Tools: Beginner's Guide.
Starting SunView
To start SunView, first log in on the Sun Workstation. After the
system prompt appears, enter:
suntools
and press RETURN. The screen clears and then fills with a gray
background. Icons and windows appear on the screen. The icons
represent tools that are loaded and ready for use, but are presently
idle. Clicking the left mouse button on the application icon
activates that application, usually causing a new window to
appear.
You can also close applications that are already opened when you
start SunView. Once closed, you'll see the icon for that application
appear somewhere on the screen.
You can change the beginning configuration of the screen to suit
your preferences. For more information on reconfiguring the
default layout of the screen, refer to the Sun Microsystems manual.
Using SunView Menus
To view the SunView pop-up menu and its application options,
press the right mouse button while the pointer is anywhere in the
gray background on the screen. This menu is configurable, and
you can customize its contents to your tastes. (Refer to the Sun
Microsystems manual for more information.) To exit SunView,
select the Exit Suntools entry from the menu, then click the left
mouse button.
A standard menu is also available for window manipulation.
Press the right mouse button anywhere near the edge of any
application window to expose the menu. The items of this menu are
Move, Resize, Hide, Expose, and Redisplay windows. The Close
option closes the window and adds an icon of the application to the
screen. Quit exits the application associated with the window and
deletes it from memory.
Text Editing in SunView
Some windows contain editable fields you use to enter text. To edit
one of these fields:
1. Move the mouse into the window or window containing the text
field. A blinking, triangular cursor appears, indicating the text
insertion point.
2. Try typing a character on the keyboard to insert the character at
the cursor, which then moves one space to the right.
You can move the cursor to various text fields with either the TAB
key or the mouse. Pressing TAB selects the next text field,
allowing you to sequence through the fields. To select a text field
using the mouse, position the mouse on the text field and click the
left mouse button. The selected text field becomes highlighted,
allowing you to enter text.
Press DELETE to delete the character in front of the cursor. Press
the L10 function key to delete the entire selection.
Getting Started with NCSA ImageTool
Once SunView is running, you can start up NCSA ImageTool. To
do this, open the console window if it is not already open. At the
prompt, enter:
imagetool &
and press RETURN.
NOTE: If NCSA ImageTool is not in your current directory,
preface the application name with the pathname.
The main NCSA ImageTool frame (Figure 1.1) appears on your
screen. The NCSA ImageTool frame contains five windows.
These windows are the tty, the Control, the Message, the Menu and
the Canvas windows.
Figure 1.1 Main NCSA
ImageTool Frame
TTY Window
The tty window runs a shell you can use to communicate with the
operating system, just as you would from the console window. You
cannot resize this window nor scroll its contents.
Control Window
The Control window contains some text fields and some standard
control buttons. The control buttons are labeled Clear, Cancel, and
Quit.
Clear
Clear clears the previously loaded or selected region or image.
Click Clear twice to clear the entire canvas.
Cancel
Cancel clears the canvas unless stacking or animation modes are
active. If you've activated one of these modes, press Cancel to
return NCSA ImageTool to normal operation.
Quit
Quit stops execution and purges all memory used by NCSA
ImageTool.
There are also several text fields in the Control window which you
use to specify a default directory, an image file specification with
wildcard characters, the image's x and y dimensions, and a
palette file.
NOTE: Each of these text fields has a menu associated with it. For
a more detailed discussion of these menus, refer to the section,
"Text Fields and Other Control Window Menus," in Chapter 4.
Briefly, the menus help you to change the current directory, load an
image, specify the type of file you're loading, start an animation
sequence, load a palette, select the type of SDS scaling for a
scientific dataset, and perform other operations.
Message Window
The Message window contains error messages, warnings, and
descriptive information about NCSA ImageTool. The messages
are numbered from 1 to 20, beginning over at 1 after each cycle of
20. You may scroll through this window's contents, using the
actions outlined in the next section, "Scroll Bars."
Scroll Bars
You can use scroll bars in a variety of ways wherever they are
present in this program. The results you get depend on the mouse
position and the mouse buttons you press. Scroll arrows are the
small rectangular shaped objects at either end of a scroll bar. The
scroll bar content is the gray area between the two sets of scroll
arrows. The locator is the darker gray area that indicates the
present location in the text or canvas. Here are the ways you can
use the scroll bars:
Ñ To move quickly through the file, select a location for the locator
by moving the mouse to the location in the gray area and
clicking the middle button. The locator moves to that location
and jumps the text to that relative location.
Ñ To scroll through window contents an entire page at a time,
click the middle mouse button on either set of the scroll arrows.
You can also move one page at a time by clicking the left mouse
button in the gray area below the locator. Clicking the right
mouse button in this area scrolls up the text one entire page.
Ñ To scroll through text several lines at a time, place the mouse in
the gray area above the locator. Click on the left button to scroll
the text up; click on the right button to scroll the text down.
Ñ To scroll a single line at a time, place the mouse in the scroll
arrow areas and click the right button to scroll up and the left
button to scroll down.
Menu Window
The Menu window (Figure 1.2) contains a row of buttons with
associated menus that you can use to perform the majority of the
functions. The controls are labeled Image, Edit, Palette, Zoom,
Graph, FTP, Help, and Options. These menus handle image
loading, editing of the Canvas, palette manipulations,
magnification, plotting and graphing, FTP operation, online help,
and default settings, respectively.
Figure 1.2 Button Panel
Click the left mouse button on one of these controls to cause the
default action. Press the right mouse button on a control to display
its entire menu.
Canvas
The Canvas is the area in which image display and drawing
occurs. The Canvas is 1150 pixels wide and 900 pixels high. You
can neither load an image with dimensions larger than this, nor
magnify an image beyond these dimensions. Clicking the mouse
buttons in the Canvas area can cause any number of actions to be
performed, depending on the operational mode you are in. For
more information on mouse button usage, see Appendix A, "NCSA
ImageTool Mouse Button Usage."
Loading Images
Before loading an image into NCSA ImageTool, you need to
specify the name of the file to be loaded, its directory, its file type,
its palette name (if one exists) and, if its not an HDF file, its
dimensions.
Specifying Load
Information
In the Control window's text fields, enter the following
information for the file you are loading:
Ñ The default directory name
NOTE: Entering the directory name in this field does not
actually change the current directory. To do so, press CTRL-C
at the end of the directory name in the text field, or select Change
directory from the menu (Figure 1.3) for this field.
Figure 1.3 Directory Text Field
Menu
Ñ The image filename
The Image field enters the raster file specification. You can use
wildcard characters (* and ?). The fields labeled Xdim and
Ydim contain the width and height of the image. If these values
are not correct, the program will not display the image properly.
The menus for the Xdim and Ydim field only position the cursor
at the end of the field for data entry.
Ñ The type of file you're loading
Indicate the file type by clicking in the circle labeled,
Loading?, and then, using the right mouse button, selecting the
appropriate file type from the menu that appears.
Ñ The dimensions of the file
HDF files have the capacity to contain dimensions of its
images, thus you shouldn't have to enter text in the Xdim and
Ydim fields if you're using HDF files.
Ñ The palette filename
If no palette exists for your file, NCSA ImageTool applies a
default palette, which you've specified, to your image.
Ñ The SDS Scaling
If you are loading a scientific dataset, click in the circle labeled
SDS Scaling. Choose the desired type of scaling from the menu
that appears, using the right mouse button.
Setting Load Origin Points
Before loading the raster file, specify the Canvas location for the
image. To do this, move the mouse onto the Canvas. Click the left
mouse button to select an origin point at which the next drawing
operation will start. NCSA ImageTool aligns the upper left-hand
corner of the image to this origin point.
Loading an Image
You can load an image in several ways as outlined below.
1. Select Load image from file from the menu associated with the
Image text field (located in the Control window.)
2. Press CTRL-L, at the end of the Image text field.
3. Select the Load option of the Image menu (located in the Menu
window╤Figure 1.4).
Figure 1.4 Image Menu
4. Click the Image button using the left mouse button.
5. Click the left mouse button twice on the Canvas. This action
simultaneously sets the origin point and loads an image.
However, if you click the right mouse button, the program
forgets the origin. The next time you click the left mouse button,
NCSA ImageTool sets the origin point to the new location, but
does not load the image.
You can also load an image from a file of 32-bit floating-point
numbers. Select Floating point from the Load submenu. The file is
interpreted as a stream of binary floating point numbers. A dialog
box appears that allows you to enter the minimum and maximum
data to be used for the scale. A toggle button allows you to select
linear or logarithmic scaling. The only way to load a floating
point file is to select this menu item.
Manipulating Images
Now that NCSA ImageTool has displayed your image, you can
perform a variety of manipulations on it, such as cutting portions
of the image, copying entire images or pieces of an image, or
magnifying and reducing the image in a variety of ways.
Selecting Areas of the
Canvas
Manipulations can operate on entire images, portion of images, or
portions of the Canvas. To select an area:
1. Depressing the middle mouse button and drag out a rectangle
around the desired area. A white border appears around the
selected area.
2. Release the mouse button.
3. Select the operation to perform on the selection.
You can cut, copy, and clear on the selection area. 3D and contour
plots use the selection mechanism to accumulate data points to be
plotted. (Refer to Chapter 3, the sections, "Contour Plots," and "3D
Plots.") Selecting the Save option stores the selection to a file.
Cut, Copy, Paste and Clear
Options
Standard editing options╤Cut, Copy, Paste, and Clear╤are all
available under the Edit menu (Figure 1.5).
Figure 1.5 Edit Menu
They operate on the selected area or the area of the most recent
drawing. These functions work as follows:
Cut
Cut removes the selection from the Canvas and adds it to the paste
buffer.
Copy
Copy copies the selection to the paste buffer.
Paste
Paste redraws the contents of the paste buffer at whatever location
you choose on the Canvas. After selecting Paste from the Edit
menu, move the mouse into the Canvas area and press the middle
mouse button. A border outlining the contents of the paste buffer
appears on the Canvas. While holding down the mouse button,
drag the border to the desired location the Canvas and release the
button. The image appears at that location.
Clear
Clear removes the selected region from the Canvas, but does not
store it in the paste buffer. The cleared region is permanently
deleted.
Changing Magnification
You can enlarge images by using the Zoom menu options
(Figure 1.6). NCSA ImageTool performs these operations on the
selection or the most recently drawn area. You can continue to
enlarge the image by repeatedly selecting these options.
Figure 1.6 Zoom Menu
Pixel
Pixel expands the image by duplicating pixels. Each time you
select this item, the image expands by a factor of two.
Expand
Expand specifies the magnification factors for the X and Y
dimension independently. When you select this option, a dialog
box appears. In it, specify the X and Y expansion factors, and click
OK. If you click Cancel, the operation aborts. Once again, the
expansion is a pixel expansion.
Interp
Interp creates an interpolated expansion of the selected region.
Interpolation is similar to magnification or minification except
that it generates a smoothed image. The effects of interpolation are
not reversible, because the pixels are not merely duplicated; rather,
a mathematical function (bilinear interpolation) is applied to
estimate the value of the additional or remaining pixels by taking
a weighted average of the known values of their neighboring
pixels. For the same reason, interpolation produces a smoother
image than simple magnification or minification. NCSA
ImageTool interpolates the image by a factor of two each time you
select the option.
Undo
Undo allows you to cancel the most recent magnification
operation.
NOTE: Do not expand an image beyond the dimensions of the
Canvas (1150 x 900 pixels).
Stacking Images
NCSA ImageTool saves images or selections and their palettes
using a stack mechanism. The stack holds up to ten images and
their palettes. When you enter stack mode by selecting Stack from
the Image menu, new buttons, Store, Delete, and Show, appear in
the Control window. These buttons store, delete and show the
images residing in the stack. The flush button clear the entire
stack. Menus are available for each of the buttons.
To enter stack mode, select Stack from the Image menu. The stack
buttons appear. To exit stack mode, click on the Cancel button in
the Control window.
These buttons all work on individual stack elements, not the entire
stack. Notice that a number is displayed to the right of each button.
This number, ranging from 1 to 10, is an index into the stack
denoting the entry that is affected the next time you press the button.
For example, if the number beside Delete is 3, then clicking on the
button deletes entry three in the stack.
NOTE: While in stack mode, clicking the right mouse button
displays the menus for the stack buttons; the left button activates the
control buttons.
Store
The Store button stores/adds items to the stack.
Show
The Show button displays the indexed stack entry at the origin
point.
Delete
The Delete button deletes the indexed entry from the stack.
Flush
Flush purges the contents of the entire stack and resets the indexes
to 1.
The stack control buttons have identical menus that are displayed
if you click the right mouse button.
Saving Images
You can save images or selections to disk. To save the current
selection or image:
1. Select Save from the Image menu.
2. Enter the filename for the image in the dialog box.
3. Click the OK button to continue with the operation or click
Cancel to abort the operation.
If the image is not part of an HDF file, NCSA ImageTool appends
the dimensions of the selected image to the filename, which the
program displays in the tty window. If you do not remember or
record these dimensions, you may have difficulty loading the
image properly.
Options
You can customize the NCSA ImageTool program to your
specifications by using the Option menu.When you make any
selection from this menu (Figure 1.7), a dialog box appears.
Figure 1.7 Option Menu
Set default paths
Set default paths option alters some of the defaults in the
.imagetool_defaults file. The first text field is labeled Default
image directory. The pathname appearing in this field is used as
the current directory when NCSA ImageTool starts up. This is also
the case with the Default palette field. The Default help file
directory field should contain the path name of a directory in
which NCSA ImageTool can find the help files for the Help menu.
Click Cancel in this dialog box and no changes are made to the
file. Click OK and another dialog box is displayed. To confirm the
save, click OK to save the defaults and make them permanent or
click Cancel to stop the operation.
Set laser printer default
The Set laser printer default option sets the name of the default
printer. This printer must be a postscript printer. A dialog box is
displayed that contains a text field labeled Printer name. Enter the
name of the printer in this field and click OK to record the new
default, or click Cancel to abort.
Set reversed image ON?
The Set reversed image ON? option reverses the orientation of the
images horizontally when they are loaded. In the dialog box that
appears, enter y in the text field to set reversed images or enter n to
cancel the process. Then click OK to accept or Cancel to abort.
Set dark background ON?
The Set dark background ON? option sets the background to black.
The background color is the color of the background of the canvas
and other panels. This setting is useful for taking photographs or
shooting videotapes of the screen. If you select this item, a dialog
box is displayed just like the one that appears for Set reversed
image. Enter y in the text field to change the background to black
or n if you change your mind. Click OK to accept the change or
Cancel to abort it.If you chose this option and do not cancel at the
dialog, the entire background turns black (it is normally white).
Online Help
NCSA ImageTool offers online help through the Help menu
(Figure 1.8). Simply select any one of the following options:
Basics, Menus, Button usages, Examples, and Bug report.
Figure 1.8 Help Menu
Basics
Basics describes the basic operation of ImageTool, including
software startup, inputs to ImageTool, error messages, and basic
operations.
Menus
Menus describes in more detail the use and functions provided by
the menus.
Button usages
Button usages contains a compilation of mouse button usage in
ImageTool.
Examples
Examples gives some examples of how you can use NCSA
ImageTool.
Bug report
Bug report describes the error and warning messages you may
encounter.
Once you've selected an option, a new window generally appears,
containing scroll bars that support paging, single line scrolling,
and location selection. To search for a specific subject:
1. Enter the desired heading in the search pattern text field.
2. Initiate the search by pressing RETURN.
The Top button takes you back to the beginning of the Help window.
The Done button closes the window.