Previous ENVI User's Guide: Interactive Display Functions Next

Annotating Images

Use Annotation to add text, symbols, polygons, lines, polylines, shapes, map information, and grayscale or color bars to images and plots. For classification images, add class keys. Annotation options are similar for images, plots or surface views. Annotations can be saved to files and included in output options.

Annotation can be placed in the Image window, the Scroll window, the Zoom window, or the virtual borders of an image.


Tip
Use ENVI's QuickMap feature to quickly overlay grid lines, titles, declination diagrams, North arrows, and borders on georeferenced images. For details, see Creating QuickMaps.

Figure 4-3: Example Annotation in an ENVI Display Group

Figure 4-3: Example Annotation in an ENVI Display Group


Note
To use virtual borders, append the border to the image prior to annotating the image (see Setting Virtual Display Borders).

  1. Select one of the following options:
    • From the Image window menu bar select Overlay  Annotation.
    •  

    • In any plot, including surface plots and X, Y, or Z profiles, select Options  Annotation.

     

  2. In the Annotation dialog, select Object  desired annotation type.
  3.  


    Note
    Text annotation is the default mode.

The function of each annotation type is described in the following sections.

Positioning Annotations

  1. In the Annotation dialog, select the Main, Scroll, or Zoom window toggle button.
  2.  


    Note
    Normal mouse operations in the selected window are disabled. However, normal mouse operations still apply in the other windows. To temporarily suspended annotation, select the Off toggle button. All normal mouse operations are again possible in all windows.

     

  3. Position annotation objects by left-clicking at the desired site on the image. Refer to the following table for specific mouse button and positioning functions.
  4.  

  5. Use the colored diamond-shaped handle to place the annotation at the desired location. (The handle appears on all annotation types.)
  6.  

  7. After the annotation is positioned, click the right mouse button to fix the object at that location on the image. The diamond-shaped handle disappears after the annotation is fixed.
  8.  

    Table 4-1: Mouse Button Assignments for Annotation

    Table 4-1: Mouse Button Assignments for Annotation
    Action
    Mouse Button
    Interaction
    Where
    Position current
    annotation
    Left
    Click and release
    At desired location
    Move current annotation
    Left
    Click, hold, and drag handle
    Throughout image
    Delete current annotation
    Middle
    Click and release
    Anywhere in image
    Fix current annotation
    and proceed to the next
    annotation operation
    Right
    Click and release
    Anywhere in image
    Prepare to reselect fixed
    annotation
    Left
    Click and pull down menu
    Object  Selection/Edit
    Reselect annotation
    Left
    Click and drag to draw box
    Around annotation object corners
    Suspend annotation (all
    normal functions are
    returned)
    Left
    Click
    Off toggle button
    Resume annotation
    (normal functions
    suspended)
    Left
    Click
    Image, Scroll, or Zoom toggle button

Setting Virtual Display Borders

Use Set Display Borders to append a virtual border to an image. You can place any type of annotation object in the border.

  1. Select Options  Display Borders.
  2.  

  3. When the Display Borders dialog appears, enter the desired border width (in pixels) for the left, top, right, and bottom image border in the text boxes with the same relative position.

The image is re-displayed with the designated virtual border.


Note
You can also add Virtual Borders using the Available Bands List (see Options in the Available Bands List).

Changing Snap Factors

In the Annotation dialog, set the snap factor to use for placing your annotations. The snap factor causes any annotation located within the specified snap distance (in pixels) to snap to the same pixel location. A snap factor of 1 (the default) specifies placing the causes annotation exactly at the selected location.

  1. In the Annotation dialog, select Options  Set Snap Value.
  2.  

  3. In the Set Snap Value dialog, use the increment arrows to select a value or enter the value in the Snap text box.
  4.  

  5. Click OK.

Burning Annotation into Images

To burn the annotation into an image when it has been placed:

  1. In the Annotation dialog, select the Off toggle button.
  2.  

  3. From the Image window menu bar, select File  Save Image As  Postscript File (see Display Output Options).

Selecting Annotation Object Types

In the Annotation dialog, use the Object pull-down menu to select from the various annotation object types. Text, symbols, shapes, map information, and color ramps are available as annotation objects. Each object has its own annotation options and are described in more detail below.

