Advanced Remote Sensing using Imagine8.4

16 Nov 00

Instructor:             Doug R. Oetter                     oetter@fsl.orst.edu                          737-8417

Login and Materials:

      This course was written for the Richardson 203 GIS laboratory computers, however, it can also be completed on your local computer by downloading the materials from the internet.

      If you are in R203, login to one of the computers using either your own Forestry Novell account or this guest configuration:

      Username = gis??          (replace '??' with the number of your computer)
      Password = <leave blank>
      Advanced/NDS tab:
            Tree = OSU
            Context = lab.FOR.ORST.EDU
            Server = Peavylab
      Advanced/WindowsNT/2000 tab:
            Name = normal
            Password = FORLAB

      The data you will need to run this workshop are in the subdirectory P:\Classes\imagine\course2.  In R203, copy this directory to C:\work.

      To access the data via the internet, first download a gzipped tar file via ftp from ftp://ftp.fsl.orst.edu/pub/gisdata/help/course2.tar.gz.  Once you download the file to a local workspace, use these commands to uncompress and extract the data directory named 'course2:'
        NT:  Use WinZip to open and extract the archive, saving it to a local directory while preserving the file structure.  The directory you create will be your working directory for this tutorial. You will find a MS Word version of this document in the workspace.
        UNIX:  Use these commands to uncompress and extract the archive:
               gunzip course2.tar.gz
               tar xvf course2.tar

Preferences:

      There is a more complete discussion of setting user preferences in the Introductory workshop, so for now we'll just make these settings in the Session/Preferences dialog:

      User Interface & Session-
            default data directory = C:\work\course2  (or your local workspace)
            output directory =   C:\work\course2  (or your local workspace)
            delete session log on exit = on
            delete history file on exit = on
      Spatial Modeler-
            data compression = run length
      User Save  (NT)  or  File/Save to v8preference/user level  (UNIX)

Import/Export:

      Start the Import/Export dialogue box from the main menu.  Imagine can import a wide variety of raster image formats.  Click the pull-down button next to Type: to see the list of data formats that Imagine can import.  The advantage to importing your data to Imagine is quick display and analysis in Imagine, especially when using Pyramid Layers.  The disadvantage is that Imagine files may not be useful to other people who can't run Imagine, especially if ERDAS goes out of business!

      The first image we'll import is an example of the latest Landsat 7 Enhanced Thematic Mapper+ data, which are delivered in Generic Binary format.  Start by opening WordPad (or another word) processor and examining these files:

     tm\tm95_4529.hdr
     tm\tm99_4629.hdr

Each of these is an example of the header file shipped with Landsat data from the EROS Data Center in Sioux Falls, SD, which is the primary source for Landsat data in the U. S.  The first file, tm95_4529.hdr, is for a Landsat 5 TM image, and the second is from a Landsat 7 ETM+ image.  For the purpose of import, the main things we are looking for are the dimensions and projection information of the generic binary image:

Variable

Landsat 4-5 TM field

Landsat 7 ETM+ field

Data format

DATA_FILE_INTERLEAVING

variable

Data type

BITS_PER_PIXEL

varies

Rows

LINES_PER_DATA_FILE

PRODUCT_LINES_XXX

Columns

PIXELS_PER_LINE

PRODUCT_SAMPLES_XXX

#Bands

NUMBER_OF_DATA_FILES

BAND_COMBINATION

Map projection

MAP_PROJECTION_NAME

MAP_PROJECTION

Map datum

HORIZONTAL_DATUM

REFERENCE_DATUM

Upper left coord.

UPPER_LEFT_CORNER

PRODUCT_UL_CORNER_MAPX,Y

Pixel size

PIXEL_SPACING

GRID_CELL_SIZE

Pixel unit

PIXEL_SPACING_UNITS

 

Landsat 7 data can be ordered in two different data formats, and each band is delivered as a separate file.  The data format and data type depend on the format and band.  For more information, see the Landsat 7 webpage.

      1.  Generic Binary Import.   For our first import exercise, we will import a subset of a Landsat 7 ETM+ panchromatic image for H. J. Andrews Experimental Forest.  Because this is a subset created in Imagine, and not a full scene, we will use a header file created by the Imagine Export process.

      In WordPad, open tm\tm99_4629_andrews_pan.hdr

      In the Import/Export dialog,
            Import
            Type = Generic Binary
            Media = File
            Input File = tm\tm99_4629_andrews_pan
            Output File = tm\tm99_4629_andrews_pan.img
            OK
      In the Import Generic Binary Data dialog,
            Data Format = BIL
            Data Type = Unsigned 8 Bit
            # Rows = 1801
            # Cols = 2268
            # Bands = 1
            OK

Once the generic binary image has been imported to Imagine, we still need to specify the map projection information in the image header:

      Session/Tools/Image Information
            Edit/Change Map Model
                  Upper Left X = 548995
                  Upper Left Y = 4913000
                  Pixel Size X = 15
                  Pixel Size Y = 15
                  Units = Meters
                  Projection = UTM
                  OK, Yes
      Edit/Add/Change Projection
                  Datum Name = NAD27
                  UTM Zone = 10
                  OK, Yes

