Wednesday, March 20, 2013
ENVI is a widely used and well respected Remote Sensing Data analysis application. Anyone working with imagery or raster data has probably encountered ENVI, even if just by name, at some point in their career. ENVI’s major strength lies in it’s robust analytical capabilities, giving it’s users fine grained control through each step of their analysis, as well as it’s ease of use and intuitive interface. ENVI has a wide array of tools for spatial and spectral analysis that are typically combined in an overall workflow that scientists, analysts, and production staff use to meet their needs in getting information from their imagery.
However, in the world of scientific analysis, off the shelf products like ENVI often don’t provide the necessary, specific functionality that a scientist needs to analyze the data they have. Many applications do 90% of the work a scientist needs, but fall just short of their overall application needs. To do their specific analyses, many scientists thusly have to create their own tools outside of the software applications they use. To achieve this end, the common approach is to pick a programming language that best suits the skills of the scientist and the needs of the analysis.
Intermediate options exist between these two, such as Java or IDL. These languages are interpreted and typically are far easier to learn and develop applications in because they don’t require tasks like memory management. IDL has even greater benefits because it also does not require typing or casting of variables which can significantly speed up the process of application development, particularly in the prototype or R&D phase, and it has a large library of routines in place for scientific data analysis and visualization.
Combining the large array of prepackaged analytical tools already available in ENVI with the programming power offered by IDL makes the ENVI+IDL platform and incredibly powerful platform for customized imagery analysis. ENVI can be extended or modified with IDL in several ways including access to an extensive analytical API, the ability to modify the user interface, access to the ENVI GUI elements, and the capability to use ENVI’s library in batch mode for production work or large, predefined processing tasks.
IDL (the Interactive Data Language) is a complete computing environment for the interactive analysis and visualization of data. IDL integrates a powerful, array-oriented language with numerous mathematical analysis and graphical display techniques. Programming in IDL is a time-saving alternative to programming in FORTRAN or C. Using IDL, tasks which require days or weeks of programming with traditional languages can be accomplished in hours. You can explore data interactively using IDL commands and then create complete applications by writing IDL programs.
Analysis advantages include:
Visualization advantages include:
Application development advantages include:
Figure 1: A view of the IDL Workbench
Like IDL, ENVI has a library of built-in routines. In fact, there are over 200 documented routines in the ENVI library and it grows with each release. They encompass almost all of the functionality provided in the interactive ENVI program. Each library routine is written in the form of an IDL procedure or function, and is called as such. A complete index of these routines as well as a full reference page for each is located in the ENVI Online Help.
Library routines are IDL-based functions and procedures that you call from an IDL or ENVI command line (or incorporate into a user function or batch mode routine) that encompass nearly all of the functionality in ENVI. For example, the library routine MATH_DOIT lets you perform Band Math on a spatial dataset, just like you would by selecting Basic Tools – Band Math from the ENVI main menu bar. The ENVI library routines encompass programmatic access to a large collection of processing elements ranging from spectral analysis, region/area of interest processing, map projection utilities, object analysis, reporting, and visualization components. The ENVI Reference Guide contains a complete index and full reference page for each library routine.
Most of ENVI’s library routines require user interaction. When writing your own code to call ENVI library routines, you must explicitly handle all aspects of a library routine. As a result, most of the ENVI library routines require many more keywords than a typical IDL routine. Because so much information often must be passed into an ENVI library routine, they typically use keywords instead of positional parameters, to prevent you from having to pass information in a specific sequence.
Figure 2: Some Sample ENVI Library Code
To run a batch mode routine, start by creating a user function that contains the necessary ENVI program calls and appropriate parameters. Then run it using one of the following options:
ENVI Menu Files
The ENVI main menu bar (defined by envi.men) and Display group menu bar (defined by display.men) are configurable items located in the menu subdirectory of the ENVI installation. These two ASCII files outline the placement of menu buttons, pull-down menus, and separators. They also define the procedure called when you select the menu item. You can reposition menu items or add new items, depending on your needs and preferences. ENVI does not distinguish between ENVI and user-event handlers, which ensures that user events are easily integrated. You can also use the ENVI_ DEFINE_MENU_BUTTON procedure to add menu items (buttons) to the ENVI menu system automatically through your own code.
Figure 3: The ENVI menu with buttons added
When a widget interface for a user function is auto-managed by ENVI, the GUI is always modal. That is, the widget interface blocks the rest of ENVI from responding until you select the OK or Cancel button, either of which destroys the GUI (OK destroys and proceeds, and Cancel destroys and returns). In this mode, ENVI handles all of the widget events and conveniently returns the user input in a structure variable. Using ENVI to auto-manage the GUI in this fashion allows user functions to take a very simple form, where they can execute linearly from the beginning of the file to the end.
After writing a custom routine (user function, interactive user routine, or custom file reader), you should place the resulting .pro or .sav file in the save_add directory of your ENVI installation. This allows the routine to be automatically compiled or restored when ENVI is started. Use only lowercase names (including extensions) for files placed in the save_add directory. You can change the location of the save_add directory, as desired, in your ENVI preferences or configuration file.
As an alternative, you can compile .pro files within ENVI only if you have ENVI + IDL, by selecting File – Compile IDL Module from the ENVI main menu bar. This allows you to debug the routine during development. If you have standalone ENVI, you must use a compiled (.sav) file to add a user function to ENVI.
You can write a custom file input routine to open and read your data format on-the-fly. When opening an unsupported file format automatically (without prompting for the file information), the input routine parses the file header and places the bands in the Available Bands List. Custom readers can access data stored in unsupported storage formats on-the-fly in ENVI, without converting to an ENVI format.
Exelis Visual Information Solutions recognizes the importance of giving users the power to customize and extend ENVI to meet their specific needs. Leveraging the power of IDL, along with access to the extensive analytic library of ENVI, allows users to create the functionality their application requires that can not be found in COTS products and to easily integrate this into the ENVI environment.
Number of views (14446)/Comments (0)
Passive point clouds have become a pervasive data modality for remote sensing analyses. A passive point...
Geospatial analytics allow people to ask questions of data that exist within a spatial context. Usually...
Combining the large array of prepackaged analytical tools already available in ENVI with the programming...
Sign Up for News & Updates: Stay informed with the latest news, events, technologies and special offers.