Coyote Graphics Routines

Date: Fri Mar 27 12:14:20 2015

single page | use frames     summary     class     fields     routine details     file attributes

.\

cgzimage.pro

Graphics


Allows the user to interactively zoom into an image. Program controls are available by right-clicking in the full-sized image window. Zoom factors from 2x to 16x are available. Use the left mouse button to draw a box on the full-sized image to locate the region of the image to zoom.

Examples

Code examples:

IDL> image = cgDemoData(7) IDL> cgZImage, image ; 2D image IDL> image = cgDemoData(16) IDL> cgZImage, image ; True-Color image

Author information

Author

FANNING SOFTWARE CONSULTING:

David W. Fanning 1645 Sheely Drive Fort Collins, CO 80526 USA Phone: 970-221-0438 E-mail: david@idlcoyote.com Coyote's Guide to IDL Programming: http://www.idlcoyote.com

Copyright

Copyright (c) 2012-2014, Fanning Software Consulting, Inc.

History

Change History:

Written, 20 September 2012 from previous FSC_ZImage program. DWF. Modernized the info structure handling to reflect modern sensibilities. 3 Oct 2012. DWF. Changes to allow this to work with very large images. Can now zoom to actual pixel values. Also fixed a problem that left zoom windows lying around unused if scroll bars were needed. 18 October 2012. DWF. The color palette was not always being included when images were zoomed. Fixed. 17 Nov 2012. DWF. Added ZoomFactor keyword to allow the zoom factor to be set on start-up. 28 Nov 2012. DWF. Fixed a typo that caused bringing controls into the window to fail. 13 Jan 2014. DWF.

Routines

cgZImage_ZoomWindow_Events, event

Event handler for the motion events coming from the zoom window.

cgZImage_ZoomDied, zoomID

A clean-up routine for the zoom window, if the zoom window is killed.

cgZImage_BoxColor, event

Event handler for changing the rubber-band box color.

cgZImage_LoadColors, event

Event handler for changing the colors the image is displayed in.

cgZImage_Quit, event

Event handler for quiting the program.

cgZImage_Cleanup, tlb

The clean-up routine for the program.

cgZImage_Factor, event

Event handler for changing the zoom factor.

cgZImage_DrawEvents, event

Event handler for handling the rubber-band box events to create the zoom window.

cgZImage, image [, BETA=float] [, BOTTOM=integer] [, BOXCOLOR=string] [, CLIP=float] [, EXCLUDE=numeric] [, EXPONENT=float] [, FILENAME=string] [, GAMMA=float] [, GROUP_LEADER=long] [, /INTERPOLATE] [, MAP=structure] [, MAXVALUE=varies] [, MEAN=float] [, MISSING_COLOR=string] [, MISSING_INDEX=integer] [, MISSING_VALUE=integer] [, /NEGATIVE] [, MINVALUE=varies] [, MULTIPLIER=float] [, NCOLORS=integer] [, PALETTE=byte] [, /SCALE] [, SIGMA=float] [, STRETCH=integer/string] [, TITLE=string] [, TOP=integer] [, ZOOMFACTOR=string]

Allows the user to interactively zoom into an image.

Routine details

top cgZImage_ZoomWindow_Events

cgZImage_ZoomWindow_Events, event

Event handler for the motion events coming from the zoom window. Find the location and value of the image at the cursor location and report it to the status bar in the main image window.

Parameters

event in required type=structure

The event structure passed to the program by the window manager.

top cgZImage_ZoomDied

cgZImage_ZoomDied, zoomID

A clean-up routine for the zoom window, if the zoom window is killed.

Parameters

zoomID in required type=long

The zoom widget identifier

top cgZImage_BoxColor

cgZImage_BoxColor, event

Event handler for changing the rubber-band box color.

Parameters

event in required type=structure

The event structure passed to the program by the window manager.

top cgZImage_LoadColors

cgZImage_LoadColors, event

Event handler for changing the colors the image is displayed in.