Working with Text Annotation

  1. In the Annotation dialog, select Object  Text.
  2.  

  3. Enter text by typing it in the text box at the bottom of the window.
  4.  

    More than one line of text may be entered at once.

     

  5. Select from the following specific options to change the text characteristics.
  6.  


    Note
    The text characteristics do not change in the dialog. To see the changes, click in the Image window, but do not fix the annotation in place until you are satisfied with the appearance of the text.

    • To change text color, click on the Color drop-down button and select the desired color.
    •  

    • To place the text on a solid colored background, use the Back drop-down button to select a color; to place the text directly on the image without a background (this is the default), select Off.
    •  

    • To adjust the thickness of the text, enter a new thickness value in the Thick textbox or use the increment arrows to change the value in the Thick parameter box.
    •  

    • To change the text font, click the Font drop-down button and select a font. For more information on fonts, see Using Other TrueType Fonts with ENVI.
    •  

    • To change the size of the text (in pixels), change the value or use the arrow increment buttons in the Size parameter box.
    •  

    • To change the orientation of the text on the screen (the angle at which it is written), enter the value of the angle in degrees (counterclockwise, with respect to the horizontal [0 degrees]) in the Orien parameter box or toggle the arrow increment buttons.
    •  

    • To center the text or justify it left or right, choose the appropriate option under the Align drop-down button.

     

  7. Position and fix the annotation as described in Positioning Annotations.

Working with Symbol Annotation

  1. In the Annotation dialog, select Object  Symbol. The available symbols display in the selected font in the window at the bottom of the dialog. Individual characters in text fonts can also be selected using the Symbol option.
  2.  

  3. Select the desired font or symbol set from the Font menu.
  4.  


    Note
    The fonts labeled Misc, Special, and Math show some of the standard symbols available in IDL.

     

  5. Click the left mouse button on the desired symbol. When selected, the symbol is highlighted in red.
  6.  

  7. Select from the options described in "Working with Text Annotation" to change the color, line thickness, etc.
  8.  

  9. Position and fix the annotation as described in Positioning Annotations.

Working with Polygon Annotation

  1. In the Annotation dialog, select Object  Polygon.
  2.  

  3. Choose from the methods below to draw the polygon.
    • Use the left mouse button (see the following table) to set the vertices of the polygon. Line segments (polygon sides) are drawn between the selected points. Or, draw the polygon by holding down the left mouse button while drawing.
    •  

    • To delete the last segment drawn, press the middle mouse button.
    •  

    • To close the polygon, press the right mouse button. A handle (a small diamond) appears.
    •  

      Table 4-2: Polygon Annotation 

      Table 4-2: Polygon Annotation 
      Action
      Mouse Button
      Interaction
      Where
      Choose Polygon
      vertices
      Left
      Click and release
      At desired location
      Delete Polygon
      vertices (while
      drawing)
      Middle
      Click and release
      Anywhere in image
      Close Polygon
      Right
      Click and release
      Anywhere in image
      Position
      completed
      polygon
      Left
      Click and drag
      On the handle
      Move polygon
      vertices
      Left
      Click and drag
      Near or on vertex
      Delete polygon
      Middle
      Click and release
      Anywhere in image
      Fix current
      annotation
      Right
      Click and release
      Anywhere in image

     

  4. Select from the following options to change or adjust the polygon attributes.
    • To change the polygon color, select from the Color menu.
    •  

    • To change the thickness of the polygon border (and fill if line-fill is chosen), enter a value in the Thick parameter box.
    •  

    • To change the outline line style (solid, dashed, dotted, etc.), click the Line Style menu and select the desired style.
    •  

    • To change the orientation of the polygon on the screen, enter the angle in degrees (counterclockwise) at which to display the polygon with respect to horizontal (0 degrees) in the Rotation parameter box. The Rotation value is always reset to 0 after it has been changed.

     

  5. Use the Fill drop-down button to set the fill attributes.
    • To leave the polygon unfilled, select None.
    •  

    • To fill the polygon with the polygon color, select Solid.
    •  

    • To fill the polygon with equally spaced lines, select line, dashed, dotted, etc.
    •  

    • To change the orientation of the fill lines, enter the value of the angle in degrees (counterclockwise, with respect to the horizontal [0 degrees]), in the Orien parameter box.
    •  

    • To change the spacing of the lines, enter a value in the Spc parameter box.

     

  6. Position and fix the annotation as described in Positioning Annotations.