And now the image is ready to be used in Imagine, so long as we trust using it with other images.  Even though we ordered it from the EROS Data Center, it might not be  geo-registered to match our data library.  But we won't worry about that here.

      2.  ARC/Info Grid import.   Just like the generic binary image, Grid files are raster formats, and can be easily imported into Imagine.  One major benefit in doing this is that Imagine files can be displayed much faster than Grid files.

      In the Import/Export dialog,

            Import
            Type = GRID
            Media = File
            Input File = virgis\andrews_dem30       
            Output File = virgis\andrews_dem30.img
                              (be sure to type the *.img)
            OK
            OK

The Grid layer already has map projection information written in its header, which Imagine reads and translates, so we won't have to use Image Information to assign that.

      3.  Tagged Interchange File Format (TIFF).   GeoTiff files are becoming increasing popular with many remote sensing data vendors, especially for digital orthophotographs and high-resolution data types.  Some of the most common types of data you will import are USGS Digital Orthophoto Quadrangles (DOQs); for this procedure I have prepared a special web page for the manual method (which you have to use when Imagine's canned import routine DOQ doesn't work!).  We won't tackle that technique here.  Instead, we are going to use a batch process to import six GeoTiffs of Airborne Data Acquisition and Registration (ADAR) imagery from Positive Systems, Inc.  The batch process, while complicated, can greatly improve your state of mind when you have dozens or even hundreds of TIFFs to import.

      In the Import/Export dialog,
            Import
            Type = GeoTIFF
            Media = File
            Input File = adar\61_62s.tif
            Output File = adar\61_62s.img
      OK
      In the Import TIFF dialog,
            Batch
      In the Batch Wizard,
            Modify commands automatically
            Next  (to Edit/Create Variables)
            Next (to Select Files to Process)
            Click the Select button to add files
                  Select Batch Files
                  Multiple File Selection Tab
                        Use the following Selection Pattern
                        OK
            Finish

