home *** CD-ROM | disk | FTP | other *** search
/ Photo CD Demo 1 / Demo.bin / imagetoo / imagtlch.asc < prev    next >
Text File  |  1992-07-17  |  22KB  |  640 lines

  1.  
  2.  
  3. Learning to Use NCSA ImageTool    1.1
  4.  
  5. January 1991
  6.  
  7.                                                                 
  8.  
  9.  
  10.  
  11.  
  12. 1.1    NCSA ImageTool
  13.  
  14.  
  15. Learning to Use NCSA ImageTool    1.1
  16.  
  17.  
  18. National Center for Supercomputing Applications
  19.  
  20. January 1991
  21.  
  22. June 1990
  23.  
  24.  
  25.  
  26.  
  27. Chapter 1    Learning to Use NCSA ImageTool
  28.  
  29.  
  30.  
  31. Chapter Overview
  32. SunView Basics
  33. Starting SunView
  34. Using SunView Menus
  35. Text Editing in SunView
  36. Getting Started with NCSA ImageTool
  37. TTY Window
  38. Control Window
  39. Message Window
  40. Scroll Bars
  41. Menu Window
  42. Canvas
  43. Loading Images
  44. Specifying Load Information
  45. Setting Load Origin Points
  46. Loading an Image
  47. Manipulating Images
  48. Selecting Areas of the Canvas
  49. Cut, Copy, Paste and Clear Options
  50. Changing Magnification
  51. Stacking Images
  52. Saving Images
  53. Options
  54. Online Help
  55.  
  56. Chapter Overview
  57.  
  58. This chapter outlines how to use NCSA ImageTool on your Sun 
  59. Workstation through the SunView windowing system. Refer to the 
  60. Glossary for definitions of unfamiliar terminology. To use this 
  61. tutorial, you need to have a raster file. A raster file consists of a 
  62. stream of bytes representing the data matrix. The raster file 
  63. format is described in more detail in Chapter 2, "Formatting Your 
  64. Data Files."
  65.  
  66. You may continue your tutorial using Chapter 3, "Animation, 
  67. Palettes, and Plots," which covers more advanced display options 
  68. available in NCSA ImageTool.
  69.  
  70.  
  71. SunView Basics
  72.  
  73. SunView is Sun's icon-based windowing system. It provides you 
  74. with a user interface that uses the mouse, keyboard, and graphics 
  75. capabilities of the Sun Workstation to create a user friendly, 
  76. menu-driven environment. NCSA ImageTool is designed to 
  77. operate under SunView. SunView handles all the windows, input 
  78. and screen drawings. NCSA ImageTool only handles those events 
  79. that SunView cannot. Following is a description of the basic usage 
  80. of the SunView windowing software. For more detailed 
  81. information on how to use SunView, refer to the Sun Microsystems 
  82. manual, Windows and Window Based Tools: Beginner's Guide.
  83.  
  84.  
  85. Starting SunView
  86. To start SunView, first log in on the Sun Workstation. After the 
  87. system prompt appears, enter:
  88.  
  89.     suntools
  90.  
  91. and press RETURN. The screen clears and then fills with a gray 
  92. background. Icons and windows appear on the screen. The icons 
  93. represent tools that are loaded and ready for use, but are presently 
  94. idle. Clicking the left mouse button on the application icon 
  95. activates that application, usually causing a new window to 
  96. appear.
  97.  
  98. You can also close applications that are already opened when you 
  99. start SunView. Once closed, you'll see the icon for that application 
  100. appear somewhere on the screen. 
  101.  
  102. You can change the beginning configuration of the screen to suit 
  103. your preferences. For more information on reconfiguring the 
  104. default layout of the screen, refer to the Sun Microsystems manual.
  105.  
  106.  
  107. Using SunView Menus
  108. To view the SunView pop-up menu and its application options, 
  109. press the right mouse button while the pointer is anywhere in the 
  110. gray background on the screen. This menu is configurable, and 
  111. you can customize its contents to your tastes. (Refer to the Sun 
  112. Microsystems manual for more information.) To exit SunView, 
  113. select the Exit Suntools entry from the menu, then click the left 
  114. mouse button.
  115.  
  116. A standard menu is also available for window manipulation. 
  117. Press the right mouse button anywhere near the edge of any 
  118. application window to expose the menu. The items of this menu are 
  119. Move, Resize, Hide, Expose, and Redisplay windows. The Close 
  120. option closes the window and adds an icon of the application to the 
  121. screen. Quit exits the application associated with the window and 
  122. deletes it from memory.
  123.  
  124.  
  125. Text Editing in SunView
  126. Some windows contain editable fields you use to enter text. To edit 
  127. one of these fields:
  128.  
  129. 1.    Move the mouse into the window or window containing the text 
  130. field. A blinking, triangular cursor appears, indicating the text 
  131. insertion point. 
  132.  
  133. 2.    Try typing a character on the keyboard to insert the character at 
  134. the cursor, which then moves one space to the right. 
  135.  
  136. You can move the cursor to various text fields with either the TAB 
  137. key or the mouse. Pressing TAB selects the next text field, 
  138. allowing you to sequence through the fields. To select a text field 
  139. using the mouse, position the mouse on the text field and click the 
  140. left mouse button. The selected text field becomes highlighted, 
  141. allowing  you to enter text.
  142.  
  143. Press DELETE to delete the character in front of the cursor. Press 
  144. the L10 function key to delete the entire selection.
  145.  
  146.  
  147. Getting Started with NCSA ImageTool
  148.  
  149. Once SunView is running, you can start up NCSA ImageTool. To 
  150. do this, open the console window if it is not already open. At the 
  151. prompt, enter:
  152.  
  153.     imagetool &
  154.  
  155. and press RETURN. 
  156.  
  157. NOTE:  If NCSA ImageTool is not in your current directory, 
  158. preface the application name with the pathname. 
  159.  
  160. The main NCSA ImageTool frame (Figure 1.1) appears on your 
  161. screen. The NCSA ImageTool frame contains five windows. 
  162. These windows are the tty, the Control, the Message, the Menu and 
  163. the Canvas windows.
  164.  
  165. Figure 1.1    Main NCSA 
  166. ImageTool Frame
  167.  
  168.                                                              
  169.  
  170.  
  171.  
  172. TTY Window
  173. The tty window runs a shell you can use to communicate with the 
  174. operating system, just as you would from the console window. You 
  175. cannot resize this window nor scroll its contents.
  176.  
  177.  
  178. Control Window
  179. The Control window contains some text fields and some standard 
  180. control buttons. The control buttons are labeled Clear, Cancel, and 
  181. Quit. 
  182.  
  183.  
  184. Clear
  185. Clear clears the previously loaded or selected region or image. 
  186. Click Clear twice to clear the entire canvas.
  187.  
  188. Cancel
  189. Cancel clears the canvas unless stacking or animation modes are 
  190. active. If you've activated one of these modes, press Cancel to 
  191. return NCSA ImageTool to normal operation. 
  192.  
  193.  
  194. Quit
  195. Quit stops execution and purges all memory used by NCSA 
  196. ImageTool.
  197.  
  198. There are also several text fields in the Control window which you 
  199. use to specify a default directory, an image file specification with 
  200. wildcard characters, the image's x and y dimensions, and a 
  201. palette file.
  202.  
  203. NOTE:  Each of these text fields has a menu associated with it. For 
  204. a more detailed discussion of these menus, refer to the section, 
  205. "Text Fields and Other Control Window Menus," in Chapter 4. 
  206.  
  207. Briefly, the menus help you to change the current directory, load an 
  208. image, specify the type of file you're loading, start an animation 
  209. sequence, load a palette, select the type of SDS scaling for a 
  210. scientific dataset, and perform other operations.
  211.  
  212.  
  213. Message Window
  214. The Message window contains error messages, warnings, and 
  215. descriptive information about NCSA ImageTool. The messages 
  216. are numbered from 1 to 20, beginning over at 1 after each cycle of 
  217. 20. You may scroll through this window's contents, using the 
  218. actions outlined in the next section, "Scroll Bars."
  219.  
  220.  
  221. Scroll Bars
  222. You can use scroll bars in a variety of ways wherever they are 
  223. present in this program. The results you get depend on the mouse 
  224. position and the mouse buttons you press. Scroll arrows are the 
  225. small rectangular shaped objects at either end of a scroll bar. The 
  226. scroll bar content is the gray area between the two sets of scroll 
  227. arrows. The locator is the darker gray area that indicates the 
  228. present location in the text or canvas. Here are the ways you can 
  229. use the scroll bars:
  230.  
  231. Ñ    To move quickly through the file, select a location for the locator 
  232. by moving the mouse to the location in the gray area and 
  233. clicking the middle button. The locator moves to that location 
  234. and jumps the text to that relative location.
  235.  
  236. Ñ    To scroll through window contents an entire page at a time, 
  237. click the middle mouse button on either set of the scroll arrows. 
  238. You can also move one page at a time by clicking the left mouse 
  239. button in the gray area below the locator. Clicking the right 
  240. mouse button in this area scrolls up the text one entire page.
  241.  
  242. Ñ    To scroll through text several lines at a time, place the mouse in 
  243. the gray area above the locator. Click on the left button to scroll 
  244. the text up; click on the right button to scroll the text down.
  245.  
  246. Ñ    To scroll a single line at a time, place the mouse in the scroll 
  247. arrow areas and click the right button to scroll up and the left 
  248. button to scroll down.
  249.  
  250.  
  251. Menu Window
  252. The Menu window (Figure 1.2) contains a row of buttons with 
  253. associated menus that you can use to perform the majority of the 
  254. functions. The controls are labeled Image, Edit, Palette, Zoom, 
  255. Graph, FTP, Help, and Options. These menus handle image 
  256. loading, editing of the Canvas, palette manipulations, 
  257. magnification, plotting and graphing, FTP operation, online help, 
  258. and default settings, respectively. 
  259.  
  260. Figure 1.2    Button Panel
  261.                                             
  262.  
  263.  
  264. Click the left mouse button on one of these controls to cause the 
  265. default action. Press the right mouse button on a control to display 
  266. its entire menu.
  267.  
  268.  
  269. Canvas
  270. The Canvas is the area in which image display and drawing 
  271. occurs. The Canvas is 1150 pixels wide and 900 pixels high. You 
  272. can neither load an image with dimensions larger than this, nor 
  273. magnify an image beyond these dimensions. Clicking the mouse 
  274. buttons in the Canvas area can cause any number of actions to be 
  275. performed, depending on the operational mode you are in. For 
  276. more information on mouse button usage, see Appendix A, "NCSA 
  277. ImageTool Mouse Button Usage."
  278.  
  279.  
  280. Loading Images
  281.  
  282. Before loading an image into NCSA ImageTool, you need to 
  283. specify the name of the file to be loaded, its directory, its file type, 
  284. its palette name (if one exists) and, if its not an HDF file, its 
  285. dimensions.
  286.  
  287.  
  288. Specifying Load 
  289. Information
  290. In the Control window's text fields, enter the following 
  291. information for the file you are loading:
  292.  
  293. Ñ    The default directory name
  294.  
  295.     NOTE:  Entering the directory name in this field does not 
  296. actually change the current directory. To do so, press CTRL-C 
  297. at the end of the directory name in the text field, or select Change 
  298. directory from the menu (Figure 1.3) for this field.
  299.  
  300. Figure 1.3    Directory Text Field 
  301. Menu
  302.                    
  303.  
  304.  
  305. Ñ    The image filename
  306.     The Image field enters the raster file specification. You can use 
  307. wildcard characters (* and ?). The fields labeled Xdim and 
  308. Ydim contain the width and height of the image. If these values 
  309. are not correct, the program will not display the image properly. 
  310. The menus for the Xdim and Ydim field only position the cursor 
  311. at the end of the field for data entry.
  312.  
  313. Ñ    The type of file you're loading
  314.     Indicate the file type by clicking in the circle labeled, 
  315. Loading?, and then, using the right mouse button, selecting the 
  316. appropriate file type from the menu that appears.
  317.  
  318. Ñ    The dimensions of the file
  319.     HDF files have the capacity to contain dimensions of its 
  320. images, thus you shouldn't have to enter text in the Xdim and 
  321. Ydim fields if you're using HDF files.
  322.  
  323. Ñ    The palette filename
  324.     If no palette exists for your file, NCSA ImageTool applies a 
  325. default palette, which you've specified, to your image. 
  326.  
  327. Ñ    The SDS Scaling
  328.     If you are loading a scientific dataset, click in the circle labeled 
  329. SDS Scaling. Choose the desired type of scaling from the menu 
  330. that appears, using the right mouse button.
  331.  
  332.  
  333. Setting Load Origin Points
  334. Before loading the raster file, specify the Canvas location for the 
  335. image. To do this, move the mouse onto the Canvas. Click the left 
  336. mouse button to select an origin point at which the next drawing 
  337. operation will start. NCSA ImageTool aligns the upper left-hand 
  338. corner of the image to this origin point.
  339.  
  340.  
  341. Loading an Image
  342. You can load an image in several ways as outlined below. 
  343.  
  344. 1.    Select Load image from file from the menu associated with the 
  345. Image text field (located in the Control window.) 
  346.  
  347. 2.    Press CTRL-L, at the end of the Image text field. 
  348.  
  349. 3.    Select the Load option of the Image menu (located in the Menu 
  350. window╤Figure 1.4).
  351.  
  352. Figure 1.4    Image Menu
  353.            
  354.  
  355.  
  356. 4.    Click the Image button using the left mouse button. 
  357.  
  358. 5.    Click the left mouse button twice on the Canvas. This action 
  359. simultaneously sets the origin point and loads an image. 
  360. However, if you click the right mouse button, the program 
  361. forgets the origin. The next time you click the left mouse button, 
  362. NCSA ImageTool sets the origin point to the new location, but 
  363. does not load the image.
  364.  
  365. You can also load an image from a file of 32-bit floating-point 
  366. numbers. Select Floating point from the Load submenu. The file is 
  367. interpreted as a stream of binary floating point numbers. A dialog 
  368. box appears that allows you to enter the minimum and maximum 
  369. data to be used for the scale. A toggle button allows you to select 
  370. linear or logarithmic scaling. The only way to load a floating 
  371. point file is to select this menu item.
  372.  
  373.  
  374. Manipulating Images
  375.  
  376. Now that NCSA ImageTool has displayed your image, you can 
  377. perform a variety of manipulations on it, such as cutting portions 
  378. of the image, copying entire images or pieces of an image, or 
  379. magnifying and reducing the image in a variety of ways.
  380.  
  381.  
  382. Selecting Areas of the 
  383. Canvas
  384. Manipulations can operate on entire images, portion of images, or 
  385. portions of the Canvas. To select an area:
  386.  
  387. 1.    Depressing the middle mouse button and drag out a rectangle 
  388. around the desired area. A white border appears around the 
  389. selected area. 
  390.  
  391. 2.    Release the mouse button.
  392.  
  393. 3.    Select the operation to perform on the selection. 
  394. You can cut, copy, and clear on the selection area. 3D and contour 
  395. plots use the selection mechanism to accumulate data points to be 
  396. plotted. (Refer to Chapter 3, the sections, "Contour Plots," and "3D 
  397. Plots.") Selecting the Save option stores the selection to a file.
  398.  
  399.  
  400. Cut, Copy, Paste and Clear 
  401. Options
  402. Standard editing options╤Cut, Copy, Paste, and Clear╤are all 
  403. available under the Edit menu (Figure 1.5). 
  404.  
  405. Figure 1.5    Edit Menu
  406.           
  407.  
  408.  
  409. They operate on the selected area or the area of the most recent 
  410. drawing. These functions work as follows:
  411.  
  412.  
  413. Cut
  414. Cut removes the selection from the Canvas and adds it to the paste 
  415. buffer.
  416.  
  417.  
  418. Copy
  419. Copy copies the selection to the paste buffer.
  420.  
  421.  
  422. Paste
  423. Paste redraws the contents of the paste buffer at whatever location 
  424. you choose on the Canvas. After selecting Paste from the Edit 
  425. menu, move the mouse into the Canvas area and press the middle 
  426. mouse button. A border outlining the contents of the paste buffer 
  427. appears on the Canvas. While holding down the mouse button, 
  428. drag the border to the desired location the Canvas and release the 
  429. button. The image appears at that location.
  430.  
  431.  
  432. Clear
  433. Clear removes the selected region from the Canvas, but does not 
  434. store it in the paste buffer. The cleared region is permanently 
  435. deleted.
  436. Changing Magnification
  437. You can enlarge images by using the Zoom menu options 
  438. (Figure 1.6). NCSA ImageTool performs these operations on the 
  439. selection or the most recently drawn area. You can continue to 
  440. enlarge the image by repeatedly selecting these options.
  441.  
  442. Figure 1.6    Zoom Menu
  443.             
  444.  
  445.  
  446. Pixel
  447. Pixel expands the image by duplicating pixels. Each time you 
  448. select this item, the image expands by a factor of two.
  449.  
  450.  
  451. Expand
  452. Expand  specifies the magnification factors for the X and Y 
  453. dimension independently. When you select this option, a dialog 
  454. box appears. In it, specify the X and Y expansion factors, and click 
  455. OK. If you click Cancel, the operation aborts. Once again, the 
  456. expansion is a pixel expansion.
  457.  
  458. Interp
  459. Interp creates an interpolated expansion of the selected region. 
  460. Interpolation is similar to magnification or minification except 
  461. that it generates a smoothed image. The effects of interpolation are 
  462. not reversible, because the pixels are not merely duplicated; rather, 
  463. a mathematical function (bilinear interpolation)  is applied to 
  464. estimate the value of the additional or remaining pixels by taking 
  465. a weighted average of the known values of their neighboring 
  466. pixels. For the same reason, interpolation produces a smoother 
  467. image than simple magnification or minification. NCSA 
  468. ImageTool interpolates the image by a factor of two each time you 
  469. select the option.
  470.  
  471.  
  472. Undo
  473. Undo allows you to cancel the most recent magnification 
  474. operation.
  475.  
  476. NOTE:  Do not expand an image beyond the dimensions of the 
  477. Canvas (1150 x 900 pixels).
  478.  
  479.  
  480. Stacking Images
  481.  
  482. NCSA ImageTool saves images or selections and their palettes 
  483. using a stack mechanism. The stack holds up to ten images and 
  484. their palettes. When you enter stack mode by selecting Stack from 
  485. the Image menu, new buttons, Store, Delete, and Show, appear in 
  486. the Control window. These buttons store, delete and show the 
  487. images residing in the stack. The flush button clear the entire 
  488. stack. Menus are available for each of the buttons.
  489.  
  490. To enter stack mode, select Stack from the Image menu. The stack 
  491. buttons appear. To exit stack mode, click on the Cancel button in 
  492. the Control window. 
  493.  
  494. These buttons all work on individual stack elements, not the entire 
  495. stack. Notice that a number is displayed to the right of each button. 
  496. This number, ranging from 1 to 10, is an index into the stack 
  497. denoting the entry that is affected the next time you press the button. 
  498. For example, if the number beside Delete is 3, then clicking on the 
  499. button deletes entry three in the stack.
  500.  
  501. NOTE:  While in stack mode, clicking the right mouse button 
  502. displays the menus for the stack buttons; the left button activates the 
  503. control buttons.
  504.  
  505.  
  506. Store
  507. The Store button stores/adds items to the stack.
  508.  
  509.  
  510. Show
  511. The Show button displays the indexed stack entry at the origin 
  512. point. 
  513.  
  514.  
  515. Delete
  516. The Delete button deletes the indexed entry from the stack. 
  517.  
  518.  
  519. Flush
  520. Flush purges the contents of the entire stack and resets the indexes 
  521. to 1.
  522.  
  523. The stack control buttons have identical menus that are displayed 
  524. if you click the right mouse button.
  525.  
  526.  
  527. Saving Images
  528.  
  529. You can save images or selections to disk. To save the current 
  530. selection or image:
  531.  
  532. 1.    Select Save from the Image menu.
  533.  
  534. 2.    Enter the filename for the image in the dialog box.
  535.  
  536. 3.    Click the OK button to continue with the operation or click 
  537. Cancel to abort the operation.
  538.  
  539. If the image is not part of an HDF file, NCSA ImageTool appends 
  540. the dimensions of the selected image to the filename, which the 
  541. program displays in the tty window. If you do not remember or 
  542. record these dimensions, you may have difficulty loading the 
  543. image properly.
  544.  
  545.  
  546. Options
  547.  
  548. You can customize the NCSA ImageTool program to your 
  549. specifications by using the Option menu.When you make any 
  550. selection from this menu (Figure 1.7), a dialog box appears. 
  551.  
  552. Figure 1.7    Option Menu
  553.                      
  554.  
  555.  
  556. Set default paths
  557. Set default paths option alters some of the defaults in the 
  558. .imagetool_defaults file. The first text field is labeled Default 
  559. image directory. The pathname appearing in this field is used as 
  560. the current directory when NCSA ImageTool starts up. This is also 
  561. the case with the Default palette field. The Default help file 
  562. directory field should contain the path name of a directory in 
  563. which NCSA ImageTool can find the help files for the Help menu. 
  564. Click Cancel in this dialog box and no changes are made to the 
  565. file. Click OK and another dialog box is displayed. To confirm the 
  566. save, click OK to save the defaults and make them permanent or 
  567. click Cancel to stop the operation.
  568.  
  569.  
  570. Set laser printer default
  571. The Set laser printer default option sets the name of the default 
  572. printer. This printer must be a postscript printer. A dialog box is 
  573. displayed that contains a text field labeled Printer name. Enter the 
  574. name of the printer in this field and click OK to record the new 
  575. default, or click Cancel to abort.
  576. Set reversed image ON?
  577. The Set reversed image ON? option reverses the orientation of the 
  578. images horizontally when they are loaded. In the dialog box that 
  579. appears, enter y in the text field to set reversed images or enter n to 
  580. cancel the process. Then click OK to accept or Cancel to abort.
  581.  
  582.  
  583. Set dark background ON?
  584. The Set dark background ON? option sets the background to black. 
  585. The background color is the color of the background of the canvas 
  586. and other panels. This setting is useful for taking photographs or 
  587. shooting videotapes of the screen. If you select this item, a dialog 
  588. box is displayed just like the one that appears for Set reversed 
  589. image. Enter y in the text field to change the background to black 
  590. or n if you change your mind. Click OK to accept the change or 
  591. Cancel to abort it.If you chose this option and do not cancel at the 
  592. dialog, the entire background turns black (it is normally white).
  593.  
  594.  
  595. Online Help
  596.  
  597. NCSA ImageTool offers online help through the Help menu 
  598. (Figure 1.8). Simply select any one of the following options:  
  599. Basics, Menus, Button usages, Examples, and Bug report.
  600.  
  601. Figure 1.8    Help Menu
  602.              
  603.  
  604.  
  605. Basics
  606. Basics describes the basic operation of ImageTool, including 
  607. software startup, inputs to ImageTool, error messages, and basic 
  608. operations.
  609.  
  610.  
  611. Menus
  612. Menus describes in more detail the use and functions provided by 
  613. the menus.
  614.  
  615.  
  616. Button usages
  617. Button usages contains a compilation of mouse button usage in 
  618. ImageTool.
  619.  
  620.  
  621. Examples
  622. Examples gives some examples of how you can use NCSA 
  623. ImageTool.
  624. Bug report
  625. Bug report describes the error and warning messages you may 
  626. encounter.
  627.  
  628.  
  629. Once you've selected an option, a new window generally appears, 
  630. containing scroll bars that support paging, single line scrolling, 
  631. and location selection. To search for a specific subject:
  632.  
  633. 1.    Enter the desired heading in the search pattern text field. 
  634.  
  635. 2.    Initiate the search by pressing RETURN.
  636.  
  637. The Top button takes you back to the beginning of the Help window. 
  638. The Done button closes the window.
  639.  
  640.