Working with Polyline Annotation

  1. In the Annotation dialog, select Object  Polyline.
  2.  

  3. Use the methods described in Working with Polygon Annotation to draw polylines.
  4.  


    Note
    The right mouse button is used complete a line, but does not close line segments into a polygon.

     

  5. Select from the options described in Working with Polygon Annotation to change polyline attributes. The options color, line style, thickness, and rotation are available.
  6.  

  7. Position and fix the annotation as described in Positioning Annotations.

Working with Shape Annotation

Use Rectangle or Ellipse to annotate with geometric shapes.

  1. From within the Annotation dialog, select Object  Rectangle or Ellipse.
  2.  

  3. Click and drag with the left mouse button to draw the shape.
    • To draw a circle, hold down the control key while drawing an ellipse, or draw the circle using the middle mouse button.
    •  

    • To draw a square, hold down the control key on the keyboard while drawing a rectangle, or draw the square using the middle mouse button.
    •  

    • To set or change the size of the shape, grab a corner, an edge, or an axis end point (ellipse) and press and hold down the left mouse button while dragging to the desired size. The size can also be explicitly changed by entering the desired X and Y sizes (in pixels) in the text boxes labeled xsize: and ysize:.
    •  

    • To delete the shape, press the middle button.
    •  

    • To fix the object, press the right button as described in Table 4-2.

     

  4. Select from the options described in Working with Polygon Annotation to change shape attributes.

Working with Arrow Annotation

  1. In the Annotation dialog, select Object  Arrow.
  2.  

  3. Select from the following steps to draw the arrow.
    • To draw an arrow, click and drag with the left mouse button.
    •  

    • To change the size and orientation, grab an end and press and hold down the left mouse button while dragging to the desired size. The size of the arrow head can also be changed by entering a new value into the Head Size parameter box.
    •  

    • To delete the arrow, press the middle mouse button.
    •  

    • To control the angle of the lines (in degrees) defining the arrow head, enter a value in the Head Angle parameter box.
    •  


      Note
      Entering smaller angles makes a narrower arrow head and larger angles makes a wider head.

     

  4. Select from the options described in Working with Polygon Annotation to change arrow attributes.
  5.  

  6. Press the right button to fix the location and characteristics of the arrow when it has been formatted.

Working with Scale Bar Annotation

  1. From within the Annotation dialog, select Object  Scale Bar.
  2.  


    Note
    If the data is not georeferenced, enter a value when the Image Pixel Size dialog prompts you for the image pixel size in meters.

     

  3. Select from the following steps and options to position and change the scale bar.
    • To position a scale bar in the image, press the left mouse button.
    •  

    • To delete a scale bar, press the middle mouse button.
    •  

    • To select which units of the scale bar to draw, set the arrow toggle button to On when the desired units are shown in the Scale drop-down list. A scale bar can be drawn in any combination kilometers, miles, meters, and feet.
    •  

    • To change the spelling of the scale bar titles, click Change Scale Bar Titles and edit the spelling of the titles.
    •  


      Note
      You can permanently change the spelling of the titles used for scale bar annotation by editing the envi.cfg file (see The ENVI Configuration File).

       


      Note
      When more than one of the unit types is set to On, multiple scale bars are drawn.

       

    • To set the height of a scale bar, in pixels, enter the desired value in the Height parameter box.
    •  

    • To change the scale bar length, enter the desired length, in scale bar units, in the Length parameter box.
    •  

    • To change the number of increments shown on the scale bar, enter the number in the Inc parameter box and the number of sub-increments within the first main increment in the Sub Inc parameter box. The length, increment, and sub-increment parameters are formatted for each type of scale bar individually.

     

  4. Set the scale bar text attributes by selecting from the options described in Working with Text Annotation.
  5.  

  6. Press the right mouse button to fix the scale bar position and characteristics.
  7.  

    Figure 4-4: Scale Bar Annotation

    Figure 4-4: Scale Bar Annotation

