Getting Started with OpenDragon

Preparing to Use This Tutorial

The page gives you step-by-step instructions for doing various types of image analysis using OpenDragon. Before you can try this tutorial, you need to do the following:

  1. Download and install OpenDragon on your computer.
  2. Download the zip file DemoPix.zip. This holds additional sample images that are referenced in the tutorial.
  3. Unzip this file and put the contents into the same directory where you installed the Sample images that come with OpenDragon. If you accepted the default values during the OpenDragon installation, this will be the directory images under the main OpenDragon system directory.
  4. With this tutorial open in your browser, start OpenDragon and follow the instructions in each section below.

The zip file also includes a description of its contents, as well as the contents of the OpenDragon Samples data set.

As you use this tutorial, remember that you can see the OpenDragon online manual any time that you have questions. To display the Manual Reader, choose Help->User Manual. If you have already selected an operation, the Manual Reader will display information about that particular operation. Otherwise, it will display the first chapter, which provides general information on using OpenDragon.

Displaying Images

Display a gray scale image

  1. Choose the Display->Gray menu item.
  2. Enter Bangkok_AsterR.img for the image to display. (Click on the downpointing arrow or press F3 to bring up a file selection box.)
  3. Click on the OK button to display the image. (You can choose which window to display the image in by selection viewport 0 or 1 before clicking OK.)

Try the same process with some other images, for instance SanFr3.img, grfld1rr.img, etc.

You can make the image brighter or darker by changing the Histogram Adjustment parameter. Choose No Stretch to make the image darker. Choose Gaussian or Equalization to make the image brighter.

Display a color composite image

A color composite image combines information from several different bands, assigning one band to blue, one to green and one to red. If the wavelengths of the bands assigned match the assignments (i.e. if an image that indicates reflected red light is assigned to the red channel), the image will show up in natural color. A common combination is to assign a near infrared band to the red band. This produces a so-called "false color composite" where vegetated areas show up in bright red.

To display a natural color image:

  1. Choose the Display->3 Band menu item.
  2. Enter lamtaklong_110103_200103_b1.img for the Blue image.
  3. Enter lamtaklong_110103_200103_b2.img for the Green image.
  4. Enter lamtaklong_110103_200103_b3.img for the Red image.
  5. Click the OK button.

You can display a false color composite of the same image.

  1. Choose the Display->3 Band menu item.
  2. Accept the default values for the Blue image and the Green image. "=B" means use the same data as for the last displayed composite.
  3. Enter lamtaklong_110103_200103_b4.img for the Red image.
  4. Change the viewport selection to "1" by clicking the radio button.
  5. Click the OK button.

The new image will be displayed in the second viewport. Notice how areas that were green in the first composite are red in the second composite.

There are many sets of multiband images available in the sample data. See the image documentation file for more information.

Display a classified image

Classified images are single band images where each pixel represents a code or category instead of a measurement. They can be displayed using artificial color assignments that help make different classes more visible.

To display a classified image:

  1. Choose the Display->1 Band menu item.
  2. Enter mekdmdm.img as the image to display.
  3. Select Viewport 0
  4. Click the OK button.

You can put a legend on the classified image by doing the following.

  1. Choose the Display->Annotation->Legend menu item.
  2. Enter the image coordinates where you want the legend to display (e.g. 100 400).
  3. Click on OK. The legend will be displayed on the image. The class names are stored in the image file; you can edit them using the Utility->Header operation (but please do not do this on the demonstration machines).

If you want to see the original data used to create this classified image, display a three band composite of mek14-1.img, mek14-2.img and mek14-3.img in the other viewport.

Enhancing Images

Enhancing edges

Filtering can be used to remove noise (smoothing filter, median filter) or to enhance various features of an image. You can create an image in which linear features are much more visible. To do this:

  1. Choose the Enhance->Filter menu item.
  2. Enter Bangkok_AsterG.img as the image to filter.
  3. Choose Edge for the Kernel type parameter
  4. Click on the OK button

