This tutorial provides basic information about ENVI and some suggestions for your initial investigations of the software. It is designed to introduce first-time ENVI users to the basic concepts of the package and to explore some of its key features. It assumes that you are already familiar with general image-processing concepts.
You must have the ENVI TUTORIALS & DATA CD-ROM mounted on your system to access the files used by this tutorial, or copy the files to your disk.
The files used in this tutorial are contained in the CAN_TM subdirectory of the ENVIDATA directory on the ENVI TUTORIALS & DATA CD-ROM.
The files listed below are required to run this exercise.
CAN_TMR.IMG, Boulder Colorado TM Data
CAN_TMR.HDR, ENVI Header for Above
ENVI uses a graphical user interface (GUI) to provide point-and-click access to image processing functions (Figure 1). You select menu choices and functions using a three-button mouse.
When you start ENVI, the ENVI Main Menu appears in the form of a button menu bar. Clicking with the left mouse button on any of the Main Menu buttons brings up a menu of options, which may in turn contain submenus with further options. The choices selected from these submenus will often bring up dialog boxes that allow you to enter information or set parameters relating to the ENVI function you have selected.
Note that most menus in ENVI windows and dialog boxes appear as buttons. Often the button label changes to reflect the currently-selected menu option.
ENVI uses a generalized raster data format consisting of a simple "flat binary file" and a small associated ASCII (text) header file. This file format permits ENVI to use nearly any image file, including those that contain their own embedded header information.
Generalized raster data is stored as a binary stream of bytes in either Band Sequential (BSQ), Band Interleaved by Pixel (BIP), or Band Interleaved by Line (BIL) format.
BIP format provides optimal spectral processing performance. Images stored in BIP format have the first pixel for all bands in sequential order, followed by the second pixel for all bands, followed by the third pixel for all bands, etc., interleaved up to the number of pixels. This format provides optimum performance for spectral (Z) access of the image data.
ENVI supports a variety of data types: byte, integer, long integer, floating-point, double-precision floating-point, complex, and double-precision complex.
The separate text header file provides information to ENVI about the dimensions of the image, any embedded header that may be present, the data format, and other pertinent information. The header file is normally created (with your input) the first time a particular data file is read by ENVI. You can view and edit it at a later time using the Edit ENVI Header function under the ENVI File menu. You can also generate ENVI header files outside ENVI, using a text editor, if desired.
As you work with ENVI, a number of different windows and dialog boxes will appear on your screen. These allow you to manipulate and analyze your image. The most important of these displays is a group of three windows that display your image, allow you to move around in it, and allow you to magnify different areas. This group of windows is collectively referred to as the "Display group" (Figure 2). The Display group consists of:
You may have any number of displays open on the screen at any time. There are a wide variety of other types of ENVI windows you may work with, including scatter plots, spectral profiles and spectral plots, and vector windows.
The ENVI Main Display Window has its own internal menus, which provide access to interactive display and analysis functions (Figure 3). For uncluttered viewing, these menus do not appear automatically; you must call them up by pressing the right mouse button while the mouse pointer is inside the window. Once the window menu is on screen, you can select options from it as you do from any other ENVI menu. These window-specific menus are dismissed from the window by pressing the right mouse button again - not by clicking on the "Cancel" button, which closes the window entirely.
ENVI provides access to both image files and to the individual spectral bands in those files. The Available Bands List is a special ENVI dialog that contains a list of all the available image bands in all open files (Figure 4).
Use the Available Bands List to load both color and gray-scale images into a display by entering the display number, clicking on the appropriate radio button, then selecting the desired bands from the list by clicking on the band name(s).
The File button on the menu bar at the top of the dialog provides access to file opening and closing, file information, and the Cancel button. The Options button provides a function to find the band closest to a specific wavelength, and allows toggling between full and shortened band names in the list.
This section of the tutorial will take you on a step-by-step tour of ENVI's basic functions.
Before attempting to start the program, ensure that ENVI is properly installed as described in the installation guide.
The ENVI Main Menu appears when the program has successfully loaded and executed.
To open an image file:
Note that on some platforms you must hold the left mouse button down to display the submenus from the Main Menu.
An Enter Input Data File file selection dialog appears.
The Available Bands List dialog will appear on your screen. This list allows you to select spectral bands for display and processing.
Note that you have the choice of loading either a grayscale or an RGB color image.
The band you have chosen is displayed in the field marked "Selected Band:".
When the image loads, an ENVI image display will appear on your screen. The display consists of a Main window, a Scroll window, and a Zoom window (See Figure 2 above). These three windows are intimately linked; changes to one window will be mirrored in the others. To get a feel for how the display windows interact, try the following:
The Zoom factor is shown in parentheses in the Zoom window title bar. Note that as the zoom factor changes, so does the size of the zoom indicator box in the Main window.
A red box in the Scroll window indicates what portion of the entire image is currently displayed in the Main window. You can move the selected area by clicking inside the scroll indicator box with the left mouse button and dragging the box to a new position. The displays in the Main and Zoom windows are updated when you release the mouse button. You can also reposition the scroll indicator box by clicking at the desired location using the middle mouse button as for the Zoom window above.
You can resize the display windows the same way you would resize windows in other applications, by dragging any of the corners. Note, however, that you cannot make the Main window larger than the image size. If the Main window is large enough to display the entire image, the Scroll window is unnecessary and is automatically removed from your screen. The Scroll window reappears if the Main window is resized smaller than the full image.
ENVI has many interactive functions, and the mouse button combinations and actions are different for each one. The Mouse Button Descriptions dialog is provided to tell you what the mouse buttons do in each graphics window.
Now whenever your cursor is in an ENVI display or graphics window, the mouse button assignments will be listed in this dialog. MB1 is the left mouse button, MB2 is the middle mouse button, and MB3 is the right mouse button.
A dialog box will appear displaying the location of the cursor in the Main, Scroll, or Zoom windows (Figure 5). The dialog also displays the screen value (color) and the actual data value of the pixel underneath the cross-hair cursor.
X (horizontal), Y (vertical), and Z (spectral) profile plots can be selected and displayed interactively. These profiles show the data values across an image line (X), column (Y), or spectral bands (Z).
A red cross-hair extends to the top and bottom and to the sides of the Main window. The red lines indicate the line or sample locations for the vertical or horizontal profiles.
Interactive Contrast Stretching plots a histogram and allows you to interactively control the contrast of the displayed image. Many different types of stretches can be applied. By default, a linear 2% stretch is applied to the data when it is first displayed.
A dialog that allows you to change the contrast stretch of the displayed image appears (Figure 7). Two histogram plots display the color or grayscale range of the input image (left) and the output image after contrast stretching (right). Initially, the input and output histograms reflect the default stretch applied to the data when the image was displayed.
When images are loaded into the Main window, a 2% linear contrast stretch is applied by default.
Note the red and green vertical lines in the input histogram plot--these bars can be repositioned to control the minimum and maximum value used in the contrast stretch.
Numbers above the plot display the current data value, the number of pixels and the percentage of pixels that have that value, and the cumulative percentage of pixels with values less than or equal to the current value.
The red and green bars will be adjusted and the two text entries updated to display the data values at 4% and 96%, respectively.
You can plot the data values of two selected image bands versus each other in a scatter plot to graphically display the overlapping values.
A dialog will appear that lets you choose two image bands to compare.
2. Select one band for the X axis and another band for the Y axis and click "OK."
It may take a few seconds for ENVI to extract and tabulate the data values.
Pixel values contained in a ten-pixel by ten-pixel box surrounding the crosshair will be highlighted in red on the scatter plot. Again, note that the Mouse Button Descriptions dialog can help you know the functions of the different mouse buttons in the Scatterplot.
You can also use the scatter plot to highlight specific data values in the Main window.
A ten-pixel-square box will appear in red on the plot. Pixels with the values contained in the box are highlighted on the image in the Main window as "Image Dancing Pixels".
ENVI gives you the ability to apply several different pre-defined or user-defined filters to a display (file-based filtering is also available and is accessed via the Filter menu on the ENVI main menu). The following example shows you how to apply a pre-defined filter to the image in the Main display window.
Link the two displays together to compare the filter results. When you link two displays, any action you perform on one display (scrolling, zooming, etc.) is echoed in the linked display. To link the two displays you have on screen now:
ENVI's Multiple Dynamic Overlay feature allows you to dynamically superimpose parts of one or more linked images onto the other image. Dynamic overlays are turned on automatically when you link two displays.
A small portion of the linked image will be superimposed on the current image window. The overlay will appear in either the Main window or the Zoom window.
ENVI lets you define "Regions of Interest" (ROIs) in your images. ROIs are typically used to extract statistics for classification, masking, and other operations.
Select further border points in sequence by clicking the left button again, and close the polygon by clicking the right mouse button.The middle mouse button deletes the most recent point, or (if you have closed the polygon) the entire polygon.
When you have finished defining an ROI, it is shown in the dialog's list of Available Regions, with the name, region color, and number of pixels enclosed (Figure 10).
ROIs can also be defined as polylines or as a collection of individual pixels by selecting the desired ROI type from the ROI_Type pulldown menu. See the ENVI User's Guide or the hypertext online help for further discussion of these types of ROI.
You can define as many ROIs as you wish in any image (Figure 10).
Region Of Interest definitions are retained in memory after the ROI Definition dialog is closed, unless you explicitly delete them. This means the ROIs are available to other ENVI functions even if they are not displayed.
ENVI's flexible annotation features allow you to add text, polygons, color bars, and other symbols to your plots and images.
The Annotation dialog allows you to choose from a variety of annotation types. Different types are selected from the Object menu and include Text, Symbols, Rectangles, Ellipses, Polygons, Polylines, Arrows, Map Scale Bars and Declination Diagrams, Map Keys, Color Table Ramps, and Images. By default, the Annotation dialog starts up with "Text" selected. Other fields in the dialog let you control the size, color, placement, and angle of the annotation text. When you select different annotation types from the menu, the fields in the dialog change to display options appropriate to the new type.
Try placing a text annotation in your Main window:
Your text will be displayed in the window at the point you chose (Figure 12).
To edit an annotation element that has already been "fixed" on the image:
This allows you to use the scroll and zoom features in your display without losing your annotations.
Leave your annotation on the Main window image as you complete this tutorial.
Try adding a grid to your image (Figure 13):
An image border is automatically added when you overlay grid lines.
ENVI gives you several options for saving and outputting your filtered, annotated, gridded images. You can save your work in ENVI's image file format (Figure 20), or in several popular graphics formats (including Postscript) for printing or importing into other software packages.
To save your work in ENVI's native format (as an RGB file):
The Output Display to Image Parameters dialog will appear.
If you have left your annotated and gridded color image on the display, both the annotation and grid lines will be automatically listed in the graphics options.
You can also select other annotation files to be "burned in" to the output image.