comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Average outline of several contours
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Average outline of several contours [message #37020] Thu, 20 November 2003 22:08 Go to next message
David Fanning is currently offline  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 #37115 is a reply to message #37020] Fri, 21 November 2003 03:55 Go to previous messageGo to next message
Beat.Schmutz is currently offline  Beat.Schmutz
Messages: 6
Registered: October 2003
Junior Member
> 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.
>

Thanks David, this sounds reasonable. I'll give it a go.

> Wouldn't that be the "average" ROI path?

You are probably right. I have to think about this some more.

Cheers,

Beat
Re: Average outline of several contours [message #37212 is a reply to message #37020] Wed, 26 November 2003 01:55 Go to previous message
Karsten Rodenacker is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: read data from several files
Next Topic: Re: iTool Redeux

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:21:50 PDT 2025

Total time taken to generate the page: 0.00512 seconds