home *** CD-ROM | disk | FTP | other *** search
/ Encyclopedia of Graphics File Formats Companion / GFF_CD.ISO / software / dos / imdisp / doc / imdisp.doc < prev    next >
Encoding:
Text File  |  1994-05-18  |  109.6 KB  |  2,566 lines

  1.  
  2.                   USER'S GUIDE FOR THE PDS IMDISP PROGRAM
  3.  
  4.  
  5.                                  Chapter 1
  6.  
  7.                                 INTRODUCTION
  8.  
  9.  
  10.      This document describes version 7.9g of the IMDISP program, an
  11. interactive image processing utility for the IBM Personal Computer family
  12. (PC, XT and AT) and compatibles.  It has been developed for use with the
  13. Compact Disk - Read-Only Memory (CD-ROM) storage systems currently being
  14. evaluated by the Planetary Data System (PDS).  It can also be used to
  15. display and process images stored on floppy or hard disks.
  16.  
  17.      This User's Guide presents an overview of image processing and CD-ROM
  18. fundamentals, a section on the installation of IMDISP and CD-ROM software
  19. and hardware, a description of IMDISP program operation, a description of
  20. other utility programs which can be used in conjunction with IMDISP, and a
  21. command summary.
  22.  
  23.      Other support software for using the PDS CD-ROM disks has also been
  24. developed.  These packages include the USGS Planetary Image Cartography
  25. System (PICS) for MicroVAX computers, a set of FORTRAN routines to access
  26. CD-ROM disks on VAX computers (VMSCD), and "C" language source code to
  27. process disks written in the High Sierra format.  Contact Mike Martin
  28. (mmartin@jplpds.jpl.nasa.gov) for access to these tools.
  29.  
  30.  
  31.                                  Chapter 2
  32.  
  33.                                  BACKGROUND
  34.  
  35.  
  36.      Efforts to utilize small computer systems for display and analysis of
  37. scientific data have been hampered by the lack of sufficient data storage
  38. capacity to accommodate large image arrays.  Most planetary images require
  39. nearly a megabyte of storage.  Over the past two years a new storage
  40. technology, "CD-ROM", has been developed which provides the capability to
  41. store up to 600 megabytes of data on a single 4.72-inch disk.  The disks
  42. can be mass produced, and hundreds of copies of large digital archives
  43. distributed rather than the few sets currently produced.  Readers for
  44. CD-ROM disks can now be purchased for under a thousand dollars for use on
  45. personal computers and some science workstations.
  46.  
  47.    The PDS has worked with industry and other government agencies to
  48. support the development of CD-ROM as a major data distribution and storage
  49. media for space science data.  Initial development efforts by the PDS, the
  50. Voyager Project, and multi-disciplinary science representatives have
  51. resulted in the production of 12 CD-ROM disks containing about 30,000
  52. images from the Voyager 1 and 2 encounters.  The IMDISP program can be used
  53. to display most of these data files on a personal computer equipped with a
  54. CD-ROM drive.
  55.  
  56.    Any feedback on the use of IMDISP is greatly appreciated, and any of the
  57. following people can be contacted for reporting bugs, adding enhancements,
  58. etc:
  59.  
  60.       Mike Martin
  61.       Jet Propulsion Lab
  62.       Internet: mmartin@jplpds.jpl.nasa.gov
  63.       SPAN: JPLPDS::MMARTIN
  64.  
  65.       Ron Baalke
  66.       Jet Propulsion Lab
  67.       Internet: baalke@kelvin.jpl.nasa.gov
  68.  
  69.       Archie Warnock
  70.       Goddard Space Flight Center
  71.       SPAN:     NDADSA::WARNOCK
  72.                 NSSDC::WARNOCK
  73.       Internet: warnock@hypatia.gsfc.nasa.gov
  74.                 warnock@nssdc.gsfc.nasa.gov
  75.  
  76.  
  77. 2.1 DIGITAL IMAGE PROCESSING SUMMARY
  78.  
  79.  
  80.    A digital image is a picture converted to numerical form so that it can
  81. be stored and used in a computer.  The image is divided into a matrix of
  82. small regions called picture elements, or pixels.  The rows and columns of
  83. pixels are called "lines" and "samples", respectively.  Each pixel has a
  84. numerical value, or DN (data number) value, quantifying the darkness or
  85. brightness of the image at that spot.  In total, each pixel has an address
  86. (line number, sample number) and a DN value, which is all that the computer
  87. needs for processing.  The DN value of each pixel usually represents a
  88. shade of darkness or brightness between black and white (gray levels).  How
  89. many gray levels there are in an image depends on the number of bits used
  90. to represent each pixel intensity in the computer.  The number of gray
  91. levels will be equal to 2^n, where n is the number of bits per pixel's DN
  92. value.  If 8 bits are used to represent a pixel's DN value (gray level),
  93. the system will be capable of using 2^8, or 256, gray levels in an image,
  94. where DN 0 is pure black, and DN 255 is pure white.  If each DN used only 4
  95. bits of storage, the image would contain only 2^4 or 16 gray levels; if
  96. there were only 1 bit per DN, the image would contain only black and white
  97. pixels (bit values of 0 or 1).
  98.  
  99.  
  100. 2.2 OVERVIEW OF IMDISP CAPABILITIES
  101.  
  102.  
  103.    While the specifics of IMDISP commands are discussed in Chapter 4, this
  104. section provides a general overview of how a user can manipulate images
  105. once a file is selected.  There are DISPLAY commands which allow the user
  106. to display all or part of an image at various positions on the display
  107. screen.  The user may also zoom in and out from a point on the image
  108. defined by the cursor, and may pan around the image.  The cursor may be
  109. turned on or off; when on, the arrow keys are used to move the cursor
  110. around the screen; when off, the cursor is not visible.
  111.  
  112.    A user may choose to "subsample" the image, to enable more or all of the
  113. original image to be displayed on the screen at once.  For example, if the
  114. image were subsampled by a factor of 2, every other pixel from every other
  115. line would be displayed, starting from the upper left corner of the image.
  116. If a factor of 3 were chosen, every third pixel from every third line would
  117. be displayed.  Any positive integer may be used for subsampling.
  118.  
  119.    The user may produce a histogram of an image file, which is a graph
  120. showing the number of pixels per DN value, or per range of DN values, for
  121. the entire image.  Histograms are overlaid on top of the image, but may be
  122. removed using the REFRESH command.  Subsampling may be specified when
  123. computing a histogram to reduce the time required for the calculations.
  124.  
  125.    A profile may be created which plots DN value versus pixel along a line
  126. between two points on the image.  After the cursor is used to select the
  127. two endpoints, the connecting line is drawn on the image and the profile is
  128. plotted at the bottom of the screen.  There is a plot command to plot the
  129. actual data values in an image line.
  130.  
  131.    The user may also "stretch" the image, which is analogous to turning the
  132. contrast knob on a TV set.  The user specifies low and high DN values; all
  133. pixels with values lower than the specified "low" become black, and all
  134. pixels higher than the specified "high" value become white.  All pixels
  135. between the low and high values are evenly shaded between black and white.
  136. IMDISP also has several filter functions available.  The user may process
  137. the image with a convolution filter, mean or median filters.  There is also
  138. an edge detection filter, as well as functions to brighten, darken and
  139. smear the displayed image.
  140.  
  141.    There are bookkeeping types of commands, also.  These allow the user to
  142. do such things as retrieve a desired image from the CD-ROM, to save an
  143. image to a file on hard disk, and to erase only the graphics from the
  144. screen or to erase the entire screen.  Users may execute batch command
  145. files to do a series of tasks automatically.  Lastly, the user may, of
  146. course, EXIT the IMDISP program when done.
  147.  
  148.  
  149. 2.3 GRAY LEVEL AND FALSE COLOR IMAGES
  150.  
  151.  
  152.    Most planetary images are composed of 8-bit DN values representing
  153. monochrome brightness levels in the scene.  To obtain color images,
  154. separate images are taken through color filters (red, green, blue) and are
  155. then combined by ground processing systems to produce a true color image.
  156. Only a very small fraction of planetary images are available in color
  157. versions.  Most display and analysis is done on monochrome images.
  158.  
  159.    A display with 256 (2^8) gray levels is required to present the
  160. information contained in a standard image.  However, the human eye can only
  161. distinguish about 32 gray levels.  Thus 5-bit DN values would satisfy most
  162. display requirements.  Unfortunately, computers are oriented to the storage
  163. of and manipulation of items which are a power of two, and 5-bit pixels
  164. would be very clumsy.  The standard display devices which the IMDISP
  165. program supports are limited to 16 gray levels (PGA and VGA), 4 gray levels
  166. (EGA) or 2 gray levels (CGA), but the program also supports several
  167. "enhanced" VGA display devices offering up to 256 colors (or 64 shades of
  168. gray).  The 16 gray levels of the PGA are adequate to support image
  169. analysis; however 4 or 2 gray levels are practically useless for viewing
  170. planetary images.  Fortunately the EGA display will support 16 different
  171. colors, and a color palette can be selected which uses a graduated scale of
  172. colors to represent gray levels, producing a "false color" image (false
  173. because the displayed color does not represent the actual color of the
  174. scene).
  175.  
  176.    A false color image (also called a pseudo color image) is created from a
  177. black and white image by assigning a color (rather than a gray level) to
  178. each DN value in the image.  For instance, a DN value of 128 could be
  179. reassigned to yellow if the user so desired.  Ranges of DNs (e.g., 100-125)
  180. may also be assigned one color.  Pseudo colors get assigned to DN values in
  181. a pseudo color table, which the display program then uses to determine how
  182. to color the image on the monitor.  Display programs often have preset
  183. pseudo color tables with commonly used DN-color combinations, and the user
  184. can simply call for one of these when generating a pseudo color image.  The
  185. option exists, of course, for users to generate their own pseudo color
  186. tables.  Pseudo colors are often used to highlight features of an unusual
  187. nature in an image.
  188.  
  189.    Since the Enhanced Graphic Adapter for the IBM PC provides only 4 gray
  190. shades (black, dark gray, light gray and white) most image viewing is done
  191. using a pseudo color table which interprets gray levels as color values
  192. ranging from black through reds, greens and blues up to white.
  193.  
  194.  
  195. 2.4 RADIOMETRIC AND GEOMETRIC CORRECTIONS
  196.  
  197.  
  198.    All camera systems have some kind of distortions in the lens, in the way
  199. the shutter works, etc.  Distortions in the amount of light transferred
  200. through the camera to the imaging plate are called radiometric distortions.
  201. Geometric distortion affects the "squareness" of an image, and is detected
  202. by taking an image of a geometric grid.
  203.  
  204.    For spacecraft cameras, both types of distortion can be measured before
  205. launch, and in a limited fashion, in flight.  These measured distortions
  206. are saved in digital files.  When a raw image is received, these
  207. "calibration files," as they are called, are subtracted from (or otherwise
  208. applied to) the image, effectively removing radiometric and geometric
  209. distortion.  This process is called radiometric and geometric correction.
  210. Corrected images contain the closest possible representation of the scene
  211. being imaged.
  212.  
  213.  
  214. 2.5 IMAGE FILE FORMATS
  215.  
  216.  
  217.    Digital image files are seldom stored as a simple array of pixels.
  218. Generally there is an area at the beginning of an image file containing
  219. descriptive information about the image.  This is referred to as a label or
  220. header area.  Figure 2-1 shows a diagram of a simple image format with a
  221. label area followed by the image lines.  In practice, images from planetary
  222. missions have a more complicated format, due to the need to store
  223. additional information to allow proper interpretation of the image data.
  224. Figure 2-2 shows the format of a Voyager image, which has engineering
  225. parameters embedded at the end of each image line to form a line suffix
  226. area, an engineering trailer record after the last image line, and this is
  227. followed by an image histogram.
  228.  
  229.  
  230.                        ┌────────────────────────┐
  231.                        │ Labels or Header Area  │
  232.                        ├────────────────────────┤
  233.                        │ Image Array Line 1     │
  234.                        ├────────────────────────┤
  235.                        │ Image Array Line 2     │
  236.                        └────────────────────────┘
  237.                                    .
  238.                                    .
  239.                                    .
  240.                        ┌────────────────────────┐
  241.                        │ Image Array Line n     │
  242.                        └────────────────────────┘
  243.  
  244.                     Figure 2-1: Simple Image Format
  245.  
  246.    Different image label formats have been developed for use by nearly all
  247. image processing facilities.  Two formats are widely used within the
  248. planetary and astronomy communities: the VICAR2 (Video Image Communication
  249. and Retrieval) labels used by the Multi-Mission Image Processing Laboratory
  250. (MIPL) and FITS (Flexible Image Transport) labels used for astronomy image
  251. interchange.  The PDS has developed a label scheme which is very similar to
  252. these standards, called the Object Description Language (ODL).  This format
  253. attempts to add a broader range of data descriptive capabilities to the
  254. proven capabilities of the existing label systems.
  255.  
  256.    Most of the images stored on the PDS CD-ROM disks have either ODL or
  257. VICAR2 labels.  IMDISP will automatically interpret these labels to
  258. determine the display format of the image data.
  259.  
  260.                  ┌────────────────────────────────────┐
  261.                  │ PDS ODL Labels                     │
  262.                  ├─────────────────────┬──────────────┤
  263.                  │ Image Array Line 1  │ Line Suffix  │
  264.                  ├─────────────────────┼──────────────┤
  265.                  │ Image Array Line 2  │ Line Suffix  │
  266.                  └─────────────────────┴──────────────┘
  267.                                    .
  268.                                    .
  269.                                    .
  270.                  ┌──────────────────────┬─────────────┐
  271.                  │ Image Array Line 800 │ Line Suffix │
  272.                  ├──────────────────────┴─────────────┤
  273.                  │ Image Engineering Trailer          │
  274.                  ├────────────────────────────────────┤
  275.                  │ Image Histogram                    │
  276.                  └────────────────────────────────────┘
  277.  
  278.                  Figure 2-2: Voyager CD-ROM Image Format
  279.  
  280.  
  281. 2.6 CD-ROM FUNDAMENTALS
  282.  
  283.  
  284.    The CD-ROM disk uses the same basic data storage format as a CD audio
  285. disk.  In fact, data blocks are identified by minute, second and sector
  286. number, following the audio format.  Data blocks are recorded along a
  287. spiral from the inner to the outer radius of the disk.  Each raw data block
  288. (sector) contains 2,352 bytes of information, with 304 bytes used for
  289. housekeeping and error correction and 2,048 (2K) containing user data.
  290. Each data block is called a sector, and 75 sectors are stored per second.
  291. Since the nominal playing time of a CD disk is 60 minutes, the data storage
  292. capacity is 75 sectors per second * 60 seconds per minute * 60 minutes or
  293. 270,000 sectors.  Thus the nominal storage capacity of a single CD-ROM disk
  294. is 540,000 kilobytes, which can be extended to more than 600,000 kilobytes
  295. and beyond by recording more than 60 minutes of data on a disk.
  296.  
  297.    In order to maximize the storage capacity of CD disks a constant linear
  298. velocity (CLV) recording format is used.  This means that the player
  299. changes speed (slows down) as it reads from the inside to the outside of
  300. the disk, to maintain a constant flow of data under the read mechanism at a
  301. speed of 1.2 meters per second.  This is in contrast to most magnetic disk
  302. drives which use constant angular velocity (CAV) storage, where the
  303. information density is greater on the inner tracks that the outer tracks.
  304. While the use of CLV recording increases the storage capacity of CD-ROM
  305. disks, it lengthens access time, since the disk must change speeds as it
  306. moves to different positions on the disk radius.  The strategy for locating
  307. a recorded data block is also more complicated than with constant angular
  308. velocity recording technology.
  309.  
  310.    As a result the average access time of CD-ROM drives is between 400 ms
  311. and 1 s, and the maximum data transfer rate to the host computer is 150
  312. kilobytes per second.  These rates are approximately an order of magnitude
  313. slower than magnetic disks.  Therefore, the access mechanisms to disk
  314. directories and data must be customized for CD-ROM in order to provide
  315. acceptable performance.
  316.  
  317.    The development of a standard logical format for recording data files on
  318. CD-ROM disks was taken on by a group of CD-ROM applications developers,
  319. hardware vendors and computer vendors.  The proposed standard resulting
  320. from this initial effort was called the High Sierra format.  This format
  321. was submitted to the International Standards Organization (ISO) for
  322. consideration and approved on October 5, 1987.  It is now referred to as
  323. the ISO-9660 standard.  The format used for the early PDS CD-ROM disks is
  324. dated May 28, 1986, and differs slightly from the final ISO standard.
  325. Microsoft and other CD-ROM software developers have committed to supporting
  326. this preliminary version of the format in later software releases.
  327. However, software developed by other vendors to support the ISO format (DEC
  328. for example) will not support the format of these early disks.
  329.  
  330.  
  331.  
  332.                                Chapter 3
  333.  
  334.                           IMDISP INSTALLATION
  335.  
  336.  
  337.    IMDISP requires an IBM PC, XT, AT or 100 percent compatible with 512K of
  338. base memory.  It supports several graphics display devices, including the
  339. Enhanced Graphics Adapter (EGA), the Video Graphics Array (VGA), the
  340. Professional Graphics Adapter (PGA), and the Color Graphics Adapter (CGA).
  341. The hardware environment in which the program has been developed and tested
  342. includes and AT class computer, deluxe or enhanced EGA board with 256K of
  343. memory, selected VGA boards with 512K or 1MB memory, and MultiSync (tm) or
  344. multiscan monitor.
  345.  
  346.  
  347. 3.1 PROGRAM SETUP
  348.  
  349.  
  350.    The IMDISP program can be run from a floppy or hard disk.  To use the
  351. program from a floppy disk, insert the program disk in the A: or B: drive
  352. and type the MS-DOS command: "A:" or "B:" to set the floppy disk as the
  353. default drive.  To use the program from hard disk first create a directory
  354. to hold the IMDISP files.  Use the MS-DOS command "MKDIR \IMDISP" to create
  355. a directory to hold the programs.  Use the "CHDIR \IMDISP" command to make
  356. IMDISP the default directory.  Insert the distribution floppy disk in
  357. floppy disk drive A:.  Now type "COPY A:*.*" to copy the files from the
  358. distribution disk to your hard disk.  You should now be able to run all
  359. examples from that directory on your hard disk.  If you wish to use IMDISP
  360. from other directories, you need to include the IMDISP directory in your
  361. MS-DOS "PATH" command.  This command provides MS-DOS with a list of
  362. directories to search when looking for a program file to run.  If you wish
  363. to run IMDISP from different directories, the \IMDISP subdirectory should
  364. be added to the PATH command in your AUTOEXEC.BAT file.  A sample path
  365. command would look like this:
  366.  
  367.                  PATH=C:\DOS;C:\UTIL;C:\WORDSTAR;C:\IMDISP
  368.  
  369.    You may want to add a line to your AUTOEXEC.BAT file which will allow
  370. you to abort the display program while running batch files or displaying
  371. large image files.  If the command "BREAK=ON" is placed in CONFIG.SYS, you
  372. will (sometimes) be able to terminate the IMDISP program by typing the
  373. control and break keys simultaneously.  Different computer systems offer
  374. varying response to the control-break command, and the use of this command
  375. may effect other programs you use.
  376.  
  377.    You can set IMDISP to start up in the correct display mode for your
  378. video system by specifying the environment variable IMDISP in your
  379. AUTOEXEC.BAT file.  A sample command to do this would look like this:
  380.  
  381.                             SET IMDISP=ORCHID800
  382.  
  383. if you have an Orchid ProDesigner super VGA board with 512K of video
  384. memory.  See section 3.3 for a description of all the possible supported
  385. video modes.
  386.  
  387.    IMDISP also builds various scratch files for use when browsing images or
  388. executing DOS functions.  By default, they go in the root directory on
  389. drive C:.  If you wish to have them written somewhere else, you may do that
  390. by specifying the desired directory in the environment variable IMBROWSE.
  391. A sample command to do this would look like this:
  392.  
  393.                            SET IMBROWSE=D:\TEMP\
  394.  
  395. This will make IMDISP write its scratch files in the subdirectory TEMP on
  396. drive D:.  Note that the final backslash (\) is required.  We recommend
  397. that the drive specified by IMBROWSE have at least 512K of free space - the
  398. scratch file written when using any of the DOS system calls can be as large
  399. as that.
  400.  
  401. Also, if you have a collection of color palettes in a separate
  402. subdirectory, you can specify this directory as being the default palette
  403. directory.  For example:
  404.  
  405.                      SET IMPALETTE=D:\IMAGES\PALETTES\
  406.  
  407. will tell IMDISP to look in the D:\IMAGES\PALETTES directory first when
  408. loading in a color palette with the PAL LOAD command.
  409.  
  410. IMDISP can use extended memory, managed by an XMS memory driver like
  411. HIMEM.SYS or QEMM, for its refresh buffer.  If no extended memory is
  412. available, IMDISP will not set up a refresh buffer by default, but will
  413. allow the user to open a disk file to be used for refreshing the screen.
  414. In this case, the environment variable IMREFRESH defines where the refresh
  415. buffer is to go, so
  416.  
  417.                              SET IMREFRESH=G:\
  418.  
  419. tells IMDISP to put the refresh buffer in the root directory of drive G:.
  420. Note that the refresh buffer can be quite large - a 1024x768 display will
  421. require 768K of disk space (or XMS memory) to hold the entire buffer.
  422.  
  423.  
  424. 3.2 CD-ROM SETUP
  425.  
  426.  
  427.    To use the IMDISP program with PDS CD-ROM disks you will need a CD-ROM
  428. reader, interface board, and software provided by the vendor which will
  429. make your CD Reader look like a disk drive to your PC.  The details of
  430. setting up your hardware and software configuration are beyond the scope of
  431. this manual, however several aspects of setup will be reviewed.
  432.  
  433.    There are many potential pitfalls in setting up your hardware and
  434. interface board.  Read the directions carefully, and don't assume that
  435. "default" switch settings are correct.  Check all switches to see that they
  436. correspond to the recommended settings.
  437.  
  438.    To work properly with the batch command and label files provided with
  439. IMDISP, your CD-ROM drive should be set up to be drive letter "L:".  Most
  440. vendor software allows you to select the drive letter which will be
  441. assigned to the CD-ROM reader.
  442.  
  443.  
  444. 3.2.1 Microsoft Extensions
  445.  
  446.  
  447.    If you are using the Microsoft Extensions you will load a CD-ROM device
  448. driver as part of your CONFIG.SYS file (or two drivers if using the Philips
  449. or DEC readers) with a line like this:
  450.  
  451.    DEVICE=HITACHI.SYS /D:CDROM1 /N:1
  452.  
  453. This command assumes that the driver file "HITACHI.SYS"is located in your
  454. ROOT directory.  The /D:CDROM1 switch assigns a logical name CDROM1 to the
  455. drive.  A name must be supplied, and is used to identify this device, in
  456. case more than one CD-ROM drive is being used on your system.  The name
  457. should not be the same as the name of any file stored on your system.  An
  458. attempt to open a file with the same name as the device driver will result
  459. in the device driver being opened, not the file.  The /N:1 switch indicates
  460. that this is drive 1.  This switch is used since some CD-ROM interface
  461. cards support multiple drives.
  462.  
  463.    Other commands which should be included in CONFIG.SYS if you are using a
  464. CD-ROM drive with the Microsoft Extensions are:
  465.  
  466.    LASTDRIVE=Z
  467.    FILES=30
  468.    BUFFERS=50
  469.  
  470.    The LASTDRIVE command tells MS-DOS to allow for enough drive letters to
  471. support the CD-ROM drive, plus any other drives on your system.  Using
  472. LASTDRIVE=L should also work in most circumstances.  The files and buffers
  473. specifications provide sufficient system work area to support CD-ROM
  474. operations.
  475.  
  476.    You must also execute a program called MSCDEX.EXE which allows access to
  477. the CD-ROM drive as if it were a disk drive on your system.  This command
  478. can be put in your AUTOEXEC.BAT file so that it is automatically run
  479. whenever you start-up your computer.  The command format is:
  480.  
  481.    MSCDEX /D:CDROM1 /L:L /M:20 /V /E
  482.  
  483.    Several MSCDEX command switches are illustrated.  The /L:L command
  484. assigns the drive name L: to the CD-ROM drive.  The /D switch gives the
  485. device name of the CD-ROM drive (which must be the same name used in the
  486. device name parameter of  the "DEVICE=CDROM.SYS" command in the CONFIG.SYS
  487. file.  The /M:20 switch assigns twenty 2K blocks of memory as a buffer for
  488. use with CD-ROM data.  The /V switch provides verbose messages when the
  489. installation program is run, and /E tells the program to use expanded
  490. memory for the cache area.
  491.  
  492.  
  493. 3.2.2 Other Driver Software
  494.  
  495.  
  496.    Some vendors (Reference Technology, TMS) offer CD-ROM software which is
  497. comparable to the Microsoft Extensions.  Our experience with these software
  498. packages is that they modify the internals of MS-DOS and may cause
  499. unpredictable results with your other PC software.  They often do not
  500. support CD-ROM applications designed to work with the MS-DOS extensions for
  501. CD-ROM and cannot be used with the IMDISP FILE prompt mode.
  502.  
  503.  
  504. 3.2.3 Problems with CD-ROM Software
  505.  
  506.  
  507.    The PDS CD-ROM disks utilize a feature of the CD-ROM format standard
  508. which provides extended attribute records to define the physical
  509. characteristics of data files.  These records will be used by VAX and other
  510. minicomputer systems where the operating system allows a variety of record
  511. formats (fixed, variable, stream).  Many of the earlier implementations of
  512. High Sierra software failed to recognize these records, which are placed at
  513. the beginning of a file's data area.  If your CD-ROM software was developed
  514. prior to April 1987, it may interpret these records as part of the data
  515. file, causing the first 2K bytes of each file to appear as meaningless
  516. binary data.  Users with this problem should contact their hardware or
  517. software vendors for updated versions of the CD-ROM software.  The IMDISP
  518. program has been patched to recognize and skip over these records on the
  519. PDS CD-ROM disks, but these patches may not support other CD-ROM disks with
  520. extended attribute records.
  521.  
  522.  
  523. 3.3 DISPLAY DEVICE CHARACTERISTICS
  524.  
  525.  
  526.    IMDISP automatically finds out which display devices are available (PGA,
  527. EGA, or CGA) and uses the one available.  The Enhanced Graphics Adapter
  528. must have at least 128K of memory to work properly.  Use of the Color
  529. Graphics Adapter is discouraged because the pixels have no gray levels,
  530. only black or white.
  531.  
  532.    The display coordinates start at (1,1) in the upper left corner of the
  533. screen; the line direction is down and the sample direction is to the
  534. right.
  535.  
  536.  
  537. 3.3.1 Enhanced Graphics Adapter (EGA)
  538.  
  539.  
  540.    The EGA is a bit-mapped display device providing a resolution of 350
  541. lines by 640 samples of 4-bits each.  It produces a digital video signal
  542. for each primary color (red, green and blue), The video signal for each
  543. color can be set to one of four levels, roughly equivalent to off, low,
  544. medium and high.  Thus the number of possible colors (color palette) is 64
  545. (4^3).  The following table illustrates the colors created by some of the
  546. different combinations of red, green and blue.
  547.  
  548.       Red=   off, Green=   off, Blue=   off  results in Black
  549.       Red=   low, Green=   off, Blue=   off  results in Dark Red
  550.       Red=medium, Green=   off, Blue=   off  results in Light Red
  551.       Red=  high, Green=   off, Blue=   off  results in Bright Red
  552.       Red=   low, Green=   low, Blue=   low  results in Dark Gray
  553.       Red=medium, Green=   low, Blue=   off  results in Brown
  554.       Red=medium, Green=medium, Blue=   off  results in Yellow
  555.       Red=medium, Green=medium, Blue=medium  results in Light Gray
  556.       Red=  high, Green=   low, Blue=   off  results in Orange
  557.       Red=  high, Green=  high, Blue=  high  results in White
  558.  
  559.               Table 3-1: Sample EGA Color Palette Settings
  560.  
  561.  
  562.    The EGA display is limited to only 16 colors out of the 64 possible,
  563. because only 4-bits are used to store each pixel value in memory.  This
  564. 4-bit pixel value points to an entry in the color table which represents
  565. one of the 64 possible combinations of red, green and blue which can be
  566. displayed.
  567.  
  568.    Many of the newer EGA boards are capable of displaying additional lines
  569. and samples when using a MultiSync (tm) or Multiscan monitor.  The standard
  570. EGA uses a 16 Mhz crystal oscillator (something like a clock which
  571. regulates the display speed), which limits the video output rate to the
  572. equivalent of 640 pixels by 350 lines.  The EGA circuitry allows for a
  573. faster crystal oscillator to be added to the board (24 Mhz and beyond)
  574. allowing about 25 percent more lines to be displayed (480 lines instead of
  575. 350).  A method for adding this capability to an existing EGA board (for
  576. about $10 worth of parts) is described in the September 16, 1986 issue of
  577. PC Magazine.
  578.  
  579.    This mode requires that a MultiSync (tm) or multiscan monitor be
  580. attached to the computer, and there is no way for the program to
  581. automatically detect the presence of the special monitor.  Therefore this
  582. display mode is invoked by specifying an MS-DOS "ENVIRONMENT" variable.
  583. This is done by issuing an MS-DOS "SET" command at the MS-DOS prompt as
  584. follows:
  585.  
  586.    SET IMDISP=EGA480
  587.  
  588.    This command can also be put in your AUTOEXEC.BAT file using a text
  589. editor, so that you need not invoke it each time you run IMDISP.  It should
  590. have no effect on other MS-DOS system operations.  There is a chance that
  591. adding this variable will exceed the size reserved by MS-DOS for environment
  592. variables.  If so, you should consult your MS-DOS manual to increase the
  593. environment size on your system.  The environment variable can be removed
  594. with the MS-DOS command:
  595.  
  596.    SET IMDISP=
  597.  
  598. where a carriage return is typed immediately after the equal sign.  The 480
  599. line mode requires an additional 83K of memory for the refresh buffer.  If
  600. you try this mode and receive the message "Insufficient memory for line
  601. buffer", it is probably because you have a 512K memory machine, or have
  602. memory resident programs operating (like Sidekick or Superkey) which reduce
  603. the available memory to less than about 400K.  You will need to use the 350
  604. line mode or remove some memory resident programs to operate in 480 line
  605. mode.
  606.  
  607.  
  608. 3.3.2 Video Graphics Array (VGA)
  609.  
  610.  
  611.    This version (7.9) of the IMDISP program includes support for the IBM
  612. Video Graphics Array (VGA) display device.  The VGA produces an analog
  613. display with several new color modes.  Of particular interest to IMDISP
  614. users are the 640 x 480 line mode with 16 displayable colors (or gray
  615. levels).  The 320 x 200 line mode with 256 displayable colors (or 64 gray
  616. levels) has been tested but produces very blocky pixels.  This version of
  617. IMDISP also supports a number super VGA graphic boards (see below).
  618.  
  619.    To set the VGA display mode you must set a MS-DOS environment variable
  620. prior to executing IMDISP.
  621.  
  622.    To set the environment variable use the MS-DOS command:
  623.  
  624.    SET IMDISP=VGA
  625.  
  626. This will put the display in 640 sample by 480 line mode, with 16 gray
  627. levels or colors displayable from a palette of 256K.  The display is
  628. initialized with a gray scale palette, but a pseudocolor palette can be
  629. invoked with the IMDISP command "PAL PS 0".  The "PALETTE EDIT" command
  630. will allow you to step forward or backward through the 64 available shades
  631. for each primary color.  See the next section of the IMDISP manual for more
  632. information on the palette edit function.
  633.  
  634.  
  635.    Users may experiment with the 320 x 200 VGA mode by using
  636.  
  637.    SET IMDISP=VGA320
  638.  
  639. The pixels are rather large in this mode, but there are enough colors to
  640. display images nicely.
  641.  
  642.  
  643. 3.3.3 Professional Graphics Adapter (PGA)
  644.  
  645.  
  646.    The PGA is a special graphics board developed by IBM for use with
  647. CAD/CAM applications on the IBM PC.  Because its architecture is
  648. incompatible with the CGA and EGA boards, it has not been well received by
  649. software developers.  The PGA provides an analog video signal with a
  650. display resolution of 480 lines by 640 samples of 8-bits each.  It provides
  651. 16 intensities for each primary color, resulting in a palette of 4,096
  652. colors (16^3).  The color table allows 256 colors to be displayed
  653. simultaneously, however only 16 gray levels can be selected.
  654.  
  655.    Use the command:
  656.  
  657.    SET IMDISP=PGA
  658.  
  659. at the MS-DOS prompt to force IMDISP to go into PGA display mode.
  660.  
  661.  
  662. 3.3.4 Color Graphics Adapter (CGA)
  663.  
  664.  
  665.    The CGA display is a bit-mapped graphics device with a resolution of 200
  666. lines by 640 samples of 1-bit each.  It supports only 2 colors in this
  667. display mode, black and white.  This display can be used to get a general
  668. idea of the contents of a digital image, or for displaying one bit images
  669. (graphics for example) but is not recommended for use with the PDS CD-ROM
  670. images.
  671.  
  672.    To force a multi-function display card into CGA mode, use:
  673.  
  674.    SET IMDISP=CGA
  675.  
  676.  
  677. 3.3.5 Super VGA Display Boards
  678.  
  679.  
  680.    Several high resolution display boards are supported by this version of
  681. IMDISP.   Most of them support resolutions with 256 colors or 64 grayscale
  682. levels.  Select one from the following list if it matches your display
  683. board:
  684.  
  685.        SET IMDISP=     Resolution     Board Name
  686.            ATI640      640x480x256    ATI VGA Wonder Board (512K)
  687.            ATI800      800x600x256    ATI VGA Wonder Board (512K)
  688.            ATI1024     1024x768x16    ATI VGA Wonder Board (512K)
  689.            EVGA512     512x480x256    Everex EV-673 Board  (256K)
  690.            EVGA640     640x400x256    Everex EV-673 Board  (256K)
  691.            ORCHID      640x480x256    Orchid ProDesigner+ Board (512K)
  692.            ORCHID800   800x600x256    Orchid ProDesigner+ Board (512K)
  693.            ORCHID1024 1024x768x256    Orchid ProDesigner+ Board (1MB)
  694.            PARADISE    640x480x256    Paradise VGA Board (400 lines if the
  695.                                       board has 256K of memory)
  696.            TRIDENT     640x480x256    Trident-based SVGA boards (512K)
  697.            VESA       1024x768x256    VESA SVGA Interface (1MB) (not fully
  698.                                       implemented)
  699.  
  700.  
  701. 3.4 MULTIPLE BUFFERS
  702.  
  703. Multiple copies of images (or the entire screen) can now be copied and
  704. stored away into buffers, limited by the available memory.  If you don't
  705. have enough memory, the buffers can still be used, but as virtual files
  706. (see HINTS & TIPS ON CONSERVING MEMORY, down below).  Using the buffers,
  707. images can now be merged together to create interesting effects.  You can
  708. add or subtract images from each other.  You can store an image away into a
  709. buffer before applying a filter, and if you didn't like the result, then
  710. retrieve it back from the buffer, effectively creating an UNDO feature.
  711. You can create a "face-on-Venus image" by merging the face-on-Mars image
  712. with a Magellan image.
  713.  
  714. There are 26 buffers available in IMDISP, limited by memory or disk space.
  715. The buffers are referenced by name as a single letter, one for each letter
  716. of the alphabet (A-Z).
  717.  
  718.  
  719. 3.5 HINTS & TIPS ON CONSERVING MEMORY
  720.  
  721. If you have no extended memory, or don't have enough extended memory, don't
  722. despair.  You can still use the buffers if you use the following tips to
  723. help you maximize the use of the memory
  724.  
  725.      o IMDISP will automatically create a refresh buffer in extended memory
  726.        whose size is the size of the screen.  You can disable the refresh
  727.        buffer and this memory will be freed up for buffer use.  To disable
  728.        the refresh buffer, type:
  729.  
  730.            SET REFRESH OFF
  731.  
  732.        The refresh buffer can be enabled with
  733.  
  734.            SET REFRESH ON
  735.  
  736.      o IMDISP will also attempt to load an entire image into extended
  737.        memory whenever you do the FILE command.  You can have IMDISP not do
  738.        this by using the NOMEMORY option:
  739.  
  740.            FILE IO.IMG NOMEMORY
  741.  
  742.      o If you are using a Super VGA graphics card in its highest
  743.        resolution, then if you switch to a lower screen resolution, this
  744.        will generally cause the buffers to be smaller.  For example, if you
  745.        using an Orchid Pro Designer II card in its highest resolution
  746.        (1024x768), then you can switch to the 800x600 or 640x480 screen
  747.        resolutions:
  748.  
  749.             SET DIS ORCHID800
  750.             SET DIS ORCHID
  751.  
  752.      o Subsample the image so that it doesn't take up the entire screen,
  753.        which then can be saved to smaller buffers:
  754.  
  755.              DISP SUB 3
  756.  
  757.      o Use the FILE option on the COPY or MERGE commands to store buffers
  758.        into a file instead of extended memory.
  759.  
  760.      o Erase any unused buffers:
  761.  
  762.               ERASE A
  763.  
  764. 3.6 THE HELP FILE
  765.  
  766.    The HELP command in IMDISP uses a plain text file, called IMDISP.HLP,
  767. which contains brief summaries of each command and its options.  This file
  768. can be modified as you wish with any text editor or word processor capable
  769. of saving files in plain ASCII format.
  770.  
  771.    IMDISP looks in several places to try to find the help file when the
  772. program starts.  First, the DOS environment is searched for the environment
  773. variable IMHELP.  If IMHELP is found, and contains a file name, the program
  774. will attempt to open that file (so you can call the help file anything you
  775. want).  If IMHELP contains only the name of a subdirectory, the program
  776. will attempt to open IMDISP.HLP in that directory.  If that fails, or if
  777. IMHELP is not set, the program then looks in the current directory for
  778. IMDISP.HLP.  If IMDISP.HLP isn't found in the current directory, and if you
  779. are using MS-DOS v3.3 or later, the program tries to open the help file in
  780. the directory where the IMDISP.EXE program file is located.  If all these
  781. fail, the program reports that it can't open the help file and continues.
  782.  
  783.    For example, to use a file called MYHELP.IMD, located in the
  784. subdirectory C:\HELPFILES, instead of using the default file IMDISP.HLP,
  785. issue the command
  786.  
  787.       SET IMHELP=C:\HELPFILES\MYHELP.IMD
  788.  
  789. either at the DOS prompt or in your AUTOEXEC.BAT file.  To use the file
  790. IMDISP.HLP, but to allow the program to find it in the subdirectory
  791. C:\HELPFILES, issue the command
  792.  
  793.       SET IMHELP=C:\HELPFILES
  794.  
  795. or
  796.  
  797.       SET IMHELP=C:\HELPFILES\
  798.  
  799.                                  Chapter 4
  800.  
  801.                               IMDISP OPERATION
  802.  
  803.  
  804.    IMDISP can be used to display images up to several thousand lines and
  805. samples with a variety of pixel formats.  These formats include bit (1
  806. bit), nibble (4 bits), byte (8 bits), integer (16 bits) or long integer (32
  807. bits).  Integer pixels may be byte-swapped, which means that the sign and
  808. most significant 7 bits are in the rightmost byte, and the least
  809. significant 8 bits are in the leftmost byte.  This is the convention used
  810. by both the IBM PC and VAX computer hardware families.  IBM mainframes and
  811. 68000 series computers (Macintosh and Sun, for example) use non-byte-
  812. swapped integers.
  813.  
  814.    Program interaction with the user is via commands typed in response to
  815. the "COMMAND:" prompt.  Most interaction is performed on the graphic
  816. display screen, and program messages are printed over any image display
  817. currently on the screen.  The REFRESH command can be used to restore an
  818. image after other commands have written text over the display.  The ERASE
  819. command can be used to clear away the clutter left by program status
  820. messages and previously displayed images.  The screen is not automatically
  821. erased after each operation in order that multiple images can be displayed
  822. simultaneously, or so a histogram can be placed on the screen with the
  823. image.
  824.  
  825.    IMDISP is invoked by typing "IMDISP" or "IMDISP filename", where
  826. filename is the name of an image file to be opened for processing at
  827. program start-up.  The filename may include a disk drive and path name
  828. specification.
  829.  
  830.    The program will blank the display screen and display a welcome logo,
  831. then the prompt "COMMAND:" will appear in the lower left portion of the
  832. screen.  If a filename is included in the command invocation, the welcome
  833. message is not displayed and the screen will display the COMMAND: prompt.
  834.  
  835.    Typing "HELP" at the command prompt will provide a list of IMDISP
  836. commands.  The most frequently used commands are "FILE" to open a file for
  837. processing, and "DISPLAY" to display an image once the file has been
  838. opened.
  839.  
  840.    Previous commands can be recalled for editing, so you don't have to type
  841. them over again.  Use the up arrow (or cursor up) key to recall old
  842. commands.  The left and right arrow (cursor) keys move you back and forth
  843. in the command.  Make whatever changes you want, then press the Enter key
  844. to execute the command.
  845.  
  846.  
  847. 4.1 COMMAND SYNTAX
  848.  
  849.  
  850.    The command line syntax is of the form:
  851.  
  852.   COMMAND KEYWORD1 = VALUE1 KEYWORD2=VALUE2 KEYWORD3 VALUE3 ...
  853.  
  854.    The command line may be typed in either upper or lower case.  The
  855. command and the keyword names may be abbreviated to 3 characters in most
  856. cases.  Any number of spaces may be inserted between words, and the keyword
  857. and value may be separated by a space or an equals sign.  Some keywords do
  858. not require a value.  All keywords are optional and have default values.
  859.  
  860.  
  861. 4.2 COMMAND DESCRIPTION
  862.  
  863.  
  864.    Table 4-1 presents a summary of IMDISP commands.  They are separated
  865. into 3 groups, file manipulation commands; display commands and program
  866. control commands.  Only the capitalized letters are required to specify a
  867. command.
  868.  
  869.  
  870. 4.3 OPERATING MODES
  871.  
  872.  
  873.    Several of the commands invoke special program operating modes.  These
  874. include the FILE command when issued without a filename argument and the
  875. CURSOR, PROFILE and PALETTE EDIT commands.  The FILE mode displays a list
  876. of files in the current directory on the screen for selection.  It also
  877. contains several subcommands for controlling the display of files on the
  878. menu screen.  In the CURSOR, PROFILE and PALETTE EDIT commands the cursor
  879. keys (arrow keys) on the numeric keypad are used in conjunction with other
  880. keys to control program operation.  These modes are exited by typing either
  881. a period '.' or carriage return.
  882.  
  883. File oriented commands:
  884.  
  885.     CD or CHDIR .  .  .  .  to change the default directory
  886.     DIRECTORY   .  .  .  .  to perform the MS-DOS directory command
  887.     FILE        .  .  .  .  to specify the name of the image
  888.     LABEL       .  .  .  .  to display the image labels
  889.     LOG         .  .  .  .  to save (log) commands to a text file
  890.     SAVE        .  .  .  .  to save the image display to a file
  891.     TYPE        .  .  .  .  to perform the MS-DOS type command
  892.  
  893. Display commands:
  894.  
  895.     BROWSE      .  .  .  .  to display a group of images
  896.     CURSOR      .  .  .  .  to move the cursor around
  897.     DISPLAY     .  .  .  .  to display the image
  898.     ERASE       .  .  .  .  to erase the display
  899.     HISTOGRAM   .  .  .  .  to display the histogram of the image
  900.     OVERLAY     .  .  .  .  to place an overlay on the image
  901.     PALETTE     .  .  .  .  to adjust the palette for the display
  902.     PERSPECTIVE .  .  .  .  to plot a pseudo-perspective of the image
  903.     PLOT        .  .  .  .  to plot image lines and spectra on the display
  904.     PROFILE     .  .  .  .  to plot a profile of the image
  905.     REFRESH     .  .  .  .  to refresh the image plane
  906.     SET         .  .  .  .  to set display options
  907.     TEXT        .  .  .  .  to draw text on the image
  908.  
  909. Image processing commands:
  910.  
  911.     BRIGHTEN    .  .  .  .  to brighten the image
  912.     COPY        .  .  .  .  to copy images to/from memory buffers
  913.     DARKEN      .  .  .  .  to darken the image
  914.     ENHANCE     .  .  .  .  to apply various filters to the image:
  915.          BAALKE
  916.          CONVOLUTION
  917.          EDGE
  918.          HIGH
  919.          HISTOGRAM
  920.          LOG
  921.          MEAN
  922.          MEDIAN
  923.          POWER
  924.          STAIR
  925.          SMEAR
  926.          UNSHARP
  927.     MASK        .  .  .  .  to mask off pixels in the image
  928.     MERGE       .  .  .  .  to combine image and memory buffers
  929.     NEG         .  .  .  .  to invert the color palette
  930.     PALETTE     .  .  .  .  to adjust the palette for the display
  931.     ROTATE      .  .  .  .  to rotate the image
  932.     SLANT       .  .  .  .  to slant the image to the right or left
  933.     STRETCH     .  .  .  .  to do a linear gray scale stretch
  934.     WINDOW      .  .  .  .  to mark off a subimage on the screen
  935.  
  936.  
  937. Program control commands:
  938.  
  939.     BATCH       .  .  .  .  to execute a batch command file
  940.     EXIT or QUIT.  .  .  .  to exit from the program
  941.     HELP        .  .  .  .  Display help information
  942.     MENU        .  .  .  .  to select images from a menu file
  943.     SYSTEM      .  .  .  .  execute an MS-DOS command
  944.  
  945.          Table 4-1: IMDISP Command Summary
  946.  
  947.  
  948. 4.4 ERROR HANDLING
  949.  
  950.  
  951.    If an invalid command is issued at the COMMAND: prompt the program will
  952. beep and return to the COMMAND: prompt.  In handling command parameters the
  953. program takes action on those parameters that are recognized, but ignores
  954. invalid parameters.
  955.  
  956.    It is also possible for certain system errors to be encountered which
  957. cause the program to abort leaving your computer in graphics mode.  If you
  958. are using certain utilities which reset the default text mode screen colors
  959. (like the Norton Utilities screen attributes command) you may not be able
  960. to see what is being printed on the screen.  The simplest approach is to
  961. perform a warm boot, by typing the Ctrl, Alt, Del keys simultaneously.
  962. Alternately, you can often type IMDISP then EXIT to reset the computer to
  963. text mode.  Errors in processing image files on CD-ROM, hard disk or floppy
  964. disks can cause these aborts.
  965.  
  966.  
  967. 4.5 COMMAND REFERENCE
  968.  
  969.  
  970.    This section lists all IMDISP commands alphabetically and describes
  971. their function, parameters which control  command operation, and provides
  972. examples of command use, In the command and parameter description the
  973. following conventions are used:
  974.  
  975.    filename    represents the name of an MS-DOS file, and may include an
  976.                optional drive identifier and path specification.
  977.  
  978.    n           represents an integer value.
  979.  
  980.  
  981. 4.5.1 BATCH
  982.  
  983.  
  984.    The BATCH command reads commands from the specified batch command file.
  985. If no file name is specified the current directory is searched for a file
  986. named BATCH.CMD.  The CURSOR, PROFILE and PALETTE EDIT commands should not
  987. be used within batch command files since they require interactive inputs
  988. from the keyboard.  Batch files may be nested.
  989.  
  990.    The BATCH command may take the following argument:
  991.  
  992.    filename    filename of batch command file.
  993.  
  994.    A batch file is simply a text file containing a list of commands, with
  995. each command terminated by a carriage return.  You can add comments to a
  996. batch file by putting a semi-colon on the line.  Everything from the
  997. semi-colon to the end of the line is ignored.  If the command file is
  998. created with a word processor, the program should be used in the
  999. non-document mode, to assure that carriage returns are embedded between
  1000. command lines.  An example of creating a batch file to display the PDS logo
  1001. image follows.
  1002.  
  1003.    At the MS-DOS command level type:
  1004.  
  1005.    COPY CON TEST.CMD
  1006.    FILE LOGO.IMG
  1007.    DISP ZOOM 4
  1008.    DISP ZOOM 2
  1009.    DISP
  1010.    DISP SUB 2
  1011.    EXIT
  1012.  
  1013.    Now run IMDISP and type "BATCH TEST.CMD" at the "COMMAND:" prompt.  Make
  1014. sure the file "LOGO.IMG" is in your current directory.  The PDS logo should
  1015. be displayed on the screen in several different sizes.
  1016.  
  1017.  
  1018. 4.5.2 BRIGHTEN
  1019.  
  1020.    The BRIGHTEN command adds a constant value to all pixels in the
  1021. displayed image.  If no value is specified, the default is 10% of the total
  1022. range of DN values (i.e., 2 will be added to all pixels in 16-color modes,
  1023. 26 will be added in 256 color modes).
  1024.  
  1025.     Examples:
  1026.  
  1027.        BRIGHTEN
  1028.        BRIGHTEN 50
  1029.  
  1030. 4.5.3 BROWSE
  1031.  
  1032.  
  1033.    The BROWSE command will display all images in a directory one after
  1034. another.  An optional directory mask can be supplied to display only
  1035. selected files ("BROWSE *.IMG").  The command creates a list of files to be
  1036. displayed, then creates and executes a batch command file to display those
  1037. images.  After each image is displayed, the filename is displayed at the
  1038. top of the image.  A BROWSE session can be interrupted by pressing
  1039. control-s, then restarted by pressing control-q TWICE.  A session can be
  1040. halted by typing any other key during the display.  It can then be
  1041. restarted (from the beginning) with the command "BROWSE C:BATCH.CMD".  The
  1042. default file name for the batch file created by the BROWSE command is
  1043. "C:BATCH.CMD".  This name can be changed using the "SET BROWSE fname"
  1044. command where fname can consist of a drive letter and filename, which
  1045. should be terminated  with the extension ".CMD".  It can also be set from
  1046. DOS or in your AUTOEXEC.BAT file by using the environment variable
  1047. IMBROWSE.  For example, the DOS command
  1048.  
  1049.    SET IMBROWSE=D:\TEMP\BROWSE.CMD
  1050.  
  1051. will make the BROWSE command file in the subdirectory TEMP on drive D:.
  1052.  
  1053.    The BROWSE command has one argument and several optional keywords.
  1054.  
  1055.    fname         optional file selection mask (must immediately follow the
  1056.                  command BROWSE).
  1057.                  Examples: *.img, D:\IMAGES\*.IMG, L:*.BRS.
  1058.  
  1059.    SIZe n        allows the display of multiple images on the screen.  For
  1060.                  example, on a 640x480 VGA display, six 200x200 images can
  1061.                  be displayed adjacent to each other.
  1062.  
  1063.    SUBsample n   used in conjunction with the SIZE command, to scale each
  1064.                  image to fit in the SIZE specification.  Same as SUB
  1065.                  option used with the DISPLAY command.
  1066.  
  1067.    NOLabel       inhibits writing the file name label at the top of each
  1068.                  image as it is displayed.  The default is that labels are
  1069.                  enabled.
  1070.  
  1071.    DNLow DNHigh  sets the DN range for all images (see SET).
  1072.  
  1073.    PAUse n       pauses display for n seconds when the screen gets full.
  1074.  
  1075.    ALL           searches all subdirectories in addition to the current
  1076.                  directory, looking for files matching the mask.
  1077.  
  1078.    AUToset n     sets DNLO and DNHI to n% of the full range, based on the
  1079.                  image histogram.  The default is 5%.
  1080.  
  1081.    SELect        interactively selects files as they are being displayed
  1082.                  and writes the filenames out to a "select" file.  The
  1083.                  default select file is "C:\IMDISP.SEL" and this can be
  1084.                  changed by using the SET SELECT command.
  1085.  
  1086.    FILe fname    select files to browse from a file instead of using a
  1087.                  mask.  The file will contain a list of files, and the list
  1088.                  can have wildcarded names.  The filename can also be the
  1089.                  IMDISP.SEL file created earlier with the SELect option.
  1090.  
  1091.    BUFFERS       browses through all the memory buffers which have been
  1092.                  created.
  1093.  
  1094.    EXAMPLES:
  1095.  
  1096.        BROWSE *.* SIZE 200 SUBSAMPLE 4
  1097.  
  1098. will display all the files in the current directory, subsampling each by 4
  1099. and displaying them in a 200 x 200 window.  The command:
  1100.  
  1101.        BROWSE *.IBG SIZE 100 SUB 2 PAUSE ALL
  1102.  
  1103. when used with the Voyager browse images will display all of the browse
  1104. images on the screen (including the subdirectories), pausing each time the
  1105. screen fills up with images.
  1106.  
  1107.        BRO *.* SIZE 200 ALL SELECT NOLABEL
  1108.  
  1109. will allow the selection of individual images and
  1110.  
  1111.        BRO FILE C:\IMDISP.SEL SIZE 200
  1112.  
  1113. will redisplay the images that you just selected.
  1114.  
  1115.        BROWSE BUFFERS PAUSE
  1116.  
  1117. displays the contents of each buffer, pausing in between each display.
  1118.  
  1119.        BRO BUFFERS SIZE 100 SUB 4
  1120.  
  1121. displays a small version of each buffer.
  1122.  
  1123. *** NOTE ***
  1124.  
  1125.    BROWSE does not distinguish between image and non-image files, and it is
  1126. up to the user to provide the appropriate directory mask to select ONLY
  1127. images.  If a message "Image does not have proper label" comes up on the
  1128. screen during BROWSE, it is probably because a non-image file is in the
  1129. directory you are browsing.   You can type carriage returns several times
  1130. to get back to the "COMMAND:" prompt, and the browse will continue.
  1131.  
  1132.    If you are using BROWSE on a computer without a hard disk, you will have
  1133. to use the SET BROWSE command to change the default browse file name to a
  1134. writable disk drive,  for example: "SET BROWSE A:BROWSE.CMD".  If you are
  1135. using BROWSE to view files on a CD-ROM disk, be sure to include the drive
  1136. letter of a writable disk  drive if you specify a BROWSE file name.  The
  1137. text editor to produce your own custom command files.
  1138.  
  1139.  
  1140. 4.5.4 CD or CHDIR
  1141.  
  1142.  
  1143.    The CD or CHDIR command is used just as it is at the MS-DOS command
  1144. level to change the current default directory.
  1145.  
  1146.    The  argument  of the CD command is the  path  name specification of the
  1147. new default directory.  For example, "CD \IMDISP\IMAGES" would make
  1148. \IMDISP\IMAGES the current directory if it exists.  To change the current
  1149. default drive use the "SYSTEM" command ("SYSTEM L:"  for example) or the
  1150. "FILE" command.  If there is not enough memory available for the system
  1151. command to be executed an error message is displayed.
  1152.  
  1153.  
  1154. 4.5.5 COPY
  1155.  
  1156. The COPY command will attempt to copy the image last displayed with the
  1157. DISPLAY command, the screen or another buffer to a destination buffer.
  1158. IMDISP will attempt to put the buffer into extended memory.  An FILE option
  1159. is provided to allow the buffer to be stored on the disk, rather than in
  1160. memory.
  1161.  
  1162.         COPY  buffer [FILe]
  1163.         COPY  TO buffer [FILe]
  1164.         COPY  source TO buffer [FILe]
  1165.  
  1166.       where buffer = A-Z
  1167.       where source = A-Z or SCReen
  1168.  
  1169. Examples:
  1170.  
  1171. COPY A                Copies the last displayed image to buffer A
  1172. COPY A TO B           Copies buffer A to buffer B
  1173. COPY A TO B FILE      Copies buffer A to buffer B, buffer B is actually
  1174.                       stored on disk, instead of in memory
  1175. COPY SCREEN TO Z      Copies the entire screen to buffer Z
  1176.  
  1177.  
  1178. 4.5.6 CURSOR
  1179.  
  1180.  
  1181.    The CURSOR command is used to select a point in a displayed image for
  1182. subsequent display commands.  When first invoked, it places a small cursor
  1183. symbol at the center of the screen.  Depending on the current contents of
  1184. the screen, the cursor may be hard to see.  Moving it with the arrow keys
  1185. on the numeric keypad will help you locate it.  If you have a mouse, it
  1186. will also move the cursor around.
  1187.  
  1188.    Whenever the cursor is moved, the current line and sample location of
  1189. the cursor and the DN value of the pixel at that point is printed in the
  1190. lower right portion of the screen.  The cursor will move 16 pixels in the
  1191. selected direction unless the movement value is adjusted using the + or
  1192. keys.
  1193.  
  1194.                           Numeric Keypad Keys
  1195.                     ┌──────┬──────┬───────┬───────┐
  1196.                     │  7   │  8   │  9    │ PrtSc │
  1197.                     │ Home │ Up   │ PgUp  │       │
  1198.                     ├──────┼──────┼───────┼───────┤
  1199.                     │  4   │  5   │  6    │  -    │
  1200.                     │ Left │      │ Right │       │
  1201.                     ├──────┼──────┼───────┼───────┤
  1202.                     │  1   │  2   │  3    │  +    │
  1203.                     │ End  │ Down │ PgDn  │       │
  1204.                     └──────┴──────┴───────┴───────┘
  1205.  
  1206.                          Action of Keypad Keys:
  1207.  
  1208.                   7 = Move up and left.
  1209.                   8 = Move up.
  1210.                   9 = Move up and right.
  1211.                   4 = Move left.
  1212.                   5 = Not active.
  1213.                   6 = Move right.
  1214.                   1 = Move down and left.
  1215.                   2 = Move down.
  1216.                   3 = Move down and right.
  1217.                   - = Decrement cursor movement value.
  1218.                   + = Increment cursor movement value.
  1219.  
  1220.  
  1221.                      Table 4-2: IMDISP Cursor Keys
  1222.  
  1223.    Cursor mode is exited by typing a "." (period) or carriage return or by
  1224. tapping the left button on the mouse.  The cursor position is retained for
  1225. future use in DISPLAY commands which use the CENTER option.  It is very
  1226. useful with large images where the entire image may be displayed using the
  1227. subsample option, then a point selected for subsequent display at full
  1228. resolution.
  1229.  
  1230.    You can specify the starting position of the cursor with the subcommands
  1231. DSL (Display Starting Line) and DSS (Display Starting Sample).  Otherwise,
  1232. the cursor starts off at the position where it was left last.
  1233.  
  1234.    Example: Type "FILE MONTAGE.IMG" followed by "DISP" to display the
  1235. MONTAGE.IMG file.  Type "CUR" to enter the cursor mode, then move the
  1236. cursor to the center of the Uranus image in the upper left corner of the
  1237. image using the up and left arrow keys.  Now type "." to exit cursor mode,
  1238. then type "DISP ZOOM 4 CENTER" which will display Uranus as a large grainy
  1239. ball on the screen.
  1240.  
  1241.  
  1242. 4.5.7 DARKEN
  1243.  
  1244.    The DARKEN command subtracts a constant value from all pixels in the
  1245. displayed image.  If no value is specified, the default is 10% of the total
  1246. range of DN values (i.e., 2 will be subtracted from all pixels in 16-color
  1247. modes, 26 will be subtracted in 256 color modes).
  1248.  
  1249.    Examples:
  1250.  
  1251.    DARKEN
  1252.    DAR 100
  1253.  
  1254.  
  1255. 4.5.8 DIR
  1256.  
  1257.  
  1258.    The DIR command is used just as the MS-DOS dir command.  Its argument is
  1259. passed to MS-DOS for execution.  At the end of the directory listing the
  1260. screen will display "Type carriage return to continue:" which will return
  1261. to the IMDISP command mode.  If there is not enough memory available for
  1262. the system command to be executed an error message is displayed.
  1263.  
  1264.  
  1265. 4.5.9 DISPLAY
  1266.  
  1267.  
  1268.    The DISPLAY command reads an image file and displays it on the the
  1269. screen.  If the image is larger than the display screen, the default mode
  1270. is to display as much of the upper left portion of the image as will fit on
  1271. the screen.  The SUBSAMPLE keyword can be used to select every 'n' lines
  1272. and samples so that representations of very large images may be displayed.
  1273. The ZOOM keyword can be used to enlarge a portion of an image on the
  1274. display screen.  Keywords can be specified to begin displaying at any line
  1275. and sample in the image with the SL (starting line) and SS (starting
  1276. sample).  If only a limited number of lines and samples are to be displayed
  1277. the NL (number of lines) and NS (number of samples) keywords can be used.
  1278. The UP, DOWN, LEFT and RIGHT keywords can be used to display different
  1279. portions of the image, relative to the currently displayed portion.  The
  1280. display can also placed at any point on the screen using the DSL (display
  1281. starting line) and DSS (display starting sample) keywords.  The FLIP
  1282. keyword displays the image from the bottom of the screen to the top, rather
  1283. than the other way around.
  1284.  
  1285.    DISPLAY takes the following keywords :
  1286.  
  1287.    buffer       displays the image in the named memory buffer
  1288.  
  1289.    SUBsample n  a positive integral subsampling factor for displaying
  1290.                 images larger than the size of the screen.  SUB=2 would
  1291.                 display an image at half the resolution.
  1292.  
  1293.    If the image lines and samples look like this:
  1294.  
  1295.                  sample values
  1296.  
  1297.         line 1      1 2 3 4 5
  1298.         line 2      6 7 8 9 10
  1299.         line 3      11 12 13 14 15
  1300.  
  1301.    Then the command DISP SUB 2 would produce:
  1302.  
  1303.                  sample values
  1304.  
  1305.         line 1      1 3 5
  1306.         line 2      11 13 15
  1307.  
  1308.    ZOOM n       a positive integral zoom factor for looking at part of an
  1309.                 image close up.  The zoom command replicates pixels by the
  1310.                 integer value specified.  If the image lines and samples
  1311.                 look like this:
  1312.  
  1313.                  sample values
  1314.  
  1315.         line 1      1 2 3
  1316.         line 2      4 5 6
  1317.         line 3      7 8 9
  1318.  
  1319.    Then the command ZOOM 2 would produce the following:
  1320.  
  1321.                  sample values
  1322.  
  1323.         line 1      1 1 2 2 3 3
  1324.         line 2      1 1 2 2 3 3
  1325.         line 3      4 4 5 5 6 6
  1326.         line 4      4 4 5 5 6 6
  1327.         line 5      7 7 8 8 9 9
  1328.         line 6      7 7 8 8 9 9
  1329.  
  1330.  
  1331.    CENTER       center the display around current cursor position.   This
  1332.                 command is very useful when displaying large images or when
  1333.                 zooming in on selected areas.  Should be used after using
  1334.                 the CURSOR command.
  1335.  
  1336.    NL n
  1337.    NS n         number of lines or samples from the image file to display
  1338.  
  1339.    SL n
  1340.    SS n         starting line or sample within the image file to display
  1341.  
  1342.    UP n
  1343.    DOWN n       adjusts the starting line up or down from the previous
  1344.                 value, thereby moving  the display window up or down in the
  1345.                 image.  The default amount to move up or down is the size
  1346.                 of the display.
  1347.  
  1348.    LEFT n
  1349.    RIGHT n      adjusts the starting sample left or right from the previous
  1350.                 value, thereby moving the display window left or right in
  1351.                 the image
  1352.  
  1353.    DSL n
  1354.    DSS n        start the image display at the specified line and sample on
  1355.                 the display screen.
  1356.  
  1357.    FLIP         flips the image top to bottom, so the image is displayed
  1358.                 from the bottom of the screen to the top.
  1359.  
  1360.    NOPrompt     displays the image without display the command line prompt
  1361.                 (COMMAND:) at the bottom of the screen.  This is to
  1362.                 accommodate screen captures of IMDISP displays.
  1363.  
  1364.    AUToset n    sets DNLO and DNHI to n% of the full range, based on the
  1365.                 histogram.  The default is 5%.
  1366.  
  1367.    NOMemory     tells IMDISP not to attempt to load the image into extended
  1368.                 memory as it displays the image.
  1369.  
  1370.    SOUrce       used to display the source file of a browse image.  The
  1371.                 source file is specified with the SOURCE_FILE_NAME and
  1372.                 SAMPLING_FACTOR keywords in the label.  The source file is
  1373.                 centered on the current cursor position in the browse file.
  1374.                 Does not work with Voyager or Viking compressed images.
  1375.  
  1376.    Examples: The user wants to display an entire Voyager image (800 x 800)
  1377. on the display screen then display a portion of the image at full
  1378. resolution.  Type "FILE MIRANDA1.LBL", then "DISP SUB 2" to display the
  1379. entire image at half resolution, Use the CURSOR command to move the cursor
  1380. to the center of an area of interest.  Exit the cursor mode by typing ".",
  1381. then type "DISP CENT" to display the selected portion of the image at full
  1382. resolution.
  1383.  
  1384.    The user wishes to place 2 images which are each 800 lines by 800
  1385. samples on the screen next to each other.  The first file is opened with
  1386. "FILE IMAGE1.IMG".  The "DISPLAY SUB 4" command is given to display every
  1387. 4th line and sample of the image to create a 200 x 200 display.  Next the
  1388. "FILE IMAGE2.IMG" command is given.  Now a "DISPLAY SUB 4 DSS 201" is given
  1389. to place the second image on the screen starting at display sample position
  1390. 201, next to the first image.
  1391.  
  1392.  
  1393.     Examples:
  1394.  
  1395.     DISP SUB 2
  1396.     DISP SUB 3 DSS 200
  1397.     DISP SUB 4 DSL 300
  1398.     DISP CEN ZOOM 2              (Use CUR first to select a center)
  1399.     DISP A                       Displays buffer A
  1400.     DISP A SUB 2                 Displays buffer A, subsampled twice
  1401.     DISP A CEN ZOOM 3            Zooms in on the center of buffer A
  1402.  
  1403.  
  1404. 4.5.10 ENHANCE
  1405.  
  1406.  
  1407.    The command ENHANCE applies a number of image processing filters to the
  1408. image.  It can either be applied to the entire image (from the input file)
  1409. or simply to the displayed portion of the image.
  1410.  
  1411.    ENHANCE takes the following subcommands:
  1412.  
  1413.      SCReen         applies the filter to the entire screen.  If this
  1414.                     option is not selected, then the filter will be applied
  1415.                     to the image last displayed with the DISPLAY command.
  1416.  
  1417.      BAAlke         applies an enhancement filter developed by Ron Baalke.
  1418.  
  1419.      CONvolution n  applies a convolution filter to the image which has the
  1420.                     effect of detecting the edges.  A 3x3 mask is used.
  1421.                     There are two variations of this filter used (n = 0 or
  1422.                     1).  Integer arithmetic is used to speed up the
  1423.                     process.  The following weighted mask is used:
  1424.  
  1425.                                -1  -1  -1
  1426.                                -1   8  -1
  1427.                                -1  -1  -1
  1428.  
  1429.      EDGe n         applies an edge enhancement filter to the image using a
  1430.                     3x3 mask.  There are four variations of this filter (n
  1431.                     = 0, 1, 2, 3).  Integer arithmetic is used to speed up
  1432.                     the process.
  1433.  
  1434.      HIGh n         applies a high pass filter to the image, which has the
  1435.                     effect of removing slowly varying changes in the image,
  1436.                     and leaving behind rapid changes.
  1437.  
  1438.      HIStogram      applies a histogram equalization filter to the image,
  1439.                     which has the effect of maximizing the contrast across
  1440.                     the whole image.
  1441.  
  1442.      LOG  n         applies a logarithmic filter to the image which has the
  1443.                     effect of enhancing the contrast in the image.  Useful
  1444.                     on dark images or on images like stars and galaxies.
  1445.                     The parameter that goes with this one is a little
  1446.                     different than the other filters, in that you specify a
  1447.                     factor (default=40) which is multiplied with the log of
  1448.                     the pixel value.  Examples:
  1449.  
  1450.      MEAn n         applies a mean filter to the image which has the effect
  1451.                     of smoothing out the image.  There are three variations
  1452.                     of this filter (n = 0, 1, 2).  A 3x3 (n=0), 5x5 (n=1)
  1453.                     or 7x7 (n=2) mask is used where the middle pixel is
  1454.                     replaced by the average of the other pixels in the
  1455.                     mask.  Integer arithmetic is used to speed up the
  1456.                     process.
  1457.  
  1458.      MEDian         applies a median filter to the image which has the
  1459.                     effect of smoothing out the image.  A 3x3 mask is used
  1460.                     where the middle pixel is replaced by the middle of the
  1461.                     nine pixels after they have been sorted.  The sort used
  1462.                     is a simple bubble sort which is terminated halfway
  1463.                     through the sort process since the median value will be
  1464.                     found by then.
  1465.  
  1466.      POWer n        modifies the pixels of the image by the following
  1467.                     equation:
  1468.  
  1469.                        newDN = numDN * (oldDN/numDN) ^ n
  1470.  
  1471.                     where n is a floating point number.  The default value
  1472.                     is 2.0.  Values less than 1.0 tend to brighten the
  1473.                     image, while values greater than 1.0 tend to darken it.
  1474.  
  1475.      STAir n        groups pixels together with the net result of smoothing
  1476.                     the image.  The default step increment is 8
  1477.  
  1478.      SMEar          applies a filter which averages the image in the
  1479.                     vertical direction.  The result is to "smear" the
  1480.                     images down the screen.
  1481.  
  1482.      UNSharp        applies an unsharp mask to the image, which has the
  1483.                     effect of enhancing edges in the image.  It is the
  1484.                     equivalent of performing a merge with 3 times the
  1485.                     original image minus 2 times the image after it has
  1486.                     been blurred with a 5x5 mean filter.
  1487.  
  1488.  
  1489.      Examples:
  1490.  
  1491.         ENH MEAN
  1492.         ENH EDGE
  1493.         ENHANCE EDGE 2
  1494.         ENHANCE BAALKE SCREEN
  1495.         ENH CON 1
  1496.         ENH SMEAR SCR
  1497.         ENH POWER .1   (similar to ENH LOG)
  1498.         ENH STAIR 2    (creates a binary 2-color image)
  1499.  
  1500.  
  1501. 4.5.11 ERASE
  1502.  
  1503.  
  1504.    The command ERASE causes the screen to be erased by setting all of the
  1505. pixels to 0, which may not necessarily be black depending on the palette
  1506. setting.  If the REFRESH option is selected, then only the refresh buffer
  1507. will be erased.  Memory buffers (denoted by letters A through Z) can also
  1508. be erased.
  1509.  
  1510.     Examples:
  1511.  
  1512.        ERA            erases the screen
  1513.        ERA REFRESH    erases the refresh buffer
  1514.        ERA A          erases the memory buffer named A
  1515.  
  1516.  
  1517. 4.5.12 EXIT
  1518.  
  1519.  
  1520.    The EXIT command exits IMDISP and returns the user to the MS-DOS
  1521. operating system.  The contents of the image display and refresh buffer are
  1522. discarded.  The single subcommand NOClear will leave the computer display
  1523. in graphics mode, and will not clear the screen.  Same as QUIT.
  1524.  
  1525.  
  1526. 4.5.13 FILE
  1527.  
  1528.  
  1529.    FILE takes just a value which is the file name.  The specified file will
  1530. be opened, or an error message issued if the file cannot be opened.  The
  1531. capability to directly address any sector on the CD-ROM disk by providing
  1532. its physical address (minute, second and sector number) is also available
  1533. to users of the Microsoft Extensions software.  There is one keyword,
  1534. NOMEMORY.  If not given, the FILE command will attempt to put the image
  1535. directly into extended memory (where the DISPLAY command will find it).  If
  1536. specified, or if the image doesn't fit into extended memory, the DISPLAY
  1537. command will read the image from disk.  FILE can now display GIF-format
  1538. images, as well.  It does this automatically if the filename extension is
  1539. .GIF.
  1540.  
  1541.    If the FILE command is specified without a filename, or with a filename
  1542. mask which contains a wildcard, the program will display a list of file
  1543. names in the current directory.  Each file name is preceded by a number.
  1544. Typing the number associated with a file name will select that file for
  1545. processing.  File names that actually represent lower level directories are
  1546. indicated with a <d> symbol after the name.  Directories can be traversed
  1547. downward by selecting the number associated with a directory name.  Upward
  1548. traversal is by selecting the item identified as PARENT DIR.  This will
  1549. move upward in the directory hierarchy.
  1550.  
  1551.    The prompt mode clears the screen and displays a menu of files (matching
  1552. the wildcard mask, if one was used) and commands.  These commands allows
  1553. specification of the default drive, a file "mask" to use in selecting file
  1554. names for display and options for moving through the list of files when the
  1555. current directory contain more than 30 files.  The top line of the display
  1556. also indicates how many files are in the current directory.  After exiting
  1557. the FILE prompt mode, the previous contents of the display screen can be
  1558. recovered by typing "REFRESH".
  1559.  
  1560.    The FILE prompt mode subcommands:
  1561.  
  1562.      D    select default disk drive
  1563.      M    specify a file selection mask to use in displaying files on the
  1564.           screen.
  1565.      N    display the next set of file names on the screen if there are
  1566.           more files in the current directory than can be displayed on one
  1567.           screen.
  1568.      P    display the previous set of file names.
  1569.      Q    quit the file selection mode and return to IMDISP command mode.
  1570.  
  1571.    The N, P and Q commands are executed immediately.  If the D or M
  1572. commands are selected, the user is prompted to enter a drive letter or file
  1573. mask.
  1574.  
  1575.    If the file selected by the "FILE filename" or FILE prompt mode has a
  1576. valid label, either PDS or VICAR2, then the number of lines and samples and
  1577. the pixel size will be displayed.  If the file is unlabeled then the
  1578. program will prompt for the values to use for the number of lines and
  1579. samples, the number of bits per pixel, and the number of header bytes.  PDS
  1580. images with detached labels can also be displayed.  The specified file
  1581. remains the current file until a new FILE command is given.  The FILE
  1582. command resets the SET DNLO and SET DNHI values to the minimum and maximum
  1583. for the pixel size (normally 0 and 255).  If a specified filename is not
  1584. found in the current directory then an error message is displayed.
  1585.  
  1586.    If the unlabeled image has a regular format, that is a uniform structure
  1587. of repeating lines and samples, the user can specify this information when
  1588. prompted by the program.  For example, an image named ASTERIA.DAT with one
  1589. 1422 byte header block followed by an image composed of 370 lines by 450
  1590. samples of 8 bit pixels would be processed as follows:
  1591.  
  1592.    At the COMMAND: prompt type "FILE ASTERIA.DAT".  The program will
  1593. display the message:
  1594.  
  1595.   Input file does not have a proper label.
  1596.   Input number of lines: 370           enter the value 370
  1597.   Input number of samples: 450         enter the value 450
  1598.   Input size of each sample: 8         enter the value 8 (bits)
  1599.   Input size of header label: 1422     enter 1422 (bytes) for the size of
  1600.                                        the foreign label block.
  1601.  
  1602.    If the size of each sample is greater than 8 bits, the program will ask
  1603. whether to swap the byte ordering or not.  16-bit integers written on Unix
  1604. or MS-DOS machines generally do not need to be swapped, while 16-bit
  1605. integers written on VAX/VMS machines generally do.
  1606.  
  1607.    The physical address of a data block on the CD-ROM can also be specified
  1608. using the syntax 'FILE "CD:mm:ss:bb"', where mm is the minute, ss the
  1609. second, and bb the sector block number of the beginning of the desired data
  1610. area.  The CD:mm:ss:nn must be in double quotes and the CD must be
  1611. capitalized!  This mechanism can be used to access files on non-High Sierra
  1612. format disks.  This will only work on systems using the Microsoft
  1613. Extensions software.
  1614.  
  1615.  
  1616. 4.5.14 HELP
  1617.  
  1618.  
  1619.    HELP displays the online help message.  If followed by the name of a
  1620. valid command the message for that command is displayed.  HELP is not
  1621. provided for MS-DOS commands (DIR, CHDIR, CD and TYPE).
  1622.  
  1623.  
  1624. 4.5.15 HISTOGRAM
  1625.  
  1626.  
  1627.    The HISTOGRAM command produces a plot showing the number of pixel values
  1628. in the image at each DN level.  The range of DN values is displayed on the
  1629. x-axis and the number of occurrences of a specific DN value on the y-axis
  1630. (See Figure 4-1).
  1631.  
  1632.    The HISTOGRAM command reads through the image, calculates the histogram,
  1633. and then displays the plot on the screen.  The histogram is scaled so that
  1634. the third highest histogram value is used as the maximum.  It is
  1635. recommended that the SUBSAMPLE or other subsetting keywords be used to
  1636. speed up histogram calculation, which can be quite slow for large images
  1637. and for images stored on CD-ROM.  Histogram plots are displayed on top of
  1638. any image currently displayed on the screen, so the user may wish to use
  1639. the ERASE command to clear the screen prior to using HISTO.  After the
  1640. histogram is displayed, the image can be restored using the REFRESH
  1641. command.
  1642.  
  1643.  
  1644.             27582 |      .
  1645.                   |      ..
  1646.                   |     ....
  1647.            COUNT  |     .....
  1648.                   |    .......
  1649.                   |    .........
  1650.                   |   ............
  1651.                   |  ...............
  1652.                    --+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1653.                    0   64   128   192   256
  1654.                             DN value
  1655.  
  1656.                    Figure 4-1: Sample Image Histogram
  1657.  
  1658.  
  1659.    By evaluating the histogram, the user can determine the optimum settings
  1660. for the SET (DNLO and DNHI) command to produce a useful display.  In the
  1661. example above, the image data are clustered between DN values 32 and 144.
  1662. Using the default settings of the EGA display mode the colors assigned to
  1663. the 2 lowest color values and the 7 highest values (representing DN values
  1664. from 0 to 31 and from 144 to 255) would not be used since the image
  1665. contains no pixels with these values.
  1666.  
  1667.    By using the "SET DNLO 32 DNHI 144" command the 16 display levels
  1668. available on the EGA display would be assigned to values between 32 and 144
  1669. rather than distributed evenly from 0 to 255, and all 16 colors would be
  1670. used in the display.
  1671.  
  1672.    HISTOGRAM takes the following keywords and arguments:
  1673.  
  1674.     SUBsample n  a integral subsample factor.  For speeding up HISTOGRAM,
  1675.                  use of "SUBSAMPLE 4" is recommended
  1676.  
  1677.     buffer       displays the histogram of the image in the named memory
  1678.                  buffer
  1679.  
  1680.     NL n
  1681.     NS n         number of lines and samples from image
  1682.  
  1683.     SL n
  1684.     SS n         starting line and sample in image
  1685.  
  1686.     CENT         perform the histogram on only the displayed portion of the
  1687.                  image.
  1688.  
  1689.    Two special keywords can be used with Voyager or Viking images on the
  1690. PDS CD-ROM disks.  These will extract histogram values stored with the
  1691. image on the CD-ROM disk and reduce the time required for the histogram to
  1692. be generated from more than 1 minute to about 3 seconds.  Note that these
  1693. commands will not work with Voyager image files in the
  1694. \PLANET\JUPITER\ATMOS directory, or with versions of system software
  1695. written before April 1987.
  1696.  
  1697.     VOY   use histogram from Voyager CD-ROM engineering data
  1698.     VIK   use histogram from Viking CD-ROM engineering data
  1699.  
  1700.  
  1701. 4.5.16 LABEL
  1702.  
  1703.  
  1704.    The LABEL command prints the labels for the currently selected image
  1705. file on the screen.  It pauses after each screen full of data, and waits
  1706. for you to press a key before displaying the next screen of data.  You can
  1707. terminate the listing by pressing the letter 'Q' to quit and return to
  1708. IMDISP.
  1709.  
  1710.  
  1711. 4.5.17 LOG
  1712.  
  1713.  
  1714.    The LOG command controls logging commands to a text file as they're
  1715. entered.  The resulting file can be used as a batch file, to repeat the
  1716. command sequence, or as a record of what operations have been performed.
  1717. The file is automatically flushed and closed when you exit IMDISP.
  1718.  
  1719.    The LOG command takes the following keywords and arguments:
  1720.  
  1721.     ON             opens a log file called IMDISP.LOG.  Commands will be
  1722.                    copied into this file until it is either closed or you
  1723.                    exit IMDISP.
  1724.  
  1725.     FILe  fname    opens a log file called fname (defaults to IMDISP.LOG).
  1726.  
  1727.     CLOse
  1728.     OFF            closes the current log file.
  1729.  
  1730. 4.5.18 MASK
  1731.  
  1732.    The MASK command is used to mask out pixels on the low or high end of
  1733. the color palette.  It is particularly userful when merging images
  1734. together.  It sets all the pixels with a DN value above or below a
  1735. specified value to a default.
  1736.  
  1737.    The MASK command takes the following keywords and arguments:
  1738.  
  1739.     LO n           sets all pixels with a DN value of n or less to the
  1740.                    default DN value of 0.
  1741.  
  1742.     HI n           sets all pixels with a DN value of n or greater to the
  1743.                    default DN value of 255.
  1744.  
  1745.     WITH n         overrides the default values for LO and HI, and sets the
  1746.                    pixels to the DN value n.
  1747.  
  1748. Examples:
  1749.  
  1750. MASK LO 20             Sets the DN values for all pixels with DN values of
  1751.                        20 or less to 0.
  1752.  
  1753. MASK LO 20 WITH 255    Sets the DN values for all pixels with DN values of
  1754.                        20 or less to 255.
  1755.  
  1756. MASK HI 200            Sets the DN values for all pixels with DN values of
  1757.                        200 or more to 255.
  1758.  
  1759. MASK HI 200 WITH 0     Sets the DN values for all pixels with DN values of
  1760.                        200 or more to 0.
  1761.  
  1762.  
  1763. 4.5.19 MENU
  1764.  
  1765.  
  1766.    The MENU command reads a file containing a list of file names and places
  1767. the user in the MENU mode, where files from this list can be selected for
  1768. display.  The MENU mode is similar to the FILE mode, except that the list
  1769. of files presented is that provided in the menu file, rather than from a
  1770. selected directory.
  1771.  
  1772.    The MENU mode can be invoked by typing "MENU filename.MNU" at the
  1773. COMMAND: prompt.  It can also be invoked on program startup by typing
  1774. "IMDISP filename.MNU" to initiate the program.  The menu file must use the
  1775. ".MNU" extension to startup IMDISP in MENU mode.
  1776.  
  1777.    Subcommands of the MENU mode are as follows:
  1778.  
  1779.    #         - Enter the number corresponding to a desired
  1780.                file name to select the file.
  1781.  
  1782.    P)revious - display the previous screen of file names
  1783.    N)ext     - display the next screen of file names
  1784.    Q)uit     - quit or exit from MENU mode
  1785.  
  1786.    After selecting and displaying an image, the user can return to the
  1787. current menu by typing "MENU" at the COMMAND: prompt.
  1788.  
  1789.    A menu file can take either of two formats.  The preferred format is a
  1790. PDS labelled table file containing file names.  A sample file is shown
  1791. below:
  1792.  
  1793. NJPL1I00PDS100000000      = SFDU_LABEL
  1794. FILE_TYPE                 = TABLE
  1795. RECORD_FORMAT             = STREAM
  1796. OBJECT                    = FILE_NAME
  1797.  TYPE                     = LITERAL
  1798.  LENGTH                   = 80
  1799. ENDOBJECT
  1800. NOTE                      = "Sample MENU file for IMDISP"
  1801. END
  1802. L:\OCEAN\SCBMEAN.IMG
  1803. L:\OCEAN\WCMEAN.IMG
  1804. L:\PLDS\TMCH01.DAT
  1805. L:\PLDS\DEM.DAT
  1806. L:\PLANET\SATURN\ATMOS\C3497355.IMG
  1807. <END OF FILE>
  1808.  
  1809.    A second abbreviated form may also be used, where only the filenames are
  1810. specified in the ".MNU" file.  In this case the file would only contain the
  1811. filenames shown after the END statement in the example above.
  1812.  
  1813.  
  1814. 4.5.20 MERGE
  1815.  
  1816.  
  1817. The MERGE command will merge buffers, images or the screen together.  A
  1818. scaling option can be provided to control the amount of merging.  If the TO
  1819. option is not used then the result will be displayed on the screen by
  1820. default.  The result can also be written to a buffer.
  1821.  
  1822.         MERGE buffer
  1823.         MERGE source1 [scale1] WITH source2 [scale2] [TO buffer] [FILE]
  1824.  
  1825. Examples:
  1826.  
  1827. MERGE A                   Merge the last displayed image with buffer A and
  1828.                           display the result back on the screen
  1829.  
  1830. MERGE A WITH B            Merge buffer A with buffer B and display the
  1831.                           result on the screen.  Since no scaling parameter
  1832.                           are specified IMDISP will default to 50% of A and
  1833.                           50% of B.
  1834.  
  1835. MERGE A WITH B TO C       Merge buffer A with buffer B and store the result
  1836.                           into buffer C
  1837.  
  1838. MERGE A WITH B -1         Subtract buffer A from buffer B
  1839.  
  1840. MERGE A .75               Merge 25% of the last displayed image with 75% of
  1841.                           buffer A, display the result on the screen.
  1842.  
  1843. MERGE A .75 with B .8     Merge 75% of buffer B with 80% of buffer B,
  1844.                           display result on the screen
  1845.  
  1846. MERGE B WITH SCREEN       Merge buffer B with the screen
  1847.  
  1848. MERGE A 3 WITH B -2 TO C FILE    Subtract twice buffer B from 3 times A,
  1849.                                  store the result in buffer.
  1850.  
  1851.  
  1852. 4.5.21 OVERLAY
  1853.  
  1854.  
  1855.    The OVERLAY command draws a lat/lon overlay grid on the displayed image.
  1856. It is intended only for use with the Ocean Data System, West Coast Time
  1857. Series CD-ROM in this program version.
  1858.  
  1859.    The OVERLAY command has the following arguments:
  1860.  
  1861.    MAXLAT   Latitude of top of image.
  1862.    MINLAT   Latitude of bottom of image.
  1863.    MAXLON   Longitude of left side of image.
  1864.    MINLON   Longitude of right side of image.
  1865.  
  1866.    LEGend   Draw a color scale with the overlay.
  1867.  
  1868.  
  1869. 4.5.22 PALETTE
  1870.  
  1871.  
  1872.    The PALETTE command is used for changing the colors assigned to
  1873. displayable color values.  This is done by modifying an internal color
  1874. table which assigns intensity values for red, green and blue to a color
  1875. value, The EGA provides 4 intensity values for each of 3 colors, so that 64
  1876. different colors can be created.  However, the EGA pixels are only 4-bits
  1877. each so only 16 color values can be used simultaneously.
  1878.  
  1879.    The palette can be modified using the EDIT command and saved and loaded
  1880. from a disk file.  The edit mode is invoked by typing PALETTE EDIT.  With
  1881. the EGA display, a bar containing 16 colors or shades will be displayed on
  1882. the bottom of the screen.  A small square will appear in the middle of the
  1883. center color box.  This indicates that this color value is currently
  1884. selected for editing.  To select another color value for editing, move the
  1885. small square to the appropriate color using either the "4" (left arrow) and
  1886. "6" (right arrow) keys on the numeric keypad or the mouse.  The "7" (Home)
  1887. and "1" (End) keys move to the beginning and end of the palette.  Pressing
  1888. the "Ctrl" key with either the "4" or "6" keys will jump the small square
  1889. left or right by 8 color bars.
  1890.  
  1891.    The color of the current color box is changed with the "R", "G", and "B"
  1892. keys (for red, green, and blue).  Upper case letters increase the amount of
  1893. the primary color, and lower case keys decrease the amount of the color.
  1894. The "8" (up arrow) and "2" (down arrow) keys increase and decrease,
  1895. respectively, the amount of red, green, and blue simultaneously.  The left
  1896. button on the mouse does the same thing.  Other commands in the palette
  1897. edit mode are the "S" and "s" commands, which will shift all colors one
  1898. value to the right or left, and the "x" command, which will exchange color
  1899. values (the color setting for color 0 becomes the setting for color 15,
  1900. while 15 replaces 0, the color setting for color 1 becomes the setting for
  1901. 14, while 14 replaces 1, etc.).  The up and down arrow keys can also be
  1902. used to cycle through the colors available in a given display mode one at a
  1903. time.  Type the "." key or carriage return to exit the edit mode.
  1904.  
  1905.    PALETTE takes the following keywords and arguments:
  1906.  
  1907.     EDIT n         to interactively adjust an n-color palette.  See edit
  1908.                    description (above) for details
  1909.  
  1910.     PSEUDOCOLOR n  PS = 0 for default EGA palette,
  1911.                    PS = 1 for gray scale palette,
  1912.                    PS = 2 or 3 for pseudo color palettes (16 levels)
  1913.                    PS = 4, ..., 9 for pseudo color palettes (256 levels)
  1914.  
  1915.     SAVE filename  saves the specified palette on disk
  1916.  
  1917.     LOAD filename  loads the specified palette from disk, if no filename is
  1918.                    specified, then list of files is displayed.  See FIL
  1919.                    command for more details.
  1920.  
  1921.     DIS            displays the current palette on the screen
  1922.  
  1923.     ERA            erases the current palette from the screen
  1924.  
  1925.     CYC  n         cycles the color palette
  1926.  
  1927.                    CYC = 0  "blinks" the palette
  1928.                    CYC = 1  blinks four times
  1929.                    CYC = 2  rotates the palette for spectacular results
  1930.                    CYC = 3  rotates and feeds in random colors
  1931.                    CYC = 4  randomizes the palette
  1932.                    CYC = 5  double rotates the palette
  1933.                    CYC = 6  random swaps of the palette
  1934.  
  1935.                    Any key will stop the palette cycling.  A 'S' or 's' key
  1936.                    will save the palette which is currently being
  1937.                    displayed, any other key will restore the palette to its
  1938.                    original colors.
  1939.  
  1940.                    CYCLE itself has two keywords.
  1941.  
  1942.                    FASt     sets the delay between changes to .1 second
  1943.                             (the default is .3).  Works best on machines
  1944.                             with fast video, where flicker is minimized.
  1945.  
  1946.                    TIMe n   runs the PAL CYCLE command for n seconds
  1947.                             (useful in batch files).
  1948.  
  1949.  
  1950.    The default palette file for LOAD or SAVE operations is IMDISP.PAL.  The
  1951. format of the default color palette when stored in a palette file is as
  1952. shown below:
  1953.  
  1954. NJPL1I00PDS000000784     = PDS_SFDU_LABEL
  1955. FILE_TYPE                = TABLE
  1956. RECORD_TYPE              = STREAM
  1957. FILE_RECORDS             = 28
  1958. TABLE_ROWS               = 16
  1959. ROW_COLUMNS              =  4
  1960. COLUMN_NAME              = (COLOR_NUMBER,                                          RED_VALUE,
  1961.                             GREEN_VALUE,
  1962.                             BLUE_VALUE)
  1963. COLUMN_TYPE              = (INTEGER,INTEGER,INTEGER,INTEGER)
  1964. END
  1965.   0   0   0   0
  1966.   1  64   0   0
  1967.   2 128   0   0
  1968.   3 192   0   0
  1969.   4 192  64   0
  1970.   5 192 128   0
  1971.   6 192 192   0
  1972.   7 128 192   0
  1973.   8   0 192   0
  1974.   9   0 192 128
  1975.  10   0 128 128
  1976.  11   0 128 192
  1977.  12   0   0 192
  1978.  13 128   0 192
  1979.  14 192   0 192
  1980.  15 192 192 192
  1981.  
  1982.    The first column of the palette table is the color value number for the
  1983. display, and columns 2, 3 and 4 represent the intensity of the red, green
  1984. and blue (respectively) primary colors on a scale of 0 to 255.  With the
  1985. EGA display these values are: 0 = off; 64 = low; 128 = medium; 192 = high.
  1986.  
  1987.  
  1988.    Examples:
  1989.  
  1990.       PAL PS 1          (Gray scale palette)
  1991.       PAL PS 7          (Built in color palette #7)
  1992.       PAL DIS
  1993.       PAL EDI
  1994.       PAL CYC 2
  1995.       PAL CYC 4
  1996.  
  1997.  
  1998. 4.5.23 PERSPECTIVE
  1999.  
  2000.    PERSPECTIVE displays the current image as a pseudo-perspective plot.
  2001. This is useful for inspecting the topography of an image - brighter areas
  2002. will seem to be raised higher than dark areas.
  2003.  
  2004.    The PERSPECTIVE command has these arguments:
  2005.  
  2006.    SL  n   displays the plot starting at line n of the image
  2007.  
  2008.    SCR     reads the image from the screen, rather than from disk (slightly
  2009.            faster).
  2010.  
  2011.  
  2012. 4.5.24 PROFILE
  2013.  
  2014.  
  2015.    PROFILE plots the DN values of pixels located along a line between two
  2016. points in the image, i.e., it creates a graph of DN value versus pixel
  2017. along the line joining the two points, CURsor mode is used to select the
  2018. two endpoints; typing "." or carriage return, or tapping the left mouse
  2019. button, selects the current cursor position as the endpoint.  After the
  2020. endpoints are selected a line is drawn between the points and the graph is
  2021. plotted at the bottom of the screen, showing the DN values on the x-axis
  2022. and the positions along the line on the y-axis.
  2023.  
  2024.  
  2025. 4.5.25 QUIT
  2026.  
  2027.  
  2028.    The QUIT command exits IMDISP and returns the user to the MS-DOS
  2029. operating system.  The contents of the image display and refresh buffer are
  2030. discarded.  The single subcommand NOClear will leave the computer display
  2031. in graphics mode, and will not clear the screen.
  2032.  
  2033.  
  2034. 4.5.26 REFRESH
  2035.  
  2036.  
  2037.    REFRESH redisplays the image plane from the refresh buffer.  When images
  2038. are written to the screen they are also written to the refresh buffer.  The
  2039. REFRESH command writes this buffer back to the screen, thereby erasing any
  2040. graphics or text overlaying the image on the screen.  The refresh buffer
  2041. contains as many lines from the display screen as there is room for in
  2042. memory.  REFRESH takes no parameters.  It can also be used after the FILE
  2043. prompt mode to redisplay the contents of the refresh buffer.  By default,
  2044. the refresh buffer is allocated from extended (XMS) memory.  If extended
  2045. memory is present, the refresh buffer is on by default.  If there isn't any
  2046. extended memory, or not enough extended memory is available, the refresh
  2047. buffer is off by default, by may be turned on to use a virtual file.  The
  2048. location of the virtual file is given by the environment variable
  2049. IMREFRESH.
  2050.  
  2051.    REFRESH is commonly used after the HELP command, or after a HISTOGRAM or
  2052. PROFILE command to remove text and plots from the display screen.
  2053.  
  2054.    The refresh buffer can be disabled/enabled with the SET command:
  2055.  
  2056.       SET REFRESH ON
  2057.       SET REFRESH OFF
  2058.  
  2059.  
  2060. 4.5.27 ROTATE
  2061.  
  2062.  
  2063.    The ROTATE command rotates the image through a specified angle.  The
  2064. entire image or just the displayed portion can be rotated.  The resulting
  2065. image can be clipped to the dimensions of the screen, if desired, and the
  2066. borders of the image filled.
  2067.                             
  2068.    ROTATE takes the following arguments and keywords:
  2069.  
  2070.    n          the angle to rotate the image through.  Must be between 0 and
  2071.               360 degrees.
  2072.  
  2073.    SCREEN     rotate the entire screen
  2074.  
  2075.    CLIP       trim off the parts of the rotated image outside the display
  2076.  
  2077.    NOFILL     don't blank out the borders of the image
  2078.  
  2079.  
  2080. 4.5.28 SAVE
  2081.  
  2082.  
  2083.    The SAVE command copies the contents of the display screen to a file.
  2084. On EGA systems the display buffer contains only 4-bits per pixel, so
  2085. specifying BP = 8 will write the 4-bit pixels in full bytes, but does not
  2086. save full 8-bit pixels even if the input image is an 8-bit image.  Use the
  2087. COPIM utility program to produce a full resolution subset of an 8-bit image
  2088. in that case.  An 8-bit display device can save an image with full 8-bit
  2089. pixels.
  2090.  
  2091.    SAVE takes the following arguments and keywords, where the filename must
  2092. immediately follow the SAVE command:
  2093.  
  2094.     filename    filename of image to save - if the extension on the
  2095.                 filename is .GIF, the file will be saved in GIF format
  2096.                 instead of PDS format.
  2097.  
  2098.     FORMAT xxx  saves the file in the specified format, where "xxx" is GIF,
  2099.                 RAW or PDS.
  2100.  
  2101.     NL n
  2102.     NS n        number of lines and samples to save
  2103.  
  2104.     SL n
  2105.     SS n        starting line and sample to save
  2106.     BP n        number of bits per pixel in output image
  2107.     REFRESH     save the displayed image into the refresh buffer
  2108.  
  2109.    Example: Save a 200 line by 200 sample area from the inner region of an
  2110. image in the file SMALL.IMG.  First use the FILE command to select and
  2111. display an input image.  Now type:
  2112.  
  2113.    "SAVE SMALL.IMG SL 100 SS 210 NL 200 NS 200"
  2114.  
  2115. to save the portion of the image beginning at line 100 and sample 210 in
  2116. the new file SMALL.IMG.
  2117.  
  2118.  
  2119. 4.5.29 SET
  2120.  
  2121.  
  2122.    SET is used set various display options.  It may be used to display and
  2123. change the DN (pixel value) range that is used to compress the pixel values
  2124. to the range appropriate for the display device.  The default, which is
  2125. reset for each new file, is the full range of DN values for the particular
  2126. pixel format (e.g.,  0 to 255 for byte).
  2127.  
  2128.    The results of a SET DNLOW or SET DNHIGH command will not take effect
  2129. until the next DISPLAY command is performed.
  2130.  
  2131.    SET can also be used to specify a file name to be used by the browse
  2132. command, change the default display resolution or change the number of
  2133. samples used to display the current image.
  2134.  
  2135.    Set takes the following keywords:
  2136.  
  2137.     DNLOW n
  2138.     DNHIGH n  where values less than DNLOW are set to color value 0, values
  2139.               greater than DNHIGH are set to the maximum color value
  2140.               available, and the color values between are assigned equally
  2141.               to the DN values between DNLOW and DNHIGH.  You can also use
  2142.               LOW and HIGH instead of DNLOW and DNHIGH.
  2143.  
  2144.     BROwse filename
  2145.               sets a file name to be used for the browse file.  This file
  2146.               name will override the default file name, which is
  2147.               'c:browse.cmd'.
  2148.  
  2149.     NS n      sets the number of samples to be used for the next DISPLAY
  2150.               command.
  2151.  
  2152.     REFresh ON
  2153.     REFresh OFF
  2154.               toggles the state of the refresh buffer on or off.  If IMDISP
  2155.               detects the presence of extended memory (XMS - managed by a
  2156.               device driver like HIMEM.SYS or QEMM), the refresh buffer
  2157.               will default to ON.  If no XMS is present, the default is
  2158.               off, and turning the refresh buffer on will cause IMDISP to
  2159.               set up a scratch file to be used as the refresh buffer.
  2160.  
  2161.     DELay ON
  2162.     DELay OFF (default)
  2163.               enables/disables the time delay before executing commands.
  2164.               Most useful when used in batch file, because it allows the
  2165.               commands to play slowly instead of as fast as possible.
  2166.  
  2167.     PROmpt ON  (default)
  2168.     PROmpt OFF
  2169.               enables/disables the display of the command names before
  2170.               execution.  Most useful when used in batch files, because it
  2171.               prevents the command prompts from appearing on the screen.
  2172.  
  2173.     DISPLAY name
  2174.               sets the current display device.  You might use this to
  2175.               change from Super VGA resolution to VGA if you wish to have
  2176.               bigger pixels for displaying images with the BROWSE command,
  2177.               for example.  To do this, you would type the command SET DIS
  2178.               VGA.  The change will take place immediately.  The current
  2179.               values for DISPLAY are
  2180.  
  2181.               CGA         (640x200x2)
  2182.               EGA         (640x350x16)
  2183.               EGA480      (640x480x16)
  2184.               VGA320      (320x200x256)
  2185.               VGA         (640x480x16)
  2186.               ATI640      (640x480x256) - ATI VGA Wonder Board (512K)
  2187.               ATI800      (800x600x256) - ATI VGA Wonder Board (512K)
  2188.               ATI1024     (1024x768x16) - ATI VGA Wonder Board (512K)
  2189.               EVGA512     (512x480x256) - Everex EV-673 Board (256K)
  2190.               EVGA640     (640x400x256) - Everex EV-673 Board (256K)
  2191.               ORCHID      (640x480x256) - Orchid ProDesigner+ Board (512K)
  2192.               ORCHID800   (800x600x256) - Orchid ProDesigner+ Board (512K)
  2193.               ORCHID1024 (1024x768x256) - Orchid ProDesigner+ Board (1MB)
  2194.               PARADISE    (640x480x256) - Paradise SuperVGA Board (512K)
  2195.                           (640x400x256) - Paradise SuperVGA Board (256K)
  2196.               PGA         (640x480x256) - PGA Board
  2197.               TRIDENT     (640x480x256) - Trident-based SVGA boards (512K)
  2198.               VESA       (1024x768x256) - VESA SVGA Interface (1MB)
  2199.  
  2200.     PALette directory
  2201.               Sets the default palette directory.  This is used with the
  2202.               PAL LOAD command.  If PAL LOAD is used with no parameters,
  2203.               IMDISP will go to the default palette directory and display
  2204.               the files there.
  2205.  
  2206.     BUFfers directory
  2207.               Sets the directory to hold the buffers as files instead of
  2208.               memory buffers.  Useful when not enough extended (XMS) memory
  2209.               exists to create the buffers.
  2210.  
  2211.    For example, using the default color palette and an EGA display with 16
  2212. color values available, the command "SET DNLO 100 DNHI 164" will assign DN
  2213. values below 100 to black and DN values above 164 to white, and spread the
  2214. 16 color values between the DN limits, thus each color value will represent
  2215. 4 DNs (value 0 = DN 100 to 103; value 1 - DN 104 to 107, etc.).
  2216.  
  2217.    If values other than the default are used then the images will display
  2218. more slowly because scaling divisions are required.  SET with no parameters
  2219. will display the current values.
  2220.  
  2221.    The DNLO and DNHI values are reset to the minimum and maximum for a
  2222. given pixel size when a FILE command is issued.
  2223.  
  2224.  
  2225. 4.5.30 SLANT
  2226.  
  2227.  
  2228.    SLANT displays the image slanted either to the left or right.  This is
  2229. done by shifting each line of the image by 1 pixel.  It is particularly
  2230. useful for finding errors in image headers.
  2231.  
  2232.  
  2233.    Examples:
  2234.  
  2235.       SLANT                (slants image to the right)
  2236.       SLANT LEFT
  2237.  
  2238.  
  2239. 4.5.31 STRETCH
  2240.  
  2241.  
  2242.    STRETCH sets the palette to a gray scale stretched between the two
  2243. specified pixel values.  Stretch is most useful on the PGA, VGA and
  2244. SuperVGA displays where 16 or more gray levels are available.  On the EGA
  2245. display the stretch command activates the gray level palette which provides
  2246. only 4 gray levels.  Use the PAL PS 0 command to return the display to the
  2247. default palette after performing a stretch.  Note that STRETCH only affects
  2248. the color look-up tables in the display hardware, rather than modifying the
  2249. pixel values as it reads the data, so it is very fast.
  2250.  
  2251.    STRETCH takes the following keywords :
  2252.  
  2253.     LOW n
  2254.     HIGh n   the low and high DN values of the stretch.
  2255.  
  2256.  
  2257.    These pixel values refer to the DN values in the current image display,
  2258. not necessarily in the original image (scaling may have been involved).
  2259. For example with the EGA display the DN values in the display range from 0
  2260. to 15, even if a byte image is being displayed.
  2261.  
  2262.    The STRETCH command is not recommended for use on EGA systems.
  2263.  
  2264.  
  2265. 4.5.32 SYSTEM
  2266.  
  2267.  
  2268.    The SYSTEM command is used to send a command to MS-DOS.
  2269.  
  2270.    For example "SYS L:" will set the L: drive as the current default drive.
  2271. If there is not enough memory available for the system command to be
  2272. executed an error message is displayed.  The SYS command will not work on
  2273. floppy disk systems unless the file "COMMAND.COM" is present on the floppy
  2274. disk with the IMDISP program.
  2275.  
  2276.    The SYSTEM command in this version of IMDISP will attempt to free as
  2277. much of memory as possible, by swapping most of the program to scratch
  2278. space.  It tries to find Extended memory (XMS), Expanded memory (EMS) or
  2279. disk space, in that order.  If it succeeds, only a small amount of IMDISP
  2280. remains in memory, leaving far more memory for DOS functions that previous
  2281. versions.  If the attempt to swap fails, the program will try to swap to
  2282. DOS with the available memory.  Currently, you must have about the same
  2283. amount of free XMS, EMS or disk space as you have memory free before
  2284. running IMDISP (i.e., IMDISP allocates all available memory to itself when
  2285. it starts, and requires that much scratch space when swapping out).
  2286.  
  2287.    The swap process, if it attempts to write out to a scratch disk file,
  2288. will use the directory specified by the environment variable IMBROWSE.  If
  2289. IMBROWSE doesn't exist, IMDISP will write the scratch file to the root
  2290. directory of drive C:.  The scratch file is deleted when you return to
  2291. IMDISP (using the EXIT command at the DOS prompt).
  2292.  
  2293.  
  2294. 4.5.33 TEXT
  2295.  
  2296.  
  2297.    The text command can be used to display a string of text on the screen.
  2298. The text string can be entered on the command line, enclosed in apostrophes
  2299. or quotes (e.g., TEXT `This is a text string').  If the text string is not
  2300. entered on the command line the program will prompt for the string to be
  2301. displayed.
  2302.  
  2303.    Once the command is issued and the text string entered the program is
  2304. placed in CURSOR mode so that the display position can be selected.  This
  2305. is done by using the arrow keys to move the cursor to the desired location.
  2306. After the position is selected, the user types a period (.) or carriage
  2307. return and the text will be written on the display screen.
  2308.  
  2309.    The TEXT command has one argument and two optional keywords.
  2310.  
  2311.    LINe      The line number to position the text at.
  2312.    SAMple    The sample number to position the text at.
  2313.    NOPrompt  Will display text without the command line prompt.
  2314.  
  2315.    'text...' The text string to be printed, enclosed in quotes or
  2316.              apostrophes.
  2317.  
  2318.    The text command writes over image data in the display and refresh
  2319. buffer, thus the underlying portion of the image is lost.
  2320.  
  2321.  
  2322. 4.5.34 TYPE
  2323.  
  2324.  
  2325.    The TYPE command is used to type the contents of a text file on the
  2326. display screen, using the standard MS-DOS type command.
  2327.  
  2328.    Its argument is passed to MS-DOS for execution.  At the end of the type
  2329. operation the screen will display "Type carriage return to continue:" which
  2330. will return to the IMDISP command mode.  If there is not enough memory
  2331. available for the system command to be executed an error message is
  2332. displayed.
  2333.  
  2334.  
  2335. 4.5.35 NEG
  2336.  
  2337.  
  2338.    The NEG command is used to invert the current color palette, turning the
  2339. image into a negative.  It takes no keywords or arguments.
  2340.  
  2341.  
  2342. 4.5.36 PLOT
  2343.  
  2344.    The PLOT command is used to draw plots of image lines and spectra on the
  2345. screen.  If the current file is an image, you must specify which line you
  2346. wish to plot.
  2347.  
  2348.    PLOT takes the following keywords:
  2349.  
  2350.     LIN n      plot line n of the image (required for 2-D files)
  2351.  
  2352.     SYMbol x   draw the plot using character x instead of connecting the
  2353.                points with a line
  2354.  
  2355.     ZOOm       prompt user to zoom in on a region of the plot after it is
  2356.                drawn
  2357.  
  2358.     OVErlay    overplot - do not erase the current plot
  2359.  
  2360.     MAX n      set the maximum y value in the plot
  2361.  
  2362.     MIN n      set the minimum y value in the plot
  2363.  
  2364.     COLor n    use DN value n to plot the data
  2365.  
  2366.     SPEctrum   analyze the plotted spectrum by doing baseline removal and
  2367.                integrating line flux.
  2368.  
  2369.   Example:  to compare lines 200 and 210 of the current image on the same
  2370. vertical scale, first plot line 200 (as a line) with the command
  2371.  
  2372.     PLOT LINE 200 MIN 0 MAX 255
  2373.  
  2374.    Now overlay the plot of line 210 using "+" signs and color 10 of the
  2375. current palette with the command
  2376.  
  2377.     PLOT LINE 210 OVERLAY MIN 0 MAX 255 COLOR 10 SYMBOL +
  2378.  
  2379.  
  2380. 4.5.37  WINDOW
  2381.  
  2382.  
  2383.    The WINDOW command lets the user define a subimage with the cursor keys
  2384. or a mouse.  The mouse button (or enter key) sets the starting point and
  2385. then the lower corner is "dragged" to the desired position.  The window
  2386. stays in effect until turned off with the CANCEL subcommand.
  2387.  
  2388.    WINDOW takes the following subcommands:
  2389.  
  2390.     CANCEL      cancels the defined window and sets commands back to the
  2391.                 full screen
  2392.  
  2393.     S1 n
  2394.     S2 n        defines the starting and ending samples of the window
  2395.  
  2396.     L1 n
  2397.     L2 n        defines the starting and ending lines of the window
  2398.  
  2399.  
  2400. 4.6 OTHER UTILITY PROGRAMS
  2401.  
  2402.  
  2403.    There are several utility programs also provided on the distribution
  2404. disk.  These programs can read PDS labeled, VICAR2 labeled, or unlabeled
  2405. images.  The output images are always written with PDS ODL labels.  The
  2406. programs prompt for the necessary input values.
  2407.  
  2408.  
  2409. 4.6.1 COPIM
  2410.  
  2411.  
  2412.    COPIM is a simple image copying program.  It can copy the whole image,
  2413. for example to put PDS labels on a foreign image), or extract a window from
  2414. the image.  It can subsample the image with an integral subsampling factor.
  2415. The program prompts for the input and output file names, the window to
  2416. extract (just type return for the whole image), and the subsampling factor
  2417. (the default is 1).  If the input file is not in VICAR2 or PDS image format
  2418. the program will also prompt for the number of lines and samples, pixel
  2419. size and header size of the image.
  2420.  
  2421.    For example, to extract the first 100 lines and samples from the file
  2422. LOGO.IMG the following commands would be used:
  2423.  
  2424.    COPIM
  2425.    Input Image: LOGO.IMG
  2426.    Lines: 350 Samples: 340 Bits per pixel: 1
  2427.    Output Image: LOGOSUB.IMG
  2428.    Starting line and sample, number of lines and samples:
  2429.    1 1 100 100
  2430.    Line Subsampling factor (1): 1
  2431.    Sample Subsampling factor(1): 1
  2432.  
  2433.  
  2434. 4.6.2 CONVERT
  2435.  
  2436.  
  2437.    CONVERT is simple pixel format conversion program.  It converts an image
  2438. to an integer (16 bits), byte (8 bits), nibble (4 bits), or binary (1 bit)
  2439. image.  It can also perform a user specified scaling.  The program prompts
  2440. for the input and output file names, the output format (must be 1,4,8, or
  2441. 16 bits), and the input and output numerical ranges for scaling.  The
  2442. default scaling values are appropriate for the data types being used.
  2443.  
  2444.    For example, to convert MONTAGE.IMG to an 8-bit per pixel image and
  2445. scale the output pixels evenly between the values of 0 and 127 the
  2446. following commands would be used:
  2447.  
  2448.    CONVERT
  2449.    Input Image: MONTAGE.IMG
  2450.    Lines : 350    Samples : 640 Bits per pixel : 4
  2451.    Output Image: MONTBIG.IMG
  2452.    Output bits per pixel (1, 4, 8, 16) : 8
  2453.    Input DN range (O 15) :
  2454.    Output DN range (O 255) : 0 127
  2455.  
  2456.  
  2457.                                  Chapter 5
  2458.  
  2459.                                   CREDITS
  2460.  
  2461.    IMDISP is maintained and updated (since version 4.4) by a small group of
  2462. volunteers -- Mike Martin, Ron Baalke (JPL) and Archie Warnock (Hughes STX
  2463. Corp).  It was originally written by Mike Martin, Frank Evans and Dan
  2464. Nakamura of the Jet Propulsion Lab.  The plotting code was originally
  2465. written by Ed Esfandari (Interferometrics).  Paradise and Trident video
  2466. drivers were added by Gregg Gunnells of the USGS.  Jerry McFaul (USGS), Ed
  2467. Grayzeck (U of MD) and Nick Beser (JHU/APL) have been valiant testers of
  2468. the program through its many iterations, and have made many suggestions for
  2469. improvements along the way.
  2470.  
  2471.    IMDISP would not have its current capabilities if it weren't for the
  2472. generous efforts of several software authors who have seen fit to donate
  2473. their work into the public domain.  Through their work, we are able to keep
  2474. IMDISP in the public domain, free to anyone who wants it.  We want to
  2475. publicly thank all of them here:
  2476.  
  2477. Gershon Elber     - GIF I/O routines (GIF_LIB.ZIP)
  2478. Michael Walraven  - High resolution timer (TIMERHI.ZIP)
  2479. Max Medley        - Mouse interface code
  2480. James Birdsall    - EMS, XMS allocation code (EMSLB215.ZIP, XMSLB121.ZIP)
  2481. Marty Del Vecchio - EMS/XMS swap routines (SWAP300.ZIP)
  2482.  
  2483.    And, of course, we would also like to thank our users, from whom we
  2484. continue to receive ideas, bug reports and fixes.  They exercise the
  2485. program in ways we never imagined.
  2486.  
  2487. GIF and 'Graphics Interchange Format' are trademarks of CompuServe,
  2488. Incorporated, an H&R Block Company.
  2489.  
  2490.  
  2491.                                   Appendix
  2492.  
  2493.                               COMMAND SUMMARY
  2494.  
  2495.  
  2496.    Within this command summary listing, brackets ([]) indicate optional
  2497. parameters or keywords.  Filename is the name of a file in the current
  2498. directory or a fully qualified filename which can include drive letter and
  2499. pathname.  Directory name is an MS-DOS directory path specification, a
  2500. valid directory mask a specification containing wild card characters (*, ?)
  2501. per MS-DOS rules for wildcard use in the DIRECTORY command.  The symbol "n"
  2502. is used to indicate an integer value.
  2503.  
  2504.   BATCH        [filename]
  2505.   BRIGHTEN     [n]
  2506.   BROWSE       [directory mask] [SIZe n] [SUB n] [NOLabel]  [DNLOw n]
  2507.                [DNHIgh n] [PAUse n] [ALL] [SELect] [FILe] [BUFFERS]
  2508.                [AUToset n]
  2509.   CD           [directory name] [..]
  2510.   CHDIR        [directory name] [..]
  2511.   COPY         [buffer [TO buffer]] [FILE]
  2512.   CURSOR       [DSL n] [DSS n]
  2513.   DARKEN       [n]
  2514.   DIRECTORY    [directory mask] [/w]
  2515.   DISPLAY      [SUB n] [SL n] [SS n] [NL n] [NS n] [BP n] [CENTer] [DSL n]
  2516.                [DSS n] [ZOOm] [FLIP] [NOPrompt] [NOMemory] [AUToset]
  2517.                [SOUrce] [CURsor] [buffer]
  2518.   ENHANCE      [BAAlke] [CONvolution n] [EDGe n] [HIGh n] [HIStogram]
  2519.                [LOG n] [MEAn n] [MEDian] [POWer n] [STAir n] [SMEar]
  2520.                [SCReen] [UNSharp]
  2521.   ERASE        [REFresh] [buffer]
  2522.   EXIT         [NOClear]
  2523.   FILE         [filename[.GIF]] ["CD:mm:ss:bb"] [NOMemory]
  2524.   HELP         [command name]
  2525.   HISTOGRAM    [SUB n] [SL n] [SS n] [NL n] [NS n] [BP n] [CENter]
  2526.                [VOYager] [VIKing] [buffer]
  2527.   LABEL
  2528.   LOG          [ON] [FILe filename] [CLOse] [OFF]
  2529.   MASK         [LO n [WITH n]] [HI n [WITH n]]
  2530.   MENU         [filename]
  2531.   MERGE        [buffer [scale] [WITH buffer [scale] [TO buffer]]] [FILE]
  2532.   NEG
  2533.   OVERLAY      [MAXLAT n] [MAXLON n] [MINLAT n] [MINLON n] [LEGend]
  2534.   PALETTE      [EDIT n] [PS n] [LOAd filename] [SAVe filename] [DISplay]
  2535.                [ERAse] [CYC n [FAST] [TIME n]]
  2536.   PERSPECTIVE  [SL n] [SCR]
  2537.   PLOT         [LINe n] [SYMbol x] [COLor n] [MAX n] [MIN n] [OVErlay]
  2538.                [ZOOm] [SPECtrum]
  2539.   PROFILE
  2540.   QUIT         [NOClear]
  2541.   REFRESH
  2542.   ROTATE       [n] [SCReen] [NOFill] [CLIp]
  2543.   SAVE         filename[.GIF] [FORmat fmt] [SL n] [SS n] [NL n] [NS n] [BP n]
  2544.                [REFRESH]
  2545.   SET          [DNLO n] [DNHI n] [BROwse filename] [DIS name] [NS n]
  2546.                [PAL dir] [REFresh ON/OFF] [DELay ON/OFF] [PROmpt ON/OFF]
  2547.                [BUFFERS dir]
  2548.   SLANT        [RIGht] [LEFt]
  2549.   STRETCH      [LO n] [HI n]
  2550.   SYSTEM       [MS-DOS command]
  2551.   TEXT         [LINe n] [SAMple n] "text" or 'text' [NOPrompt]
  2552.   TYPE         filename
  2553.   WINDOW       [CANcel] [S1 n] [L1 n] [S2 n] [L2 n]
  2554.  
  2555.  
  2556.                     MS-DOS ENVIRONMENT VARIABLE SUMMARY
  2557.  
  2558.     All of these environment variables control options for IMDISP.
  2559.  
  2560. SET IMDISP=<display-type>
  2561. SET IMBROWSE=<subdirectory>
  2562. SET IMPALETTE=<subdirectory>
  2563. SET IMREFRESH=<subdirectory>
  2564. SET IMHELP=<subdirectory and/or filename>
  2565.  
  2566.