Re: Using Objects-Urgent (To David et al) [message #41470] |
Thu, 28 October 2004 00:41  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Pravesh writes:
> U have got it right. I have read the documentation carefully. Let me
> explain it fully. Using region grow, i have obtained a vector of
> indices (1-d). Now, suppose image is my image array. i have to compute
> the geometric area of the roi whose indices are the returned array.
One way to calculate the area of the ROI is to multiply
the number of elements in your vector by the area of
a single image pixel. The "geometric" area is sometimes
a bit smaller than this, but there are at least two
or three different algorithms that are used to calculate
it. Each of these gives a different number.
In the cases I am familiar with, it is not the absolute
area I am interested in. Rather, I care about relative
areas, since I am comparing one area to another. The
method above is preferred for this sort of analysis,
since it is extremely fast.
If you have to have perimeters of the outside, and holes
inside, etc., then you have to take your indices and
contour them. Use the CONTOUR command, for example,
and save the path information in PATH_INFO and PATH_XY
keywords. These will give you boundary points that you
can feed into an IDLanROI object. Then you can use the
ComputeGeometry method of that object to obtain parameters
of interest.
> i also know oroi = obj_new('idlanroi', some array]
> let me know what the some array will be in the above scenario. it has
> to be a 2-d or 3-d array.
The documentation may be misleading you. It will be
a 2xN array, if you have XY pairs of points describing
an ROI in 2D. It will be a 3xN array of points if you
have XYZ points describing an ROI in 3D.
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http:/www.dfanning.com/
Phone: 970-221-0438, IDL Book Orders: 1-888-461-0155
|
|
|