Login  Register

Re: Measure Distance to segmentaion boundary from centroid at arbitrary angles

Posted by Gabriel Landini on Dec 04, 2009; 10:42am
URL: http://imagej.273.s1.nabble.com/Measure-Distance-to-segmentaion-boundary-from-centroid-at-arbitrary-angles-tp3690193p3690195.html

On Friday 04 Dec 2009  10:17:56 you wrote:
> I'd like to measure the straight line distance from the centroid of a
> segmentation to the segmentation boundary for arbitrary angles.  Ideally
> this would be a command I could script, so that I could find something like
> the maximum distance from the centroid to a segmentation boundary by
> iterating over many angles.  ANy ideas would be greatly appreciated.

Your problem might no have single solution. For very irregular objects, there
might be many boundary points at a given angle.

Here is the principle via ROIs:
Get the ROI of the segmented region
Get the coordinates of the ROI
Get the centroid of the region
For all boundary points:
- Compute the angle between the centroid to that point and your reference
line.  If this is the desired angle (you will have to quantise/bin the value):
- - Use Pythagoras theorem from to compute the distance between the centroid
and the boundary point.

G.