Batch processes can be used with almost every procedure in Imagine, and offer a great deal of flexibility once you understand how they work (that's the catch!).  If you ever find yourself doing repetitive tasks, chances are you could do it easier with a batch process.

Image Contrast/Histogram Matching:

      Image display is a very important part of remote sensing.  Sometimes when displaying images, some of them just don't look very good.  Unpleasant image display can usually be attributed to an irregularity with the image pixel values, which gets reflected in the color lookup table.  The presence of clouds, for example, skews the display histogram of an image so that the unclouded portion of the image is portrayed poorly.  A few quick procedures can greatly improve the visual display, and thus greatly increase your ability to interpret the imagery.  In this section of the workshop, we will explore three techniques for improving image display.

      1.  Rebuild Statistics.       Usually the first step to fixing the display contrast of an image is to rebuild the image statistics.  This will not change any data values in the image, but it will force Imagine to re-calculate the display lookup table.  If you have an image that has a background area- a portion of the image that is included in the geographical extent of the image but doesn't have any data values- you should always 'ignore zero' when calculating statistics.  Otherwise the lookup table will be skewed to represent each of the background pixels when you would rather have the lookup table just represent your true data values.  In other situations, you might have clouds obscuring a major portion of the image, thus skewing the lookup table in the opposite manner.  When that is the case, you can recalculate the statistics for the unclouded portion of the image with an AOI.

In Viewer #1, load adar/61_64s.img   (one of the files you just imported).  Using the Quick View menu (right-hold in the viewer), Fit Image to Window.  Notice the washed-out appearance of the false-color IR image.  Open Image Information from the viewer tool bar.  Notice for band 1 (RedBand) that the minimum pixel value is 0.  And so are the median and the mode, but not the mean.  This is a good sign that the statistics were calculated without the 'ignore zero' option.  Click the Histogram button to show the file histogram.  It's difficult to see any values in the histogram.  The true values of the image are there, but they are obscured by the very large presence of the background value of zero.  Click the Statistics button and rebuild the statistics with the Ignore Value = 0.  Now you can see the detail of the true value histogram!  While you have the Image Information open, Edit/Compute Pyramid Layers to increase display speed.

Delete 61_62s.img from Viewer #1 using the Close Top Layer button, and then open it up again.  You'll notice the contrast of the image has been improved as Imagine calculated a new lookup table.  None of the pixel values of the image have changed, but the lookup table (which is saved in the image header) has been altered to improve display contrast.

      2.  Contrast Adjustment.       In the same viewer, open adar/63_64s.img with the Background Transparent option available from the Raster Options tab, and Fit Image to Window.  It also looks washed-out.  The image information will relate that it too has statistics skewed toward zero.  Rather than rebuild the statistics, which would work, let's do a contrast adjustment.

      File/New/AOI Layer (we going to use an AOI to train our contrast adjustment)

      AOI/Tools
      Digitize an AOI polygon that captures most of the area of 63_64s.img
      With the AOI selected, Raster/Contrast/General Contrast
            In the Contrast Adjust box,
                  Method = Linear
                  Histogram Source = AOI
                  Apply To = Lookup Table
                  Apply

That adjustment certainly changed things, but it's probably not what we wanted!  To see what happened, open the Breakpoint Editor by clicking on the Breakpts… box.  What we just did by applying a linear contrast adjustment was to force a linear relationship between the file histogram values and the display lookup table values, essentially a one-to-one relationship.  This means that each file pixel is displayed at its same value.  The image appears dark because the file pixels don't range all the way from 0 to 255, and the contrast is reduced for the same reason.  What we would prefer is to have the display values 'stretched' so that they range from 0 to 255, but only over the range of file values.  That way all the nonexistent file values below the file minimum are assigned a display value of 0, and all the nonexistent file values above the file maximum are assigned a display value of 255.  Simple, yes??!!

      The quick way to achieve this is to apply a Standard Deviations stretch:

      In the Contrast Adjust box,
            Method = Standard Deviations
            Standard Deviations = 2.0
            Apply


This adjustment places two 'breakpoints' where the file-to-display line is broken, so that the slope is maximized between two standard deviations below and above the mean.  When you now click Apply All, the image will look much better!  Close the Breakpoint Editor and Contrast Adjust boxes and delete the AOI layer.

      3.  Histogram Matching       When displaying several images acquired from the same source on the same day, as we are with these ADAR images, you will probably want them displayed with the same lookup table so that you can visualize real differences in data.  Load the three remaining ADAR images (83s.img, 84s.img, and 85_86s.img) into your viewer and open View/Arrange Layers.  If you didn't select the Background Transparent option each time you loaded an image, you can turn off the background quickly in the arrange layers box with a Right-hold/Transparent Background.  What we're going to do next is apply the display lookup table from one image to another, so that we are, in a sense 'matching' the display histograms.

     
      In Arrange Layers box,
            Right-hold/Breakpoints for 61_62s.img
            In Breakpoints Editor for 61_62s.img box,
                  Save…
                  In Select Save Breakpoints File box,
                        Goto… /course2/adar/
                        File name = 61_62s
                        OK
            Close Breakpoints Editor for 61_62s.img box
      In Arrange Layers box again,
            Right-hold/Breakpoints for 85_86s.img
                  Load…  61_62s.cbp      (load the Color BreakPoints file we just saved)
                  Apply All

And right away you'll notice an impr0vement in the display of the top image (85_86s.img), without having to  recalculate the statistics or manually adjust the breakpoints.  When you now click the Remove Contents from Viewer button to delete all the images from Viewer #1, Imagine will give you an opportunity to save the lookup tables you have altered so they are ready to use next time.

Mosaicking Images with Histogram Matching:

      Mosaicking, or stitching, images means to paste them together to form a single image (similar to APPEND in ARC/Info).  There are several decisions that must be made when the images you want to mosaic have overlap, such as whether to have one image overlay on the others or to merge the values somehow.  It is also important to make sure that you don't paste the background from one image on top of the true data from another.  In Imagine, the Mosaic Images procedure can also apply histogram matching so that the output image is color balanced.

      DataPrep/Mosaic Images

      In Mosaic Tool #1,
            Edit/Add Images
            In Add Images for Mosaic,
                  Double-click adar\61_62s.img

This image will be the base image to which the others will be stitched.  Because we are going to keep it on the bottom of the mosaic stack, we don't need to worry about clipping out its background, but we will need to do that for the other images.

      In Add Images for Mosaic,
            Select 63_64s.img
            Under Image Area Options,
                  Select Compute Active Area and Set…
                  In Active Area Options,
                        Boundary Search Type = Edge
                        OK     
            Add
            Select 83s.img
            Add          (edge area selection remains active)
            Repeat for 84s.img and 85_86s.img
      Close Add Images for Mosaic box

The layers in the mosaic stack can now be rearranged or deleted in the Mosaic Tool.  If you know that one of the images is of better quality or otherwise more useful than the others, you might want to put it on top of your mosaic so that its values will dominate over the others.  Under Edit/Set Overlap Function, there are five different overlap functions (Overlay, Average, Minimum, Maximum, and Feather), but we will use Overlap because it gives you the most control over the output.  To apply histogram matching to the output, choose Edit/Image Matching, and select Overlap Areas. 


      Select Process/Run Mosaic
            Output File Name = adar\adar_mosaic.img
            Stats Ignore Value = 0        (and you know why!)

Close the Mosaic Tool and save it if you want to; we'll look at the output in the next section.  The mosaic process can be one of the most intensive Imagine operations, so this might be a good time to take a break!!

Rectification/Geo-Registration:

            Image rectification, also called geo-registration, is procedure whereby one image is warped in geographic space to better match another image.  The first image, called the 'input,' is usually unrectified, either because that is how it was acquired or because you don't trust the coordinates it came with.  The second image, called the 'reference,' is the image with a geographic registration that you trust and that you want to be the basis for your image library.  Input and reference images do not have to be the same data type, however you may find it difficult to geo-register images of dramatically different pixel resolution (obviously, higher resolution images such as orthophotographs are better to work with as reference).  You'll be using a viewer for each image, and the reference viewer can hold several images, but only the top image will be considered reference.
            The rectification process involves three steps:  1) the selection of Ground Control Points (GCPs), or geographic locations that you have determined to be at the same place in both images; 2) the calculation of a mathematical model, called a transformation, to warp the source image to fit the reference; and 3) resampling the source image to fit the new geographic orientation.  There are decisions to be made at each step, and before you begin to work with real data,  you would do well to reference a text such as Lillesand, Thomas M. and Ralph W. Kiefer.  1994.  Remote Sensing and Image Interpretation.  Wiley & Sons.

      1.  GCP selection.  To locate the registration tie points (GCPs), we will use the Imagine GCP Tool:

      In Viewer #1,
      File/Open/Raster Layer tm\tm95_4529_andrews_unrec.img
            Raster Options
                  Display as = Gray Scale
                  Display Layer = 4
            OK

      Open a second viewer and display the 1999 ETM+ panchromatic image we imported above.  Because this image is only one layer, it automatically loads as grayscale.  We are going to use a grayscale display because it is easier to see spatial patterns when the display bands are similar; since the panchromatic image only has one band, we will display the 1995 TM image the same way.  The GCPs we collect and the transformation model we calculate are still applied to full 7-band image.

      Create Viewer #2,  File/Open/Raster Layer tm\tm99_4629_andrews_pan.img
      In Viewer #1, Raster/Geometric Correction
      In Set Geometric Model,
            Select Geometric Model = Polynomial
            OK

      Two boxes appear- the Polynomial Model Properties box will be used to fine-tune our transformation.  For now, just minimize it.  On the Geo Correction Tools box, select the Start GCP Editor icon to launch the GCP Editor.

      GCP Tool Reference Setup = Existing Viewer,  OK
      Click inside Viewer #2
      Reference Map Information = OK

      The GCP Tool launches an editor window and two magnifiers, and rearranges your viewers for you.  Your task now is to use the magnifiers and the viewers to place tie points in both images.  The GCP Tool will collect the Input and Reference coordinates and, when there are enough points, calculate a transformation solution.

      At this point you may want to try some of the viewer adjustment features in Imagine, for example:

      In Viewer #1,  View/Rotate
            In Rotate Image box,
            Rotation Angle = 7.5, Clockwise
            Apply, Close



      In both viewers, Fit Image to Window, and size the magnifier boxes so that you can see pixel-level distinctions in the magnifier.  Start in the middle of both images and try to find a clearcut boundary or road intersection that is the same in both scenes.  When you locate a target, use the Create GCP button to place a mark at that location in both viewers.  Repeat the procedure for at least 10 locations, ideally spread evenly throughout the input image.  After about the fourth or fifth point, the GCP Tool will begin to suggest a corresponding point for you, and all you have to do is adjust it in the other viewer.  At this point, the GCP Tool is calculating a solution for the transformation.  It may not be a good transformation, however, because you may not have enough points, or perhaps you misplaced some points.  The goal is to achieve a low Control Point Error, which is calculated in units of the input image pixel size, which for our input image is in unit pixels (ideal transformations have error < 0.5 pixels).  But this is not to say that you should purposefully mis-locate control points just to reduce the inherent error of the mathematical model- the most important thing is to have a lot of well-placed points, regardless of the model error.  After you have 10 or more points, you can adjust or delete the worse points; just click on the Point# column heading and the GCP Tool will automatically zoom to that spot.  You may want to change the display color of your points by selecting the rows and using a right-hold in the color column to select a new color.

      If you're having trouble, you can import some suggested points:

            Right-hold in the Point# column and Select None
            Shift-select the X Input, Y Input, X Ref., and Y Ref. columns
            Right-hold in the column headings and select Import
            Import From tm\points.dat, OK


      2.  Transformation model.       When you are satisfied with the placement of your ground control points (which never really happens!), you are ready to calculate a transformation model.  Re-0pen the Polynomial Model Properties box, and place it so that you can still see the Control Point Error.  For a polynomial model, you should chose among Polynomial Order.  For this exercise, we will use a first-order polynomial solution, however at other times you may want to apply second- or third-order solutions.  You can view the parameters of the solution equations by clicking the Transformation tab.

      3.  Resampling.       Once you have a transformation solution, you are ready to 'resample' an output image.  The term 'resample' is used because the output image is generally not a simple affine shift of the input image, but rather a new image created by forcing a new X-Y grid onto the warped image of the transformed input.  In other words, you have to make a bunch of rhombuses fit into grid cells.  In order to do this, each pixel must be assigned a new data value from the input image.  There are three ways to do this in Imagine:

      Nearest Neighbor-  uses the value of the closest pixel
      Bilinear Interpolation-  uses a distance-weighted average of the nearest 4 pixels
      Cubic Convolution-  uses a cubic function of a 4x4 window (16 pixels)

