Re: sending roi's to iTools [message #43021 is a reply to message #42969] |
Fri, 11 March 2005 08:49  |
Chris[2]
Messages: 39 Registered: August 2003
|
Member |
|
|
Hi Peter,
Here's one possibility. Let me know if something doesn't make sense.
iImage, hanning(500,500)
it = itgetcurrent(TOOL=oTool)
; Retrieve the image visualization.
oImage = (oTool->GetSelectedItems())[0]
; Construct an ROI visualization.
oDesc = oTool->GetAnnotation('ROI')
oROI = oDesc->GetObjectInstance()
vertices = [[200,200,0], [300,200,0], [300,300,0], [200,300,0]]
; Create a data object to store the vertices, and
; set it as the VERTICES parameter on the ROI.
oData = OBJ_NEW("IDLitData", vertices, NAME='ROI Vertices', $
TYPE='IDLVERTEX', ICON='segpoly')
; set data object as VERTICES parameter on the ROI.
; Use BY_VALUE so the data object gets cleaned up automatically.
success = oROI->SetData(oData, PARAMETER_NAME='VERTICES', /BY_VALUE)
; Add the ROI to the Image, and we're done.
oImage->Add, oROI
Cheers,
Chris
Research Systems, Inc.
<peter.eddy@shaw.ca> wrote in message
news:1110054590.689714.213610@g14g2000cwa.googlegroups.com.. .
> Greetings,
> I frequent this newsgroup as its always a good way to prevent problems
> I haven't run into yet, though my IDL experience keeps me from posting
> anything helpful =p.
>
> I am trying to display roi's defined in a procedure as 'IDLanROI'
> objects. These roi's are defined in a FOR loop and I would like to
> pass them to an existing iImage session (with the original image
> displayed) possibly with a unique color for each.
>
> I have read Dave Fanning's tips suggesting the use of the
> _IDLitSys_GetSystem() reference to replace image data but cant seem to
> figure out how iImage handles the roi's.
>
> Any help would be appreciated.
>
> Thanks in advance,
> Peter
>
|
|
|