Working with Color Ramp and Grayscale Ramp Annotation

Use Color Ramp to place a wedge or color table on the image. The color table or wedge represents the currently applied ENVI color table. For a grayscale image the color ramp is a grayscale wedge from the minimum grayscale value to the maximum grayscale value. For a color image, the color ramp shows the distribution of the selected color palette.

Figure 4-5: A Grayscale Ramp Annotation.

Figure 4-5: A Grayscale Ramp Annotation.

  1. In the Annotation dialog, select Object  Color Ramp.
  2.  

  3. Select from the following steps and options to position the ramp.
    • To position the color ramp, click the left mouse button at the desired location.
    •  

    • To delete the ramp, press the middle mouse button.
    •  

    • To orient the ramp either horizontally or vertically, select from one of the following (A or B) by clicking on the pull-down menu initially labeled Horz :
    •  

    • For horizontal orientation, select Horz  (horizontal from low values to high values left to right) or Horz (horizontal from high to low left to right).
    •  

    • For vertical options select Vert (vertical from high to low bottom to top) or Vert  (vertical from low to high bottom to top).

     

  4. Select from the following options to change the color ramp characteristics.
    • To define the ramp width and length, enter the desired value in the parameter boxes labeled Width and Len.
    •  

    • To place labels on the ramp, enter the minimum and maximum values in the Min and Max parameter boxes.
    •  

    • To automatically enter minimum and maximum values calculated from the data into the Min and Max parameter boxes, click on the Calculate Min/Max button, then select the band from which to calculate the values. The minimum and maximum values are entered into the parameter boxes and can be edited, if desired.
    •  

    • To define the increment (number) of labels to place on the ramp, enter the value in the Inc parameter box.
    •  

    • To set the label precision (the number of significant figures), enter the number in the Precision parameter box. For example, 0.25 is a precision of 2, and .03 is a precision of 1. Labels are placed at the bottom of horizontal ramps and placed to the right of vertical ramps. Set Label attributes by selecting from the options described in Working with Text Annotation.

     

  5. Press the right mouse button to fix the color ramp when it has been positioned and formatted.

Working with Map Key, Class Key, and Vector Key Annotation

A map key consists of colored squares and corresponding labels for each map item or class in a classification image. Map keys can be defined interactively and are automatically created as class keys for classification images. Vector keys are automatically created for vector layers in the appropriate colors with the layer names as labels. Vector keys show the vector symbol used for points, a line for polylines, and a square outline for polygons.

  1. In the Annotation dialog, select Object  Map Key.
  2.  

  3. Click the left mouse button at the desired location to position the map key.
  4.  


    Note
    To delete the map key, press the middle mouse button.

     

  5. Click Edit Map Key Items to define or change items in the map key.
  6.  

  7. When the Map Key Object Definition dialog appears, select from the list of Key items.
    • To add additional items to the list, click Add Item.
    •  

    • To delete an item, highlight it in the list and click Delete Item.
    •  

    • To change the name of the item, enter the new name in the Object Name text box.
    •  

    • To define the color of the box, select the desired color using the Color menu.
    •  

    • To add additional colors, enter the DN values in the R, G, and B, text boxes for red, green, and blue respectively. The newly defined color appears as black in the image but is correct upon output.
    •  

    • To change the fill type in the box, use the Fill menu.
    •  

    • To control the fill type, use the Orien and Spc parameter boxes.
    •  

    • For vector keys, an Object Type drop-down button is included and has polygon, polyline, and point selections.
    •  

    • For a vector polygon item, use the Fill drop-down button and Orien and Space parameter boxes to select the polygon fill type.
    •  

    • For a vector polyline item, use the Line Style drop-down button to select different line styles.
    •  

    • For a vector point item, use the Symbol menu to select the symbol type to show in the key.

     

  8. Follow these steps to change other parameters within the Annotation dialog.
    • To set a background color select the desired color from the Back pull-down menu in the Annotation dialog.
    •  

    • To change the text font for the key, the size, and the thickness of the letters, select from the options described in Working with Text Annotation.
    •  

    • To change class colors, see Mapping Class Colors for detailed instructions.
    •  

      Figure 4-6: Vector Key Annotation

      Figure 4-6: Vector Key Annotation
