retrieving regions from a IDLanROIGroup [message #41884] |
Mon, 06 December 2004 05:58 |
m.s.m.
Messages: 5 Registered: December 2004
|
Junior Member |
|
|
Hi!
I select automatically ROIs(from a binary image)
and store them in a region group in the following way:
;thresHimage...bynary image
CONTOUR,thresHimage,level=1,xmargin=[0,0],$
ymargin=[0,0],/noerase,path_info=pathInfo,$
path_xy=pathXY,xstyle=5,ystyle=5, /path_data_coords
;create the oRoiGroup
oRoiGroup=OBJ_NEW('IDLanROIGroup')
;input the data of each of the contour paths
;into IDLanROI objects
FOR I=0,N_ELEMENTS(pathInfo)-1 DO BEGIN
;initialize oRoi with the contour information of
;the current region
line=[LINDGEN(pathInfo[I].N),0]
oRoi=OBJ_NEW('IDLanROI',$
(pathXY[*,pathInfo[I].OFFSET+line])[0,*],$
(pathXY[*,pathInfo[I].OFFSET+line])[1,*], /interior )
;add to oRoiGroup
oRoiGroup->Add,ORoi
;destroy the oRoi object
OBJ_DESTROY,oRoi
ENDFOR
This works quite good and typing "help,oRoiGroup", IDL prints:
OROIGROUP OBJREF = <ObjHeapVar1736(IDLANROIGROUP)>
Next, I want to grow each of these regions (with region_grow),
so I need to retrieve them from oRoiGroup. I do it in this
way:
SomeRoi=oRoiGroup->Get(position=0)
typing "help,someRoi", IDL prints:
SOMEROI OBJREF = <ObjHeapVar1737>
If now I try to use any IDLanROI method it does not work!!,for instance:
someRoi->getProperty,all=variable
IDL prints:
% Invalid object reference: SOMEROI.
I would be very grateful if someone could tell me what I am doing false.
Thanks a lot!,
Miriam
|
|
|