Re: Average outline of several contours [message #37020] |
Thu, 20 November 2003 22:08  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Beat Schmutz writes:
> I have combined 8 contours of bone cross-sections into one image
> (individual ROIs in a IDLgrROIGroup). Now I like to determine the
> path/outline which represents the average of these 8 contours. Is
> anyone aware of a program/code/method that enables me to achieve this?
> Any help would be greatly appreciated.
The Matlab folks probably have a better idea, but
how about a purely graphical approach?
Assign the pixels inside each ROI a value. Say 10.
Draw each filled ROI on a clean image, as you draw
the ROIs add their pixel values. Do this with all
eight ROIs. When you are finished, divide the pixel
values by the number of ROIs. Pixels that were in
all eight ROIs now have a value of 10, pixels that
appear in some ROIs, but not others, have lesser
values. Now just contour the "blob" you have there
with the average value of all the pixels in the
image.
Wouldn't that be the "average" ROI path?
I don't know what I am doing answering IDL questions.
It is VERY late. (I'm getting to be as bad as Reimar,
working night and day.) Your mileage may vary with
this answer. :-)
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
|
Re: Average outline of several contours [message #37212 is a reply to message #37020] |
Wed, 26 November 2003 01:55  |
Karsten Rodenacker
Messages: 98 Registered: July 1997
|
Member |
|
|
David Fanning schrieb:
> Beat Schmutz writes:
>
>
>> I have combined 8 contours of bone cross-sections into one image
>> (individual ROIs in a IDLgrROIGroup). Now I like to determine the
>> path/outline which represents the average of these 8 contours. Is
>> anyone aware of a program/code/method that enables me to achieve this?
>> Any help would be greatly appreciated.
>
>
> The Matlab folks probably have a better idea, but
> how about a purely graphical approach?
>
> Assign the pixels inside each ROI a value. Say 10.
> Draw each filled ROI on a clean image, as you draw
> the ROIs add their pixel values. Do this with all
> eight ROIs. When you are finished, divide the pixel
> values by the number of ROIs. Pixels that were in
> all eight ROIs now have a value of 10, pixels that
> appear in some ROIs, but not others, have lesser
> values. Now just contour the "blob" you have there
> with the average value of all the pixels in the
> image.
>
> Wouldn't that be the "average" ROI path?
>
> I don't know what I am doing answering IDL questions.
> It is VERY late. (I'm getting to be as bad as Reimar,
> working night and day.) Your mileage may vary with
> this answer. :-)
>
> Cheers,
>
> David
Adding to David's recommendation: you could use a variable weight, e.g.
the Z-coordinate of your bone sections, instead of the proposed "10" and
devide the sum image by the sum of Z-coordinates instead of the number
of images. This would generate probably a more reasonable mask. Still
there is the problem of large displacements.
A completely different approach could be to generate the masks from ROI,
taking the maximum (or's) and the minimum (and's), taking the
'difference' (xor) of both, resulting most probably or hopefully in a
ring and generate a skeleton from that ring. This could be called a
morphological approach.
Regards
Karsten
|
|
|