Saving Map Key Annotation
  1. In the Map Key Object Definition dialog, click Save.
  2.  

  3. At the prompt, enter an output filename.
  4.  

    ENVI writes the key to a file. Map key files should be saved with the file extension .key for consistency, but may be saved using other extensions at your discretion.

Restoring Saved Map Key Files
  1. In the Map Key Object Definition dialog, click Restore.
  2.  

  3. Select the desired input file.

Working with Declination Diagram Annotation

Use the Declination option to place a declination diagram on the image. The declination diagram includes any combination of arrows pointing to true north (shown with a star), grid north (GN), and magnetic north (MN).

  1. In the Annotation dialog, select Object  Declination.
  2.  

  3. Click the left mouse button at the desired location to position the declination diagram.
  4.  


    Note
    To delete the declination diagram, press the middle mouse button.

     

  5. Select from the following steps to change the attributes of the declination diagram.
    • To set the angle of the north arrows, enter the values in degrees in the True North, Grid North, and Magnetic North text boxes.
    •  

      The angles are not drawn to scale so that the arrows appear separated.

       

    • To set the arrow length in pixels, use the Length parameter box.
    •  

    • To change the color of the declination diagram, select from the Color drop-down button.
    •  

    • To set the background color, select from the Back menu.
    •  

    • To change the text font for the key, the size, and the thickness of the letters, select from the options described in Working with Text Annotation.
    •  

    • To change the line and text thickness, enter a value in the Thick parameter box.

     

  6. Press the right mouse button to fix the position and characteristics of the declination diagram when it has been formatted.
  7.  

    Figure 4-7: A Declination Diagram Annotation

    Figure 4-7: A Declination Diagram Annotation

Working with Image Annotation

Use Image to place other images, such as imported logos or subsampled images, inside the current image. Do not confuse this option with mosaicking (see Image Mosaicking).


Tip
Annotation needs to keep a copy of the image in memory so it is not advised to use large images.

  1. In the Annotation dialog, select Object  Image.
  2.  

  3. Click Select New Image.
  4.  

  5. When the Annotation Image Input Bands dialog appears, select an RGB or grayscale file from the Available Bands List within the dialog. The R, G, and B text boxes are filled.
    • To select a grayscale image, click on the same filename for all three bands.
    •  

    • To select a spatial subset, click Spatial Subset. For subsetting details, see Selecting a Spatial Subset.
    •  

    • To perform spatial resampling of the data, enter a resize factor into the Resize Factor text box.
    •  

    • To clear the filenames in the R, G, and B text boxes, click Reset.

     

  6. Click OK to return to the Annotation dialog and position the image inset.
  7.  

  8. Left-click at the desired location to position the image.
  9.  

    To delete the image, click the middle mouse button.

     

  10. Right-click to fix the image at that location.

Working with Plot Annotation

Use Plot to overlay an ENVI plot on your image.

  1. Select Object  Plot.
  2.  

  3. Click Select New Plot.
  4.  


    Note
    If only one plot window is open, that plot is automatically selected.

     

  5. When the Select Plot window appears, select the name of a plot by clicking on it. If you have multiple plot windows opened with the same name, they appear listed in the order in which they were opened.
  6.  

  7. Enter or select the xsize and ysize in the Select Plot window, if desired.
  8.  

  9. Click OK.
  10.  

  11. Place the plot on the image by clicking with the left mouse button, dragging to the desired location, and clicking the right mouse button to fix the annotation in place.

The annotation appears in the image as a red box of the correct size entitled Plot as shown in the following figure, but the plot annotation appears correctly in the output file.

The plots remain as vectors when burned in to the image if you output it to postscript or a printer.

Figure 4-8: Plot Annotation

Figure 4-8: Plot Annotation


Note
Plot objects do not appear in the image if output to an image file.

Annotating Multiple Plots

