Skip to main content

Viewing and Importing DIRSIG Output Images

We are often asked what programs can view DIRSIG's image outputs and how to import the raw DIRSIG image data files into other tools for further processing.

For basic image viewing, DIRSIG-4.4.0 now includes a very simple viewing tool. Launch it from the main simulation editor window by selecting the "Start image viewer" option from the "Tools" menu.


If you run your simulation from the GUI simulation editor, new image files are automatically added to the list in the image viewer as they are generated. If you want to manually add files to the list, simply select the "Open" item from the "File" menu or the toolbar.

Here is a screenshot of the main image viewer window. The top part contains the list of currently opened files and the bands within those image files.
To view a single band as a gray-scale image, choose "Single Band Display" from the combo box and then click on the image band that you want. Finally, click "Load Band".

You can also load three bands at once. One band will be visualized in red, another in green, and the last in blue. Choose "RGB Display" from the combo box. Then, in sequence, click the radio button next to each color followed by the band that you want. Finally, click "Load RGB".

Note that you can use this to view simulated color images. Assign the Red Channel from DIRSIG to the Red color, the Green Channel to the Green, etc. Also note that you are not limited to this. You can assign arbitrary bands to arbitrary colors. This lets you reproduce visualizations such as false color infrared.

The right side of the image window has a "Zoom Image" view of the image. You can control the zoom factor using the "In", "Out" and "Reset" buttons below it. Clicking your left mouse button inside either the "Zoom Image" or "Full Image" regions will center the zoomed area where you clicked. The panels below provided some live feedback of the raw data associated with the pixel your mouse is currently over.

The full image can be saved (for use in a presentation, etc.) to a PNG, JPG, etc. by selecting the "Save As" option from the "File" menu.

If the image file has more than one band, the "Spectral Plot" window can be opened. The "Spectral Plot" window displays a plot of the current pixel across all the bands in the image file.

The built-in Image Viewer tool is very primitive and is only intended for quick visualization. For real image exploitation, here are a few of the options available to you:
  • Opticks (open source and free, Windows and UNIX)
  • ENVI (commercial, all major platforms)
For programmers, it is not difficult to write (or find an existing) parser for these image files. DIRSIG uses the ENVI image format, which consists of two separate files: a binary image data file and an ASCII/Text image header file. The binary image data is written in native endian (byte-order) as double precision radiances in a band-interleaved by pixel ordering with no additional headers/offsets in the binary image file. This binary image data file is typically created with a ".img" file extension, but the user can change this extension in their simulation configuration.

In addition to the binary image data file, DIRSIG automatically creates an ENVI Image Header file, which typically has a ".img.hdr" file extension. This header file is simply an ASCII/Text description of the format for the binary image data file. If you explore that image header file, you can find all the critical information needed to read the image data file into most data processing environments. For Matlab programmers, check out these MATLAB scripts to read ENVI image data files. For the C and C++ programmers, check out the GDAL library for parsing raster, geospatial data formats.

Comments

Popular posts from this blog

LIDAR Point Cloud Visualization

A common question we get asked is how to visualize the point cloud data produced by either the Linear-mode or Geiger-mode LIDAR simulations. First, you should remember that the point cloud files produced by the "APD Processor" are simple ASCII/text files. Each line is the entry for a single return or "point" in the point cloud, including the point location and some attributes that vary depending on whether you modeled a Linear-mode or Geiger-mode system. For a Linear-mode system, a point cloud file will generally look like the example below: 12.7388 -45.3612 -0.0256 5.0290 0 0 0 0 12.8169 -45.3612 -0.0264 4.8362 0 1 0 0 12.8950 -45.3612 -0.0271 4.8362 0 2 0 0 ... 32.4008 -25.5446 10.5945 4.6783 0 65533 0 0 32.4781 -25.5446 10.5953 5.8959 0 65534 0 0 32.5360 -25.5640 12.5408 5.9185 0 65535 0 0 The first three columns are the X/Y/Z location of the point return. The 4th column is the intensity (in photons). Since Linear mode can support multiple returns per pulse, t

Using MODTRAN6 with DIRSIG

It has been a pretty exciting year for the team at Spectral Sciences, Inc.  with the release of MODTRAN6 . This latest version marks a major milestone in the continued development of one of the most popular and trusted codes for simulating radiative transfer in the atmosphere. In addition to important science related advancements, this latest code also includes significant improvements to the general usability of the software. This includes a new graphical user interface (GUI) and the introduction of a formal application programmer interface (API), which let's codes like DIRSIG interact with MODTRAN in a far more robust way than previous versions allowed. New MODTRAN, new interfaces The major development in the interface area is a shift from the old "tape5" style inputs to a new JSON (JavaScript Object Notation) style input. In addition to improving the general readability of the input, the JSON document format is much easier to read in, modify and write back out. The