sending roi's to iTools [message #42969] |
Sat, 05 March 2005 12:29  |
peter.eddy@shaw.ca
Messages: 19 Registered: March 2005
|
Junior Member |
|
|
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
|
|
|
Re: sending roi's to iTools [message #43001 is a reply to message #42969] |
Mon, 14 March 2005 10:59  |
peter.eddy
Messages: 1 Registered: March 2005
|
Junior Member |
|
|
Chris,
Thanks for your reply...
I should have been more specific with my version.
I am using version 6.0.3 (windows) and I think this is causing a problem with
the commands you suggested...
When I try the following line:
it = itgetcurrent(TOOL=oTool)
the Tool=oTool keyword is not valid
IDL> it = itgetcurrent(TOOL=oTool)
% Keyword parameters not allowed in call.
% Execution halted at: $MAIN$
using the function without the
argument, it returns
IDL> it=itgetcurrent ()
IDL> print, it
/TOOLS/IMAGE TOOL
Any suggestions?
Pete
|
|
|
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
>
|
|
|