Parameters

event in required type=structure

The event structure passed to the program by the window manager.

top cgZImage_Quit

cgZImage_Quit, event

Event handler for quiting the program.

Parameters

event in required type=structure

The event structure passed to the program by the window manager.

top cgZImage_Cleanup

cgZImage_Cleanup, tlb

The clean-up routine for the program. Come here to release pointers and memory.

Parameters

tlb in required type=long

The identifier of the top-level base of the widget program.

top cgZImage_Factor

cgZImage_Factor, event

Event handler for changing the zoom factor.

Parameters

event in required type=structure

The event structure passed to the program by the window manager.

top cgZImage_DrawEvents

cgZImage_DrawEvents, event

Event handler for handling the rubber-band box events to create the zoom window.

Parameters

event in required type=structure

The event structure passed to the program by the window manager.

top cgZImage

cgZImage, image [, BETA=float] [, BOTTOM=integer] [, BOXCOLOR=string] [, CLIP=float] [, EXCLUDE=numeric] [, EXPONENT=float] [, FILENAME=string] [, GAMMA=float] [, GROUP_LEADER=long] [, /INTERPOLATE] [, MAP=structure] [, MAXVALUE=varies] [, MEAN=float] [, MISSING_COLOR=string] [, MISSING_INDEX=integer] [, MISSING_VALUE=integer] [, /NEGATIVE] [, MINVALUE=varies] [, MULTIPLIER=float] [, NCOLORS=integer] [, PALETTE=byte] [, /SCALE] [, SIGMA=float] [, STRETCH=integer/string] [, TITLE=string] [, TOP=integer] [, ZOOMFACTOR=string]

Allows the user to interactively zoom into an image. Program controls are available by right-clicking in the full-sized image window. Zoom factors from 2x to 16x are available. Use the left mouse button to draw a box on the full-sized image to locate the region of the image to zoom.

Parameters

image in required type=any

A 2D or true-color image of any normal data type. If not a BYTE array, cgImage keywords for proper image scaling must be used to provide image scaling parameters.

Keywords

BETA in optional type=float default=3.0

The beta factor in a Hyperpolic Sine stretch. Available only with 2D images.

BOTTOM in optional type=integer default=0

If the SCALE keyword is set, the image is scaled before display so that all displayed pixels have values greater than or equal to BOTTOM and less than or equal to TOP. Available only with 2D images.

BOXCOLOR in optional type=string default=gold

The name of the color of the rubber-band selection box.

CLIP in optional type=float default=2

A number between 0 and 50 that indicates the percentage of pixels to clip off either end of the image histogram before performing a linear stretch. Available only with 2D images.

EXCLUDE in optional type=numeric

The value to exclude in a standard deviation stretch.

EXPONENT in optional type=float default=4.0

The logarithm exponent in a logarithmic stretch. Available only with 2D images.

FILENAME in optional type=string

The name of a file that IDL can read with READ_IMAGE (e.g, GEOTIFF, TIF, JPEG, PNG, etc.).

GAMMA in optional type=float default=1.5

The gamma factor in a gamma stretch. Available only with 2D images.

GROUP_LEADER in optional type=long

The widget identifier of the group leader for this program. When the group leader dies, this program will be destroyed, too.

INTERPOLATE in optional type=boolean default=0

Set this keyword to interpolate with bilinear interpolation the display image as it is sized to its final position in the display window. Interpolation will potentially create image values that do not exist in the original image. The default is to do no interpolation, so that image values to not change upon resizing. Interpolation can result in smoother looking final images.

MAP in optional type=structure

A cgMap object for navigating the input image.

MAXVALUE in optional type=varies

If this value is defined, the data is linearly scaled between MINVALUE and MAXVALUE. MAXVALUE is set to MAX(image) by default. Setting this keyword to a value automatically sets SCALE to 1. If the maximum value of the image is greater than 255, this keyword is defined and SCALE=1.

MEAN in optional type=float default=0.5

