Login  Register

Re: skeleton length

Posted by Michael Miller on Feb 27, 2007; 8:07am
URL: http://imagej.273.s1.nabble.com/skeleton-length-tp3700229p3700230.html

Hello,

I've been working on using ImageJ to compute lengths via skeletons for some
time. My solution is below.

Essentially, use a single-pixel-wide skeletonization from your segmentation
[Binary -> Skeletonize is horrible but its still the only functioning
algorithm I can find at this time despite help from the community] (the
ridge of the distance map isn't always 2 pixels wide, your answer will be
off by half a pixel because of this).

Here a single pixel has no length; measurement is from between the centers
of every pixel, ie 3 horizontal pixels will be length 2.

Feedback is welcome.

-Mike

Details:

pixelWidth = 1;  // this is the true width and height of a pixel connection
pixelHeight = imageAspectRatio; // height / width
pixelDiagonal = Math.sqrt(pixelWidth+pixelHeight); // if the aspectratio was
1, you get 1.414..

Parse the entire skeleton (loop over every pixel). Once you find a part of
the skeleton:
   -count up the number of horizontal Nh, vertical Nv, and diagonal Nd
connections separately
Once you're done with this loop, you will have counted every pair of pixels
exactly twice; divide each Nd, Nv, Nh by 2.

L = Nd*pixelDiagonal + Nh*pixelWidth + Nv*pixelHeight;  // this computes the
raw pixel length of the skeleton
L *= distanceInUnitsPerPixel; // you can use info from Set Scale... to
extract units from the image
Your final length L is now in real-world units.

----- Original Message -----
From: "Martin du Saire" <[hidden email]>
To: <[hidden email]>
Sent: Friday, February 23, 2007 1:14 PM
Subject: skeleton length


> Hi,
>
> I am thinking about estimating root length based on a non-intersecting
> skeleton of a root scan.  The idea is to tally the number of 4-connected
> and 8-connected (diagonals only) pixels, and assign a length of 1 to each
> pair of 4-connected pixels and 1.414 to each pair of 8-connected pixels.
> Has someone already done this?  Or is this a bad idea?
>
> Thanks.
>
> M