The resulting image shows the streets and other linear features much more clearly than the original. You may want to display the original image in gray in the other viewport, to compare the results.

Locating vegetated areas

A vegetation index is a mathematical combination of bands that helps distinguish vegetated areas from other areas. To calculate a vegetation index, do the following:

  1. Choose the Enhance->Vegetation menu item.
  2. Enter SanFr5.img as the image to use for Band 1.
  3. Enter SanFr2.img as the image to use for Band 2.
  4. Click on the OK button

Areas that are bright are areas with dense vegetation. You may want to display a color composite of this image in the other viewport (bands 2, 3 and 5 for blue, green and red) in order to check the results.

Classifying Images

The sample data set contains several sets of signatures which you can use to try out the OpenDragon supervised classification operations.

For example, choose Classify->Supervised->Maximum Likelihood. For the signature file, choose SanFranTest.sig. Select the images SanFr1.img, SanFr2.img, SanFr3.img and SanFr4.img for the four bands to classify. When you click on OK, OpenDragon should display a table showing how many pixels were assigned to each class, and then the results as a classified image. Use Display->Annotation->Legend to see which colors correspond to which classes.

You may also want to experiment with the Classify->Unsupervised->Clustering operation.

You can use the operations under Classify->Edit Signatures to view signature statistics and histograms.

Vector Operations

The Geometry menu includes operations that let you measure lines and areas on an image. It also includes the Vectors operation, which you can use to display vector features (polylines and polygons) overlaid on an image, and to create new vectors.

Show existing vectors

  1. Display a three band image of pathum2.img, pathum3.img, and pathum5.img (blue, green, red).
  2. Choose the Geometry->Vectors menu item.
  3. For the Reference Image File parameter, enter =C, which means, use the last composite image as a background.
  4. For the Apply Vector File parameter, enter PathumLines.vec
  5. You can enter a vector file to create if you wish.
  6. Click on the OK button.

OpenDragon will display the composite image. Then after a few moments, it will display a set of vectors: blue lines for canals and rivers, yellow lines for roads. You can then create new vector features. Follow the instructions that appear in the status area at the bottom of the viewport.

You may want to repeat the operation above using PathumPolygons.vec as the Apply Vector File.

Using Mask Images

You can use mask images, that is, images which have non-zero values in the area of interest and zeros elsewhere, to control processing and select areas to include or exclude. The sample data include two mask images, LamtaklongLandMask.img and LamtaklongWaterMask.img. The first has the reservoir area set to zero. The second has everything but the reservoir area set to zero. Both images were derived from the flood-period image of Lamtaklong Reservoir.

Mask overlay to assess the drought

  1. Display a three band image of the Lamtaklong Reservoir during the 2005 drought: lamtaklong_250205_060305_b1.img, lamtaklong_250205_060305_b2.img, and lamtaklong_250205_060305_b3.img (blue, green, red).
  2. Choose the Display->Overlay menu item.
  3. Enter LamtaklongLandMask.img for the Overlay File parameter.
  4. Click on OK.

The mask will be displayed on top of the three band image. In areas where the mask is zero (i.e. the water area from the flood image), the background image will show through. Notice how much the shore of the reservoir has shrunk during the drought, compared to its flood extent.

Masked symmetric difference to assess drought

Most of the OpenDragon processing operations can accept a mask image as an optional parameter. If a mask is specified, then the operation is performed only on pixels where the mask is non-zero. (The Recode operation works slightly differently.) Areas where the mask is zero produce a zero result.

To see how masking affects processing, do the following:

  1. Choose the Enhance->Symmetric menu item.
  2. Enter lamtaklong_250205_060305_b4.img for the first image file parameter.
  3. Enter lamtaklong_110103_200103_b4.img for the second image file parameter.
  4. Enter LamtaklongWaterMask.img for the Mask image parameter.
  5. Click on OK.

The displayed image will show bright areas where the two input image files are different. Results are restricted to the water of the reservoir because of the mask. Notice how clearly the image shows the shrinking of the reservoir, including details like channels and shallow areas.