Parent Child relationship in IDL [message #39814] |
Tue, 22 June 2004 22:50  |
IDLmastertobe
Messages: 54 Registered: June 2004
|
Member |
|
|
I just implemented a .pro program that displays an image in its draw
window. The program is able to draw a box on top of this image where the
area of the image enclosed by the box will be zoomed in on another window.
Next, the program takes the image enclosed by the box and passes it on as
a parameter to itself using the 'CALL_PROCEDURE' method.
Essentially, I now have two of the same .pro programs running, where the
first window has the original image, and the second window has the zoomed
image.
My problem is that I would like to redraw the box on the first window, and
output the zoomed image to that same second window. However, the program
displays the image enclosed by the box on a third window. How can I
construct a relationship between the parent and child window?
|
|
|
Re: Parent Child relationship in IDL [message #39949 is a reply to message #39814] |
Wed, 23 June 2004 19:54  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
IDLmastertobe writes:
> I took a look at your program and saw how you are able to zoom on a
> section of the original image and output it to a new window.
>
> The program that I am working on does just that, but I want to be able to
> zoom into consecutive images. In your program, what would you do so that
> you can recursively zoom in on the new window, such that the new window
> can do exactly what the original window does.
Well, in the UP section of the draw widget event handler,
don't make a window, just call ZImage with the zoomed image
as an argument. Be sure you use the GROUP_LEADER keyword
so that all the programs you are spawning die appropriately. :-)
'UP': BEGIN
...
; Subset the image, and apply the zoom factor to it.
imageSubset = info.image(x(0):x(1), y(0):y(1))
zoomedImage = Congrid(imageSubset, zoomXSize, zoomYSize, $
Interp=info.interp)
ZImage, zoomedImage, Group_Leader=event.top
...
END
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|