IDLgrROIgroup woes [message #32038] |
Sat, 07 September 2002 12:06  |
btupper
Messages: 55 Registered: January 2002
|
Member |
|
|
Howdy,
I have bumped into a difficulty using the IDLgrROIgroup container
object. I have a mixed bag of contours - some are closed and some are
open - and there exists a variable number of these contours at each
level (z value). I want to make a an IDLgrROI for each contour at
each level and then stuff the IDLgrROI into a group container. There
are three types of ROIs: 0 = points, 1 = open path and 2 = closed
path. It seems that a given IDLgrROIgroup can contain any of one type
- but not a mix of types.
Here's my example:
;make a group container
IDL> group = obj_new('IDLgrROIgroup')
;make three ROIs - closed, open and points
IDL> x = [0,0,1,1]
IDL> y = [0,1,1,0]
IDL> roi_closed = obj_new('IDLgrROI', x,y,type = 2)
IDL> roi_open = obj_new('IDLgrROI', x,y,type = 1)
IDL> roi_points = obj_new('IDLgrROI', x,y,type = 0)
;add each to the group container
IDL> group->Add, roi_closed
IDL> group->Add, roi_open
% IDLGRROIGROUP::ADD: Argument 1 should be of class type IDLanROI
% Execution halted at: $MAIN$
IDL> group->Add, roi_points
% IDLGRROIGROUP::ADD: Argument 1 should be of class type IDLanROI
% Execution halted at: $MAIN$
;are the three ROI objects valid? Yes.
IDL> print, obj_valid([roi_closed, roi_open, roi_points])
1 1 1
;are the three ROI objects really IDLgrROIs? Yes.
IDL> help, roi_closed, roi_open, roi_points
ROI_CLOSED OBJREF = <ObjHeapVar581(IDLGRROI)>
ROI_OPEN OBJREF = <ObjHeapVar585(IDLGRROI)>
ROI_POINTS OBJREF = <ObjHeapVar588(IDLGRROI)>
;make a new container and change the order that I add the ROIs
IDL> group2 = obj_new('IDLgrROIgroup')
IDL> group2 ->Add, roi_open
IDL> group2 ->Add, roi_closed
% IDLGRROIGROUP::ADD: Argument 1 should be of class type IDLanROI
% Execution halted at: $MAIN$
So, have I bumped into a bug or am I trying to misuse the
IDLgrROIgroup? I can believe that I am abusing the IDLgrROI since I
am having a hard time understanding what it means to have an ROI
comprised of points or an ROI that is an open path.
Regards,
Ben
|
|
|