For most resampling procedures, nearest neighbor works best because it preserves the integrity of the original image without any smoothing effect.  For high-resolution data, however, bilinear interpolation and cubic convolution work better to preserve spatial accuracy, at the cost of processing time.

      In Geo Correction Tools, select the Display Resample Image Dialog button,
            In Resample,
                  Output File = tm\tm95_4529_andrews_utm.img
                  Resample Method = Nearest Neighbor
                  Output Cell Sizes X = 25
                  Output Cell Sizes Y = 25
                  Ignore Zero in Stats = On
            OK

Even though we only displayed band 4, the transformation will be applied to all 7 bands.  Both the control points and the transformation model can be saved- the control points are written to the header of their respective images and the model is saved as a .gms file.  Exit the geometric correction program, clear the viewers, and while you're waiting for the process to run, you may have another opportunity for a coffee break!

Reprojection:

      If you have an image that is already geo-registered to a map model and you just need to reproject it to a different map model, Imagine makes this process quite easy by automatically generating a grid of control points to construct a transformation solution.  All you need to do is select a grid density and polynomial order (first-order is generally sufficient for recti-linear map projections, whereas reprojections involving geographic projections (i.e., units in Lat./Long.) require second-order).

      Let's reproject the ADAR mosaic we made above from Stateplane to UTM projection so that we can overlay it on the 1995 TM image we just resampled:

      Open adar\adar_mosaic.img in Viewer #1
      Notice the projection in the viewer status bar (State Plane/GRS 1980)
            Raster/Geometric Correction
            In Set Geometric Model,
                  Select Geometric Model = Reproject
                  OK
            In Reproject Model Properties,
                  Projection tab, Add/Change Projection
                  In Projection Chooser,
                        Projection Type = UTM
                        Datum Name = NAD27
                        UTM Zone = 10
                        OK
            In Geo Correction Tools, select the Display Resample Image Dialog button,
            In Resample,
                  Output File = adar\adar_mosaic_utm.img
                  Resample Method = Nearest Neighbor
                  ULX = 559335               (round to the nearest meter)
                  LRX = 563000
                  ULY = 4897896
                  LRY = 4895154
                  Output Cell Sizes X = 1
                  Output Cell Sizes Y = 1
                  Ignore Zero in Stats = On
                  OK

