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
|
|
|
Re: IDLgrROI [message #46616 is a reply to message #32038] |
Fri, 02 December 2005 03:58  |
Peter Clinch
Messages: 98 Registered: April 1996
|
Member |
|
|
raval.chintan@gmail.com wrote:
> I am using IDLgrROI to draw a polygon. Now I want to fill the inner
> part of ROI .
> I do not want to use the idlgrpolygon for this application ... : - (
Maybe have a look at the IDLanROI::ComputeMask method. AIUI that should
provide a 2D array which can have pixels set according to whether
they're inside or outside or whether they're on the boundary.
I've not used it myself yet, but it seems it should be useful for what
you're after.
Pete.
--
Peter Clinch Medical Physics IT Officer
Tel 44 1382 660111 ext. 33637 Univ. of Dundee, Ninewells Hospital
Fax 44 1382 640177 Dundee DD1 9SY Scotland UK
net p.j.clinch@dundee.ac.uk http://www.dundee.ac.uk/~pjclinch/
|
|
|