The purpose of this program is allow interactive inquiry of image position and values for images displayed with cgImage. After a call to cgImage, cgImageInfo can be called and the user can use the cursor to click in the image display window. If the user clicks inside the image, the image location and value will be printed out in the user's IDL console window. The cgImageInfo program blocks the IDL command line until the RIGHT mouse button is clicked in the image display window.
This cgImageInfo program is designed to work for the last image displayed with cgImage on a Windows or X device. Precautions are taken to help you avoid shooting yourself in the foot, but I can't anticipate every action a user might take at the IDL command line. Pay particular attention to exiting the program with the RIGHT mouse button before you close or kill the current graphics window. Failure to do so will put you into a very strange and precarious state from which no rescue is possible. You might want to consider using the Catalyst Program IMGWIN as an alternative to cgImageInfo.
- image in required
A 2D or 3D image array. Values will be returned from this image. In versions of IDL < 8.0, it is possible to use a HASH object of keys/images where this program will describe the value for each of the images in the HASH object.
- position in optional type=float
A four-element floating array giving the position of the image in the display window. If not provided, the image position will be retrieved from the last image position used with cgImage.
To display an image with axes and then inquire about it:
filename = FILEPATH(SUBDIR=['examples','data'], 'worldelv.dat') image = BYTARR(360,360) OPENR, lun, filename, /GET_LUN READU, lun, image FREE_LUN, lun thisPosition = [0.1, 0.1, 0.9, 0.9] cgImage, image, /KEEP_ASPECT, POSITION=thisPosition, /AXES cgImageInfo, image
FANNING SOFTWARE CONSULTING:
David W. Fanning 1645 Sheely Drive Fort Collins, CO 80526 USA Phone: 970-221-0438 E-mail: email@example.com Coyote's Guide to IDL Programming: http://www.idlcoyote.com
Copyright (c) 2008-2011, Fanning Software Consulting, Inc.
Written by: David W Fanning, 16 March 2008. Added ability to specify position directly in call. 20 March 2008. DWF Changed cursor operation to conform with expected differences between Windows and UNIX. 20 March 2008, DWF. Slightly modified screen directions. 16 November 2010. DWF. Modified so that multiple images/grids can be described 18 May 2011. MHS
|Modification date:||Fri Mar 27 11:07:38 2015|