home *** CD-ROM | disk | FTP | other *** search
- 3.1 NCSA ImageTool
-
-
- Animation, Palettes, and Plots 3.1
-
- National Center for Supercomputing Applications
-
- January 1991
-
-
-
-
-
-
- 3.1 NCSA ImageTool
-
-
- Animation, Palettes, and Plots 3.1
-
-
-
-
- Chapter 3 Animation, Palettes, and Plots
-
-
-
- Chapter Overview
- Animation
- Starting Animation
- Animation Controls
- Virtual Memory Animation
- FTP Options
- Connect
- Get Loop
- Disconnect
- Color Palette Support
- Color Palettes
- Loading Palettes
- Modifying Palettes
- Saving Modified Palettes
- Restoring the Palette
- Displaying the Palette
- Plots
- XY Graphs
- Mouse Usage for Making Selections
- Contour Plots
- 3D Plots
-
- Chapter Overview
-
- This chapter covers more advanced display options in NCSA
- ImageTool, including animation, palette modification, and plots.
-
-
- Animation
-
- Animation is an integral part of NCSA ImageTool. The program
- uses the information in the text fields of the Control window for
- loading animation images, just as it does for individual images.
- In most cases, the file specification matches more than one file.
-
- NCSA ImageTool displays the animation sequence at the origin
- point of the canvas. If the file specification does not match any
- files, the file sizes conflict with the dimensions, or some type of file
- error occurs during animation, an error message is displayed in
- the Message window.
-
-
- Starting Animation
- Located under the Image menu is the Animate submenu
- (Figure 3.1). The submenu contains the default option, Regular
- size, and a Zoom (2X) option which initially magnifies individual
- frames by a factor of two in each direction.
-
- Figure 3.1 Animate Submenu
-
-
-
- NOTE: Besides selecting animation size from the Animate
- submenu, you can also initiate a regular size animation from the
- Image text field by pressing CONTROL-A at the end of the file
- specification.
-
-
- Animation Controls
- When you select an animation type, five new buttons appear in the
- Control window. They are labeled Pause, Last, Next, +, and -. Use
- the left button to activate these control buttons.
-
-
- Pause Button
- The Pause toggle temporarily stops the animation. You will want
- to pause the animation when you want to perform some other
- operation on the images; i.e., magnifying the image, loading an
- alternative palette, etc.
-
-
- Last and Next Buttons
- While also in pause mode, you can use the Last and Next buttons to
- sequence through images.
-
- + and - Buttons
- The + and - buttons control the animation speed, speeding it up or
- slowing it down, respectively.
-
-
- Cancel
- Cancel quits the animation mode.
-
-
- Virtual Memory Animation
- If all of the images for an animation do not fit in the available
- physical memory, the images are swapped out to disk until they are
- needed. This transfer creates a great deal of network traffic if
- your disk is mounted on the network, and a great deal of disk I/O
- activity in any case, often causing mouse tracking to slow down. If
- this happens, you can click the Pause button, then perform any
- necessary action such as slowing down the animation or
- canceling the operation.
-
-
- FTP Options
-
- Further expanding the animation options of NCSA ImageTool is
- its built-in network communications capabilities. By using the
- FTP (File Transfer Protocol) menu (Figure 3.2), you can connect
- to a remote machine and grab images as they are being created.
-
- Figure 3.2 FTP Menu
-
-
-
- Connect
- Before you can transfer images from a remote machine, you must
- establish a connection to the machine generating or containing the
- images. To do so:
-
- 1. Select Connect from the FTP menu. A dialog box prompts you for
- the name of the host machine.
-
- 2. Enter the name of the host in the text field labeled Host name.
-
- 3. Click the OK button to continue.
-
- Text in the tty window describes the file transfer. The messages
- displayed vary from system to system. This is an example of what
- you might see in the tty window:
-
- ftp cray
- Connected to cray
- 220-cray FTP Server. Report Problems to ajc@uxc.cso.uiuc.edu
- Name (cray:redman):
-
-
- 4. Enter the appropriate user name for the remote machine at the
- Name prompt.
-
- 5. Enter the password, if necessary, and possibly an account or
- other necessary codes.
-
- After entering all of the required information, you should see a
- message that looks like this:
-
- 230 Logged in.
-
-
- If a message like this does not appear, it may be necessary to re-
- enter the user name and password. If this message does appear, the
- connection is successful, and you may continue to perform one of
- the other operations from this menu. FTP runs in the tty window.
- Use the FTP commands available on your machine to change
- directories on the remote machine, change options, and so on.
-
-
- Get Loop
- Once the connection is established, you can use the Get loop option.
- Get loop transfers the file whenever it becomes available. The
- images are displayed in the form of an animation sequence on the
- canvas as they are acquired.
-
- Select Get loop from the FTP menu and a dialog box appears. The
- images' filenames are expected to end with a string of digits such
- as denap009. This naming scheme is useful for sequencing
- animation images.
-
- Specify an increment in the dialog box. This increment is added to
- the image filename to create the filename for the subsequent frame
- in the sequence. The next field, labeled Interval (sec), specifies the
- maximum allowable time to complete the file transfer. FTP times
- out if the transfer is not complete in this period of time. If images
- are large, you may need to increase this value in order to avoid
- timing out in the process of transferring the files. Zoomed image
- has two settings: on and off. If it is on, the images are magnified
- by a factor of two before being displayed.
-
- The filename in the Image text field of the control panel specifies
- the first file to be transferred. The next file to be obtained is
- determined automatically by NCSA ImageTool. The numeric
- suffix on the original filename is incremental by the amount that
- you specified in the Increment field of the dialog box. The name in
- the Image field changes to the name of the file presently displayed.
-
- This process continues until you select Stop from the FTP menu.
-
-
- Disconnect
- Select Disconnect from the FTP menu to close the connection with
- the host machine. Select Stop to cancel the Get loop option before you
- disconnect.
-
-
- Stop
- This option cancels the Get loop operation. In the tty window, a
- message is displayed such as:
-
- Get loop stopped
-
-
- If you do not cancel the Get loop option before disconnecting, NCSA
- ImageTool continues to try to receive images, unsuccessfully.
-
-
- Color Palette Support
-
- NCSA ImageTool supports using, modifying, and creating color
- palettes. You can load, change, and save color palettes. For
- detailed information on the file format of color palette files, see the
- section, "File Formats," in Chapter 2.
-
-
- Color Palettes
-
- The Sun Workstation can display 256 colors from a palette of over
- 16 million colors. You can change most of the 256 colors to any one
- of the other available colors. Some entries are reserved by the
- system and cannot be used by NCSA ImageTool. The first four
- entries in the color palette are used for foreground and background
- colors, window colors, and text.
-
-
- Loading Palettes
- You can use palette files to initialize your Sun Workstation's
- hardware color table. The section, "File Formats," in Chapter 2
- describes the file format. To load a new color palette, select Load
- from the Palette menu (Figure 3.3).
-
- Figure 3.3 Palette Menu
-
-
-
- NCSA ImageTool tries to read colors from the file entered in the
- Control window's Palette text field. If the filename does not end in
- .pal, the program automatically appends .pal to the filename. If
- NCSA ImageTool can't find this file cannot be found, an error
- message appears in the Message window. Otherwise, the color
- hardware is initialized using the colors from the palette file.
-
- Alternately, to directly load the palette from the Palette text field,
- press CTRL-L at the end of the palette filename.
-
-
- Modifying Palettes
- You can alter the currently active palette using NCSA ImageTool's
- palette editing capabilities: Contour, Fiddle, and Transpose.
- Selecting either Contour or Fiddle switches to a mode Contour and
- to have a special effect. To exit either of these modes, click the right
- mouse button.
-
-
- Contour Mode
- Using the contour mode, you can set entries in the palette to white.
- To use contour mode:
-
- 1. Select Contour from the Palette menu.
-
- 2. Select a contouring functions by clicking the left or middle
- mouse button in the Canvas area.
-
- 3. Depress the left mouse button to set the color under the mouse on
- the Canvas to white. Alternatively, move the mouse off of that
- point to restore its color.
-
- 4. Release the mouse button to permanently set the color under the
- mouse to white.
-
- To use the color initially under the cursor, instead of white:
-
- 1. Hold down CTRL when you press the left mouse button. While
- the middle mouse button is pressed, NCSA ImageTool clears
- randomly selected colors and leaves others in place. This
- creates a contouring effect.
-
-
- Fiddle Mode
- The fiddle mode reduces or expands the range of the spectrum in
- the color palette, depending on the mouse location on the Canvas.
- To manipulate the palette:
-
- 1. Depress the left button.
-
- 2. Move the mouse toward the top of the Canvas to expand the
- spectrum.
-
- 3. Move the mouse toward the bottom of the image to reduce the
- range of the spectrum.
-
- 4. Move the fiddle horizontally to shift the spectrum to the right or
- left.
-
- 5. Select Transpose from the Palette menu to flip the color palette.
- After flipping the palette, the mouse buttons operate normally.
-
- Notice also that while you hold down the middle mouse button you
- can rotate the palette in a wrap-around fashion.
-
-
- Saving Modified Palettes
- After altering a palette, you may want to save it for future use by
- selecting Save from the Palette menu. A dialog box appears. Use
- the text field labeled Palette to enter the name for the new palette
- file. Click OK to continue the operation or Cancel to abort.
-
-
- Restoring the Palette
- Use the Restore option in the Palette menu to restore the palette to its
- original state. Any modifications that you have made since you
- last saved will be lost.
-
-
- Displaying the Palette
- It may help you to display the palette when in this mode so that you
- can see the effect of your actions. Use the Show option from the
- Palette menu to display a color strip at the origin point on the
- Canvas. Once the colors are displayed, you can remove them by
- selecting Cut or Clear from the Edit menu.
-
-
- Plots
-
- In addition to using color to display data, NCSA ImageTool also
- provides other plotting capabilities, such as XY graphs, contour,
- and 3D plots.
-
-
- XY Graphs
- To create a Cartesian graph:
-
- 1. Choose the XY option from the Graph menu (Figure 3.4).
-
- Figure 3.4 Graph Menu
-
-
-
- A new frame and window appear, as well as a dialog box.
-
- 2. Fill in the text field first, then enter the minimum and
- maximum horizontal and vertical dimensions into the fields
- labeled Xmin, Xmax, Ymin and Ymax.
-
- 3. Enter the minimum and maximum data values for the plot in
- the Gmin and Gmax fields.
-
- 4. Click OK to continue or Cancel to abort the operation. If you
- select OK, the new window remains on the screen. Otherwise, it
- disappears.
-
- If you've selected OK, proceed with the following steps to select a
- slice of the image (on the Canvas) that you would like to have
- plotted.
-
- 5. Depress the left mouse button while dragging the mouse over a
- line of data values you want plotted.
-
- 6. Release the mouse button. A line appears over the area you have
- just drawn across (if one doesn't, try clicking the middle mouse
- button). If the line is not acceptable, redraw the line by repeating
- this process. The previously selected line disappears when you
- start to draw a new one. The data values represented by the
- colors under the line are used for the plot.
-
- 7. Click the Draw button to plot the points under this line.
-
- Notice the other control buttons in the window. Scale specifies the
- values previously entered at the dialog box. Note that the data
- range does not have to be in the range 0 to 255, even though the
- actual data values displayed fall in this range.
-
- Clear clears the plot window, Print prints the plot on the postscript
- printer specified using the Options menu, and Done removes the
- window and returns to normal processing. The text field contains
- the text that creates the title of the plot.
-
- To produce multiline graphs, draw horizontal or vertical lines
- parallel to one another in the image and select Draw after you
- select each line.
-
- NOTE: If NCSA ImageTool does determine that the lines you've
- drawn are parallel, the XY plot canvas does not clear to draw the
- additional lines; it is drawn over the existing plot.
-
-
- Mouse Usage for Making
- Selections
- When making contour or 3D plots, you'll often be making
- selections within your images using mouse buttons. The middle
- mouse button drags a selection box; clicking outside of this
- selection cancels the selection.
-
- If instead of clicking outside the box you press the middle mouse
- button inside the box, the cut and paste functions are performed on
- the selection, and you can drag the selected area to a new location
- on the canvas.
-
- Alternately, holding down CTRL and pressing the middle button
- with the mouse inside the selection box performs the copy and paste
- operations simultaneously.
-
- Clicking the right mouse button on the canvas undoes the original
- selection.
-
-
- Contour Plots
- To create a contour plot:
-
- 1. Select a rectangle from an image to be plotted using the middle
- mouse button. (You can also use the middle button to extend your
- selection area.)
-
- 2. Select Contour from the Graph menu. A window appears that
- displays some buttons and a text field.
-
- 3. Enter the values at which you would like contour lines to be
- drawn in the Contour levels text field. You can enter as many or
- as few values as you like; the more values you enter, the more
- contour lines you'll see.
-
- 4. Click the Draw button. NCSA ImageTool draws the contour plot
- in the Canvas area of the plotting window.
-
- To clear this Canvas, click the Clear button. (The image remains
- on disk if you have saved it there.)
-
- You can also Print the contour plot to the postscript printer you've
- designated using the Set laser printer default item in the
- Options menu. If you haven't specified a default laser printer, a
- dialog box appears.
- Clicking on Done removes the window and returns to normal
- processing.
-
-
- 3D Plots
- To create a 3D plot:
-
- 1. Select a rectangle that you would like to plot using the middle
- mouse button. (You can also use the middle button to extend your
- selection area.)
-
- 2. Select the 3D plot option from the Graph menu. A plot window
- appears.
-
- 3. Enter the yaw, pitch, and roll values in their respective text
- fields. These three elements compose the viewing angle for a 3D
- image. Specifically, yaw is the rotation around the x axis, pitch
- is the rotation around the x axis, and roll is the rotation about the
- z axis. The defaults are 10, 40 and 5, respectively.
-
- 4. Click Draw to plot the selected rectangle. Click Draw again to
- change the yaw, pitch, and roll and replot the data.
-
- Pressing the Clear button clears the plot window's Canvas, while
- the Print button prints the plot to a postscript printer. Clicking Done
- returns NCSA ImageTool to normal operation.
-
-