Re: cw_defroi vertices. [message #30361 is a reply to message #30359] |
Thu, 18 April 2002 10:07  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Higgins (dmh@medphysics.leeds.ac.uk) writes:
> I have been using DEFROI to define a region of interest, and then
> using xVerts and yVerts in the line that follows:
>
> area=DEFROI(m,n,xVerts,yVerts)
> ROI=OBJ_NEW('IDLanROI', xVerts, yVerts, type=2); type two
> ;is a closed polygon
>
> I want to be able to use cw_defroi instead because I am updating a
> draw widget.
> Something like
> area = cw_defroi(info.drawID)
>
> Obviously xVerts and yVerts are no longer defined, and it seems that
> the "area" array is the wrong dimensions to be used with the "data"
> keyword in the initialization of "ROI" (above).
>
> Does anyone know how I should input the vertices of the region of
> interest when initializing "ROI"?
You can turn your "area" into xVerts and yVerts like this.
(I assume your image is an m-by-n array.)
xVerts = area MOD m
yVerts = area / m
These will be in device (pixel) coordinate space.
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|