Once the resampling is finished, clear the viewer and load tm\tm95_4529_andrews_utm.img, and then adar\adar_mosaic_utm.img with transparent background.  Use Utility/Flicker to turn the ADAR image on and off on top of the TM image.  You should be able to see not only the difference in spatial resolution of these images, but the problems that creates for geo-registration!

Image Interpreter Tools:

      The bulk of the work in Image takes place in the Image Interpreter module.  These tools feature pre-developed routines to perform several common tasks.  We will not explore them all in this workshop, but you will undoubtedly find many useful tools here.  For more help with these routines, see the Imagine Field Guide or the On-Line Manual.

      Spatial Enhancement- Use these procedures to highlight or suppress spatial patterns such as spectral peaks, valleys, and edges, or to create a texture image.

      Radiometric Enhancement-  These functions allow you to alter the pixel values of a continuous image to improve display or remove haze, noise, and bad lines.

      Spectral Enhancement- This module contains many tools which calculate spectral transformations of continuous imagery, including Tasseled Cap, NDVI, and other indices.

      Hyperspectral Tools- Hyperspectral such as AVIRIS contains up to hundreds of data bands, each acquired from a very narrow range in the electro-magnetic spectrum, and these special tools are designed to work with such data sets.

      Fourier Analysis- These tools apply a sort of sine wave approximation to image variation, which to the trained image magician can be useful in recognizing spatial patterns and correcting noisy images.

      Topographic Analysis- Use these features to calculate slope, aspect, and shaded relief images, as well as to perform a viewshed analysis.

      GIS Analysis- This module contains several procedures useful for working with thematic images, such as filtering, recoding, and matrix queries.

      Utilities- Several common procedures are included here, especially subset, layer stack, and arithmetic functions.

Spatial Modeler:

      The spatial modeler is a graphical modeling tool.  Launch the tool by clicking the Modeler icon on the main tool bar, and then selecting Model Maker.  The modeler allows you to construct your own image processing procedures, which can be either quite simple or terrifyingly complex.  Some example models are provided in the \models directory:

      compress.gmd- perhaps the simplest model possible, this procedure is used to apply Run-Length Compression to an image that does not already have it, since for some reason Imagine doesn't provide a compression utility.  In order for it to work, you must have Preferences/Spatial Modeler/Data Compression set to run length.  After that, all you have to do is a pass an image through Spatial Modeler and the output is compressed.

      6to1.gmd- This is a spatial form of the Layer Stack routine for stacking 6 bands into 1, which is useful for combining the individual bands of a Landsat 7 generic binary import.

      background_drop.gmd- This model was used to delete an image background that had values of 255 in each of three bands (instead of zeros).  It uses a simple conditional statement to move the target pixels to zero; otherwise, they retain the same value.

      L5_bgw_scaled.gmd- This version of the Landsat 5 Tasseled Cap transformation model is different from the Imagine routine in Image Interpreter/Spectral Enhancement because it only outputs the first three bands (brightness, greenness, wetness) and allows for better histogram scaling control.