The mean factor in a logarithmic stretch. Available only with 2D images.

MISSING_COLOR in optional type=string default=white

The color name of the missing value. Available only with 2D images.

MISSING_INDEX in optional type=integer default=255

The index of the missing color in the final byte scaled image. Available only with 2D images.

MISSING_VALUE in optional type=integer

The number that represents the missing value in the image. Available only with 2D images.

NEGATIVE in optional type=boolean default=0

Set this keyword if you want to display the image with a negative or reverse stretch. Available only with 2D images.

MINVALUE in optional type=varies

If this value is defined, the data is linearly scaled between MINVALUE and MAXVALUE. MINVALUE is set to MIN(image) by default. Setting this keyword to a value automatically sets SCALE=1. If the minimum value of the image is less than 0, this keyword is defined and SCALE=1.

MULTIPLIER in optional type=float

The multiplication factor in a standard deviation stretch. The standard deviation is multiplied by this factor to produce the thresholds for a linear stretch.

NCOLORS in optional type=integer default=256

If this keyword is supplied, the TOP keyword is ignored and the TOP keyword is set equal to NCOLORS-1. This keyword is provided to make cgImage easier to use with the color-loading programs such as cgLOADCT:

cgLoadCT, 5, NColors=100, Bottom=100 cgImage, image, NColors=100, Bottom=100
Setting this keyword to a value automatically sets SCALE=1. Available only with 2D images.

PALETTE in optional type=byte

Set this keyword to a 3x256 or 256x3 byte array containing the RGB color vectors to be loaded before the image is displayed. Such vectors can be obtained, for example, from cgLoadCT with the RGB_TABLE keyword:

cgLoadCT, 4, /BREWER, /REVERSE, RGB_TABLE=palette cgImage, cgDemoData(7), PALETTE=palette

SCALE in optional type=boolean default=0

Set this keyword to byte scale the image before display. If this keyword is not set, the image is not scaled before display. This keyword will be set automatically by using any of the keywords normally associated with byte scaling an image. Available only with 2D images. If set, STRETCH is set to 1, unless it is set to another value.

SIGMA in optional type=float default=1.0

The sigma scale factor in a Gaussian stretch. Available only with 2D images.

STRETCH in optional type=integer/string default=1

The type of scaling performed prior to display. May be specified as a number or as a string (e.g, 3 or "Log"). Available only with 2D images.

Number Type of Stretch 0 None No scaling whatsoever is done. 1 Linear scaled = BytScl(image, MIN=minValue, MAX=maxValue) 2 Clip A histogram stretch, with a percentage of pixels clipped at both the top and bottom 3 Gamma scaled = GmaScl(image, MIN=minValue, MAX=maxValue, Gamma=gamma) 4 Log scaled = LogScl(image, MIN=minValue, MAX=maxValue, Mean=mean, Exponent=exponent) 5 Asinh scaled = AsinhScl(image, MIN=minValue, MAX=maxValue, Beta=beta) 6 SquareRoot A linear stretch of the square root histogram of the image values. 7 Equalization A linear stretch of the histogram equalized image histogram. 8 Gaussian A Gaussian normal function is applied to the image histogram. 9 MODIS Scaling done in the differential manner of the MODIS Rapid Response Team and implemented in the Coyote Library routine ScaleModis.

TITLE in optional type=string

Set this keyword to the title of the plot window.

TOP in optional type=integer default=255

If the SCALE keyword is set, the image is scaled before display so that all displayed pixels have values greater than or equal to BOTTOM and less than or equal to TOP. Available only with 2D images.

ZOOMFACTOR in optional type=string default=3

Use this keyword to set the starting zoom factor. The values you can use are as follows:

0: 'Actual' 1: '2x' 2: '3x' 3: '4x' 4: '5x' 5: '6x' 6: '7x' 7: '8x' 8: '12x' 9: '16x'

File attributes

Modification date: Fri Mar 27 11:07:36 2015
Lines: 1,192
Docformat: rst rst