 |
IMDISP: An image display program for IDL
by Liam Gumley (Latest
Update: Version 1.45, 2000/08/28).
Example code is available to create this image in 8-bit
or 24-bit
mode. |
IMDISP
source code (Requires IDL 5.0 or higher).
What is IMDISP?
IMDISP is an advanced replacement for the TV and TVSCL image display procedures
in IDL.
Features
IMDISP is packed with more features than any other IDL image display program.
It allows you to concentrate on your work, rather than forcing you to worry
about mundane issues such as determining the characteristics of the current
graphics device, or deciding whether to use decomposed color mode. IMDISP
keeps all these operations hidden internally: all you know is your image
was displayed correctly.
The features offered by IMDISP are:
-
Support for WIN, MAC, X, CGM, PCL, PRINTER, PS, and Z graphics devices,
-
Image is automatically byte-scaled (can be disabled),
-
Custom byte-scaling of Pseudo color images via the RANGE keyword,
-
Pseudo (indexed) color and True color images are handled automatically,
-
8-bit and 24-bit graphics devices are handled automatically,
-
Decomposed color settings are handled automatically,
-
Image is automatically sized to fit the display (can be disabled),
-
The !P.MULTI system variable is honored for multiple image display,
-
Image can be positioned via the POSITION keyword,
-
Color table splitting via the BOTTOM and NCOLORS keywords,
-
Image aspect ratio customization via the ASPECT keyword,
-
Resized images can be resampled (default) or interpolated,
-
Top down image display via the ORDER keyword (!ORDER is ignored),
-
Selectable display channel (R/G/B) via the CHANNEL keyword,
-
Background can be set to a specified color via the BACKGROUND keyword,
-
Screen can be erased prior to image display via the ERASE keyword,
-
Plot axes can be drawn on the image via the AXIS keyword,
-
Photographic negative images can be displayed via the NEGATIVE keyword.
Why is IMDISP better than TV or TVSCL?
If you've ever displayed images in IDL, then you probably know that displaying
simple images on screen is pretty easy, e.g.
IDL> tvscl, dist(256)
But what if you want to get a little more sophisticated, and display a
true color (RGB) image with the correct aspect ratio on any device supported
by IDL (Screen, Postscript, Printer, PCL, CGM or Z buffer) with plot axes
and titles overlaid on the image? The TV and TVSCL commands simply cannot
handle this task without a great deal of effort on your part to determine
how to resize the image, how to scale it, and how to handle the various
output graphics devices. If you can figure out to do this reliably in less
than a week using TV or TVSCL, then you don't need IMDISP.
If you'd rather just display the image and get on with your work, then
you need IMDISP.
Revision History
The following is a summary of revisions in public IMDISP releases. The
detailed change log is also available.
28 August 2000
-
Added NEGATIVE keyword to allow photographic negatives to be displayed.
-
Updated examples to use ERASE keyword, and demonstrate PostScript output.
2 August 2000
-
Added AXIS keyword for X/Y axis overlay on image,
-
Added BACKGROUND keyword to allow background color to be set,
-
Added ERASE keyword to allow screen erase before image is displayed,
-
Modified re-gridding algorithm to match C. Markwardt's CMCONGRID method,
-
Checks for IDL 5.2 when PRINTER device is selected,
-
Changed output scaling range for TrueColor images to 0-255 (was 0-254).
18 April 2000
-
CHANNEL keyword is now properly restricted to graphics devices which support
24-bit decomposed color (WIN, MAC, X). It is ignored by all other graphics
devices supported by IMDISP. However True color (RGB) images can be displayed
on any device supported by IMDISP (color quantization is use on 8-bit devices).
17 April 2000
-
Added a CHANNEL keyword to allow the display channel (R/G/B) to be specified,
-
Fixed a problem where the first image displayed in a new IDL session could
be scaled incorrectly,
-
Added USEPOS keyword to force the image to exactly fit a supplied POSITION
vector, regardless of aspect or margin settings,
-
Added an example for the USEPOS keyword,
-
Added an example showing how the POSITION keyword can be used for images
where only the offset and size are known (e.g. MAP_IMAGE output).
4 February 2000
-
Added a RANGE keyword to allow specification of the minimum and maximum
values of the image array to be considered when the image is scaled to
byte values (default is minimum and maximum array values). This keyword
is ignored for True Color images, or if the NOSCALE keyword is set.
-
Added an example where plot axes are overlaid on an image.
11 January 2000
-
When a POSITION keyword is passed and the MARGIN keyword is not set, the
default margin is zero.
22 December 1999
-
Now uses decomposed color mode when displaying True Color images on 24-bit
displays,
-
Verified correct operation on all graphics devices (WIN, MAC, X, CGM, PCL,
PRINTER, PS, Z),
-
PRINTER device now displays Indexed Color and True Color images correctly,
-
PRINTER device image positioning was fixed,
-
Replaced DEMO_GETDATA call with standard file i/o calls in examples,
-
Margin is now limited to 0.0 minimum, 0.495 maximum,
-
Improved readability (separated bit depth detection, setting decomposed
mode, image display),
-
Added ORDER keyword to allow top down image display (!ORDER is ignored).
19 November 1999
-
Changed default margin to 0.025 when displaying multiple images,
-
Added detection of display depth in IDL versions 5.1 and higher.
18 November 1999
Licensing
IMDISP is licensed under the terms of the GNU General
Public License.
Feedback
If you have a question, comment, or suggestion regarding IMDISP, please
add
it here.
Liam.Gumley@ssec.wisc.edu
Last updated 28 August 2000