Use a test image to annotate and output multiple plots on a single page.

  1. From the ENVI main menu bar, select File  Generate Test Data and create a blank white image (see Generating Test Data for further details).
  2.  

  3. Place the plot annotation on the blank image using standard annotation procedures.

The plot colors are automatically reversed to black on white for output.

Working in Selection Mode

Use Selection to move and change the attributes of annotation objects that are fixed in the image.

  1. Select Object  Selection/Edit.
  2.  

  3. Select Options  Show Object Corners.
  4.  

  5. Click and drag with the left mouse button to draw a box around the corner of the object in order to select it.
  6.  

  7. Click the left mouse button on the handle and drag the object to a new location.
  8.  

  9. Change the object's attributes by entering the new parameters in the Annotation dialog.

Selection options are:

Additional options are available for selected annotation objects under the Selected menu (see Annotation Options).

Annotation Options

In the Annotation dialog, use the Selected or the Options menu to access annotation options. Options available when working with annotation objects include undoing the last action, joining polygons, swapping the positions of overlapping objects, duplicating or deleting annotation objects, adding virtual borders to an image, turning annotation mirroring on and off, and showing or hiding annotation object corners.

Selecting All Annotation Objects

To select all annotation objects, select Selected  Select All.

Joining Polygons

Use the Join option to join the overlapping parts of two polygons.

  1. Select two polygons to join.
  2.  

  3. In the Annotation dialog, choose Selected.
  4.  

  5. Next choose Join.

The underlying polygon's vertices are changed to match those of the overlying polygon.


Tip
Better results are obtained for polygons that have many vertices (for example, those drawn while holding down the left mouse button). Use the Swap option (see the next section) to bring a polygon to the top.

Swapping Annotation Objects

Use Swap to bring an underlying object to the top.

  1. Select the objects to swap.
  2.  

  3. Select Selected  Swap.

Duplicating Annotation Objects

Use Duplicate to duplicate existing Annotation objects instead of re-creating them.

  1. Select the objects to duplicate.
  2.  

  3. Select Selected  Duplicate.
  4.  

  5. Position the duplicate objects by dragging the handle to the desired location with the left mouse button.

Deleting Annotation Objects

To delete selected objects, select Selected  Delete.

To delete all of the annotation objects within the image, select Selected  Delete All.

Undoing Annotation Changes

To undo the changes made to a selected objects, select Selected  Undo.

The undo applies only to the last change made. After a new change is applied, selecting Undo applies to the latest change, etc.

Mirroring Annotation

Use mirroring with rectangles, ellipses, polygons, and polylines only. It is primarily designed for you to build custom filters for FFT filtering (see Defining FFT Filters).

To mirror shapes and polygons around the center of the image, select Options  Turn Mirror On.

To turn off the mirroring, select Options  Turn Mirror Off.

Showing Object Corners

Use object corners to make it easier to include corners in the selection box while in Selection mode. Object corners can be shown around all annotation objects except the vectors (rectangle, ellipse, polygon, polyline, and arrow). The corners are plotted as small asterisks around the annotation object.

To show object corners, select Options  Show Object Corners.

To hide object corners, select Options  Hide Object Corners.

Managing Annotation Files

Use the File menu in the Annotation dialog to save and restore annotation files.

Saving Annotations to Files

  1. In the Annotation dialog, select File  Save Annotation.
  2.  

  3. When the new dialog appears, enter the output filename in the text box, or click Choose and enter or select a filename.
  4.  

  5. Select OK to save the annotation to an output file.
  6.  

    Annotation files are saved with the file extension .ann for consistency, unless changed to other extensions at your discretion.

Restoring Saved Annotation Files

  1. Select File  Restore Annotation.
  2.  

  3. When the file selection window appears with all .ann files listed by default, select the appropriate annotation file for ENVI to load and display.

Hiding the Annotation Dialog

To hide or show the Annotation dialog without erasing your annotations, see Showing and Hiding Overlay Dialogs and Layers.

Closing the Annotation Dialog

To close the annotation dialog and remove all the annotation objects from the display, select File  Cancel.

If the annotations in the display have not been saved, an ENVI question dialog appears asking you if you want to save the file.

  ENVI Online Help (August 12, 2005)