Using defroi on a zoomed image [message #85820] |
Wed, 11 September 2013 19:47  |
Daniel Otis
Messages: 5 Registered: January 2012
|
Junior Member |
|
|
I am trying to display and image using tvscl and then define an irregular roi using defroi. However, the image to be displayed is small and I want to zoom in on the image and then define the roi. Here is the code:
xsize=255
ysize=238
restore,'TB_bath.dat'; Contains variable TB_bath(255,238)
window,0,xsize=xsize,ysize=ysize
loadct,13
tvscl,TB_bath<(-3)>(-7)
zoom,xsize=xsize,ysize=ysize,/keep
x=defroi(xsize,ysize)
This does the zoom just fine, but then I need to exit out of the zoom window before I can define the roi. I want to define the roi on the zoomed image.
Any ideas are appreciated. Thanks,
Dan
|
|
|
Re: Using defroi on a zoomed image [message #85821 is a reply to message #85820] |
Wed, 11 September 2013 20:22  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
dotis@mail.usf.edu writes:
>
> I am trying to display and image using tvscl and then define an irregular roi using defroi. However, the image to be displayed is small and I want to zoom in on the image and then define the roi. Here is the code:
>
>
> xsize=255
> ysize=238
> restore,'TB_bath.dat'; Contains variable TB_bath(255,238)
> window,0,xsize=xsize,ysize=ysize
> loadct,13
> tvscl,TB_bath<(-3)>(-7)
> zoom,xsize=xsize,ysize=ysize,/keep
> x=defroi(xsize,ysize)
>
>
> This does the zoom just fine, but then I need to exit out of the zoom window before I can define the roi. I want to define the roi on the zoomed image.
>
> Any ideas are appreciated. Thanks,
I would do it like this:
image = cgdemodata(11)
help, image
;;IMAGE BYTE = Array[248, 248]
cgdisplay, 248*4, 248*4
cgimage, image
x=defroi(248, 248, zoom=4)
;;% DEFROI: Left button to mark point
;;% DEFROI: Middle button to erase previous point
;;% DEFROI: Right button to close region
; To check if we have done this correctly.
snap = image
snap[x]=0
cgdisplay, 200, 200, wid=1
cgimage, snap
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|