Application Tips for ENVI 5 – Utilizing the new portal view for visualizing data layers

This is part of a series on tips for getting the most out of your geospatial applications. Check back regularly or follow HySpeed Computing to see the latest examples and demonstrations.

Objective: Demonstrate the use of ENVI’s new portal view for visualizing data in multiple layers.

Scenario: This tip utilizes a Landsat ETM+ scene from Kaneohe Bay, Oahu, Hawaii downloaded from USGS EarthExplorer. The example calculates the normalized difference water index (NDWI) proposed by McFeeters (1996, IJRS 17:1425-1432), displays the index results using the Raster Color Slice tool, and then utilizes the portal view to visually validate the capacity of NDWI to differentiate land from water.

ENVI Portal

The Tip: Below are steps to open the image in ENVI, calculate the NDWI index, display output using Raster Color Slice, and use the portal to visualize the NDWI output as a ‘sub-view’ within a standard RGB view:

  • Open the Landsat scene in ENVI. After un-compressing the download folder from USGS, simply use a standard method for opening files (e.g., File > Open…) to open the <*_MTL.txt> metadata file. This loads all of the Landsat bands into the Data Manager, and opens an RGB layer in the Layer Manager.
  • Calculate NDWI. Use Band Math (Toolbox > Band Ratio > Band Math) to implement the following equation (float(b2)-float(b4))/(float(b2)+float(b4)), where b2 is Band-2 (560 nm), b4 is Band-4 (835 nm), and the float() operation is used to transform integers to floating point values and avoid byte overflow.


  • Examine the NDWI output. Using the Cursor Value tool (Display > Cursor Value…) to explore the resulting grayscale NDWI image, it becomes apparent that there is a threshold near zero where values above the threshold are water and those below are land and cloud. While this data is alone sufficient for analysis, let’s use something more colorful for visualizing the output.
  • Display NDWI output using raster color slices. Start the Raster Color Slice tool (right click the NDWI layer name in the Layer Manager and select Raster Color Slices…), select the NDWI data in the Select Input File dialog, and then accept the default settings in the Edit Raster Color Slices dialog.

Raster Color Slice

  • Examine the Raster Color Slice layer. The color slices reveal a visually clear distinction between water and land/cloud, where in this example warm colors (reds and yellows) indicate water and cool colors (blues and green) indicate land/cloud.
  • Display output using a portal. First, make sure to put the layers in the appropriate order. Drag the RGB layer to the top of the display in the Layer Manager, and make sure the color slice layer is second. Then start the Portal tool (select the Portal icon on the toolbar, or Display > Portal). This will open a new smaller ‘sub-view’ that reveals the color slice NDWI layer within the larger view of the RGB layer. Alternatively, you could also use the portal to similarly view the grayscale NDWI layer. To do so, hover over the top of the portal to make the View Portal toolbar visible, right click on the toolbar, and select Load New Layer.

ENVI Portal

  • Explore data layers with the portal. The portal itself is interactive, which means it can be easily moved and resized to examine different portions of the image. In this example the portal can be moved around the image (left click within the portal and drag using your mouse) to explore how well the NDWI index works in different areas.
  • Other visualization options. In addition to the default portal display, the portal can also be animated to alternate between the different layers. The three options are Blend (transitions layer transparency), Flicker (toggles between layers), and Swipe (moves a vertical divider that separates the layers). These animations can be started as follows: hover over the top of the portal to make the View Portal toolbar visible, right click the toolbar, and select the desired animation option. The speed of animation can then be changed using the faster and slower buttons, and the animation can be paused or restarted using the pause and play buttons, located on the portal toolbar.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s