Interactive Image Locations and Values [message #59310] |
Sun, 16 March 2008 14:26 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Folks,
I'm not sure what is happening to me, but I find myself more
and more longing for simpler days. I'm either going retro
or getting older, one.
To this end, I find myself needing a way to interact with
images I display in IDL direct graphics windows, but I
don't want to go to all the trouble of writing an IDL
widget program to do it. I just want to display the
damn thing and then click on it to find out the location
where I clicked and the value. And, of course, I want to
do this no matter where I placed the image in the window, no
matter how big the image is, etc. I want to have my cake
and eat it, too.
If you have read this newsgroup for any length of time,
you know this is generally impossible. But, occasionally,
there are advances that get us closer to the ideal. TVINFO,
a new program I've written may be one of those advances.
At least it works pretty good for me.
http://www.dfanning.com/graphics_tips/tvinfo.html
TVINFO works together will TVIMAGE or TVSCALE to allow
interactive inquiry of your displayed image. Simply
display the image with either TVIMAGE or TVSCALE and
at any time later,* you can use TVINFO to click on the
displayed image and return the image location where you
clicked the image, and its value at that location.
Naturally, there are caveats. I've gone to some trouble
in the code to keep you from shooting yourself in the foot,
but this is IDL circa 1975 (complete with Common blocks
and the CURSOR command), so I can't protect you from all
the foolish things you might try to do.
But if, like me, you are a direct graphics dinosaur and
you need this capability, it's not so bad.
You will need updated versions of TVIMAGE and TVSCALE to
be able to use the TVINFO functionality:
http://www.dfanning.com/programs/tvimage.pro
http://www.dfanning.com/programs/tvscale.pro
http://www.dfanning.com/programs/tvinfo.pro
Other Coyote Library routines are also required. Details
can be found in the TVINFO documentation header.
Cheers,
David
*The phase "any time later" assumes that you want to interact
with the LAST image you displayed, and you haven't resized
the image graphics window, etc., etc. There are a number of
reasonable restrictions, but you will get the idea.
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|