To learn more about the opportunities for using Spatial Modeler, you should read the On-Line Manual and take advantage of the View Model button on most of the pre-programmed Imagine routines.  There are some pretty impressive examples in M:\Win32\IMAG84\etc\models\ (NT) or /tools/erdas83/840/etc/models/ (UNIX).

The Signature Editor:

      A spectral signature is a description of a collection of image pixels in n-dimensional space (where n = # of bands).  Essentially, a signature is the collection of means and variances of the pixels you select in their spectral space.  In Image, the Signature Editor allows you to manipulate these signatures.

      Open the Signature Editor from the Classifier icon on the main tool bar.  The Signature Editor is a powerful tool for collecting and analyzing spectral properties for selected groups of pixels in an image.  It is used for image classification and spectral analysis.  You start by associating an editor with a continuous image, and then you use AOIs or thematic layers to select pixels for analysis.  We're going to use a signature editor with a polygon vector coverage to 'train' a supervised classification of the 1995 Landsat TM image of H. J. Andrews.

In Signature Editor,
      Edit/Image Association
      In Set Associated Image, select tm\tm95_4529_andrews_utm.img
In Viewer #1, open tm\tm95_4529_andrews_utm.img
Open vector coverage veg\plantcom w/plantcom.evs

This coverage portrays HJ Andrews plant community associations from 1993.  The metadata are in the file veg\plantcom.txt.  The attribute that we'll be using is VCODE, which is a numerical code for plant communities.  The symbology file lumps the classes into:

      Firs (AB): maroon
      Douglas-fir (PSME): dark green
      Western hemlock/fir (TS-AB): green
      Western hemlock (TSHE): turquoise
      Meadows/shrubs (M/SH): tan

We're going to use this plant association map to collect spectral signatures from the TM image beneath it in the viewer, and then analyze those signatures in the Signature Editor.

      Vector/Attributes

      In Attributes for …/veg/plantcom,
            Right-hold in the Record column, Criteria
                  In the Selection Criteria box, create this expression to select Abies polygons:
                  $"VCODE" == 1 or ($"VCODE" >= 3 and $"VCODE" <= 7)
                  or $"VCODE" == 18 or $"VCODE" == 20
      In Viewer #1,
            AOI/Copy Selection to AOI
            AOI/Tools
            Use the Box Select AOI tool to select all the AOIs you  just created
      In the Signature Editor, select the Create New Signatures from AOI button
            Right-hold in the Class # column, Select All
            Click the Merge Selected Signatures button
            Right-hold in the Class # column, Delete
            In the Signature Name column, Rename 'Class62' to 'AB'

What you've just done is used a criteria expression to select 61 polygons in the vector coverage which are associated with Abies plant communities, then you made an AOI out of those polygons and collected the spectral signatures from each polygon in the signature editor, and then merged them all into one signature which contains the spectral information for all 27,524 pixels in the TM image which are considered Abies.  Whew!!

      It's usually a good idea to save the signature editor at this point so that you don't have to go through it all again when it bombs!

      File/Save signature as veg\tm95_plantcom.sig

To repeat the process for the next plant type, return to the viewer and delete the AOI without saving.  Then to select the Douglas-fir class from the Selection Criteria box,

      Criteria = $"VCODE" == 2 or $"VCODE" == 8
      AOI/Copy Selection to AOI
      Box Select AOI
      Create New Signatures from AOI
      Select the new signatures and Merge Selected Signatures
      Delete those signatures
      Rename 'Class 20' to 'PSME'

Repeat the procedure for:

      TS-AB:    $"VCODE"  >= 9 and $"VCODE" <= 11
      TSHE:     $"VCODE"  >= 12 and $"VCODE" <= 17
      M/SH:     $"VCODE"  == 19

Now that you've collected the signatures you need, you can begin to analyze them.  Start by changing the color of the merged signatures to those listed above by clicking the color box for each signature.

      In Signature Editor,
            Change the 'Value' column to 1-5             (this will simplify things later)
            View/Columns

            In View Signature Columns box,
                  Statistics
                  In Column Statistics box,
                        Mean
                        Close
                  Apply
                  Close

This adds seven columns to the Signature Editor which display the mean values of each merged signature for each TM band.

      View/Mean Plots

This opens a graphical display of the mean plots.  Click the Multiple Signature Mode button to display all the signatures.  Guess what?? There's not a lot of difference between the mean plots of the signatures we gathered.  The only thing that stands out is the Douglas-fir in band 4.  We would not be able to do much with these data.  The reason for this is because we weren't very selective in choosing our training information; it pays to have a well-developed, accurate, and thorough training data set!

Feature Space:

      Another way to view the data is in Feature Space, which is a way of making a two-dimensional graph to examine spectral variation in multi-band images.  A feature Space graph shows two bands at a time, so that you can peer into the spectral data from a variety of viewpoints.

      In Signature Editor,
            Feature/Create/Feature Space Layers
            In Create Feature Space Images,
                  Input Raster Layer = tm95_4529_andrews_utm.img
                  Output Root Name = tm95
                  Output To Viewer = On
                  Select FS Image #12    (Layer 3 in X; Layer 4 in Y)
                  OK

Imagine creates a new viewer with a feature space that represents the pixel frequency of the TM image, with band 3 values in the X-axis and band 4 values in the Y-axis.  The origin is in the lower left corner.  Resize the viewer and fit the image to screen.  You can now plot the mean values of your collected signatures into the feature space to see how well they separate:

      In Signature Editor, select all five signatures
            Feature/Objects
            In Signature Objects box,
                  Viewer = 2
                  Plot Ellipses = On
                  Std. Dev. = 1.00
                  Plot Means = On
                  OK

In the feature space viewer, each signature will be plotted in its color with a mean (+) and a ellipse representing one standard deviation.  Zoom in so that you can see them.  The fact that all the ellipses seem to overlap is not a good sign.  Again, had we used better developed training plots, we would have seen better separation.  When you're ready Close Viewer #2 and the Objects box.

Supervised Classification:

      When you do have a good training set that is representative of the entire landscape and spatially distinct, a quick way to construct a classified image from continuous input is with a Supervised Classification.  In this process, the signatures you select will be used to define starting points within the spectral space of a continuous image, and each pixel in the image will then be assigned to one of the signatures (classes) according to Euclidean distance or some other algorithm.  If you have good training data which covers all the classes on the landscape, it can produce very good results.

In Signature Editor, select all five signatures
      Classify/Supervised
      In Supervised Classification box,
            Output File = tm95_super.img
            OK

In Viewer #1, load the result of your supervised classification.  The class colors are the same as the vector coverage you used to train it.  Use Utility/Flicker to flash the supervised classification on and off.

Accuracy Assessment Tool:

      Imagine features an accuracy assessment tool that can help you quickly generate random points to help assess your classification accuracy.  It allows you to blindly evaluate the true ground condition of these points from reference imagery, coverages, or field data, and then cross-tabulate the results with your classified image predictions.

      With tm95_super.img in Viewer #1,
      Classifier/Accuracy Assessment
            In Accuracy Assessment box,
                  File/Open tm95_super.img
                  Edit/Create/Add Random Points
                  In Add Random Points box,
                        Number of Points = 100
                        Distribution Parameters =
                              Stratified Random
                        Select Classes…
                        In Raster Attribute Editor,
                              Select rows 1-5
                  OK
            View/Select Viewer, click Viewer #1
            View/Show All

One hundred random points have been generated.  The 'Stratified Random' option generates points in the same frequency proportion as the image classes, so that the large classes have more points.  Had you selected 'Equalized Random,' an equal number of points would have been generated in each classes; this can be troublesome if you have an under-represented class.  If you want to delete the points and start over, just Select All in the row headings and Delete.  When you're satisfied with the points, select File/Save Table.  Just like the GCP points, Imagine writes these points to the file header.

      Initially, the Class values are hidden in the Accuracy Assessment tool.  This is so you can conduct a blind collection of reference points.  You can display the values by selecting Edit/Show Class Values.  You may get your reference from field plots, photo or image interpretation, or some other magical method of knowing what is actually on the landscape.  For this example, we're going commit a Big No-No and use the same plantcom polygon coverage that we used to train our supervised image as testing reference.  Normally you would have keep your testing reference independent.

      In Accuracy Assessment box, with no rows selected,
            Select X and Y columns
            Right-hold/Export to veg\tm95s_aa100.dat
      Main menu/Vector/ASCII to Point Vector Layer
            In Import ASCII File to Point Coverage
                  Input ASCII File = veg\tm95s_aa100.dat
                  Output Point Coverage = veg\tm95s_aa100
                  OK
                  In Import Options box, OK
      Main menu/Vector/Build Vector Layer Topology
            In Build Vector Layer Topology box,
                  Input Coverage = tm95s_aa100
                  Feature = Point
                  OK

We now have a point coverage based on the accuracy assessment points.  We'll use this to query the plantcom coverage VCODE value for the polygon that each assessment point is associated with.

      In Matrix,
            Thematic Image/Vector #1 Browse button
                  In Thematic Image/Vector #1 box,
                        Files of type = Arc Coverage
                        Select  veg\tm95s_aa100
                        OK
                  Vector Type = Point    
                  Use Attribute As Value = On
            Thematic Image/Vector #2 Browse button
                  In Thematic Image/Vector #2 box,
                        Files of type = Arc Coverage
                        Select  veg\plantcom
                        OK
                  Vector Type = Polygon          
                  Use Attribute As Value = On
                  Select VCODE
            Output File =
                  veg\plantcom_aa100.img
            Ignore Zero in Stats. = On
            Data Type/Output = Unsigned 16 bit
            Output Cell Size = 25.00

The output of Matrix is an Imagine file where each pixel is queried for all possible combinations of the input attributes, in this case the presence of an assessment point and the VCODE of plantcom.  We chose unsigned 16-bit data and a cell size of 25 m to reduce file size and processing time.  Had you accepted the defaults, the process could have taken hours to complete.  We knew that 16-bit data was ideal because (100 points X 23 VCODEs) = 2300 possible combinations, which is > 256 (the limit of 8-bit) and < 65,536 (the limit of 16-bit).

      To use the output of Matrix, we need to first recode the VCODE values into the broad associations we created above:

VCODE

Plant Community

Output Class

1,3-7,18,20

Firs (AB)

1

2,8

Douglas-fir (PSME)

2

12-17

Western hemlock/fir (TS-AB)

3

9-11

Western hemlock (TSHE)

4

19

Meadows/shrubs (M/SH)

5

In Viewer #1, open veg\plantcom_aa100.img
      Raster/Attributes
      In Raster Attribute Editor,
            Change Opacity for Row 0 (background) to 0
            Edit/Column Properties
            In Column Properties
                  Select Columns = plantcom value
                  Title = VCODE
                  New
                  Editable
                  Title = Reference
                  OK
            Right-hold in Row, Criteria
            In Selection Criteria box,
                  Criteria = $"Histogram" != 0
                  Select      (selects all the bins with values; should be 100)
            Set Color = BLUE
            In Selection Criteria box,
                  Criteria = $"VCODE" == 1 or ($"VCODE" >= 3 and $"VCODE" <= 7)
                  or $"VCODE" == 18 or $"VCODE" == 20
                  Select      (selects all the VCODES for AB)
            Select Reference column
            Right-hold in column heading, Formula
            In Formula box
                  Formula = 1
                  Apply
            Repeat the process with these parameters:
                  Criteria = $"VCODE" == 2 or $"VCODE" == 8
                  Formula = 2
                  Criteria = $"VCODE"  >= 9 and $"VCODE" <= 11
                  Formula = 3
                  Criteria = $"VCODE"  >= 12 and $"VCODE" <= 17
                  Formula = 4
                  Criteria = $"VCODE"  == 19
                  Formula = 5

Now that you have a column with the recoded values of VCODE:

                  Criteria = $"Histogram" != 0
            Right-hold in the column heading, Copy
      In Accuracy Assessment,
            Select Reference column
            Right-hold in column heading, Paste

There should be a value for each point.  If there's not then there might be a chance that two of the assessment points were so close together that they shared a cell in the Matrix image.  If that's the case then you would need to find which of the points was missing a pixel and manually include it before you copy the Reference column.  You can now close the Raster Attribute Editor for plantcom_aa100.img.

      Now you can then use the Accuracy Assessment table generate reports.  Just choose Report/Accuracy Report and Imagine will generate an output form.  Alternatively, you could export the Class and Reference columns to a data file and use them in a spreadsheet.

Other features:

      There are many other features of Imagine that we will not have time to fully explore.  Here are just a few:

      Session/Configuration- Used to set up printers and tape drives
      Session/Active Process List- Used to kill runaway processes (usually the viewer) from within Imagine
      Session/Batch- Manage and execute batch files created by scripts or the Batch Wizard
      Session/Tools/Coordinate Calculator- Converts X,Y coordinates in one map projection to another
      Session/Utilities/Convert Pixels to ASCII- Exports band-by-band values for each pixel in a subset of an image or as set by a point coverage.
      Catalog- Allows cataloging and archiving of images
      Classifier/Knowledge Engineer- A new feature that combines raster and vector inputs with rules and hypotheses in a decision tree to allow expert classification that is replicable across data sets.



      Virtual GIS-  This remarkable feature of Imagine8.4 allows you to represent landscapes in three dimensions and even move around in virtual landscapes with a flight path simulator.  You'll need to read the On-Line Manual for a full appreciation of its abilities, but for now you can take a quick tour in the \virgis directory.  If you can, open the Virtual GIS Project file \virgis\andrews.vwp.  If that doesn't work for you, you can add the digital elevation model from that directory (andrews_dem30.img) and add to it tm\tm95_4529_andrews_utm.img and the vector coverages in \virgis.

Getting more help:

      With its release of Imagine8.4, ERDAS has done the best job yet of letting people learn how to use its software.  The On-Line Help is available from Session/Help/IMAGINE On-Line Documentation or from the Help button in most dialogs.  In addition, you can refer to the Imagine8.3 Tour Guides and ERDAS Field Guide (ask at the helpdesk or look in FSL345) and the Forest Science Research Network GIS/RS helpdesk web page <http://www.fsl.orst.edu/helpdesk/gis/>.