# Thickness of binary object after skeletonization

Hi,

I am using the plugin “Thickness” in BoneJ to determine the thickness of the binary object. However, when I skeletonize the same binary object using plugin “Skeletonize 2D” and again determine the thickness, the results come out to be 2 pixels, both mean and max value. Can anybody help me to understand the reason for such a result?

Neel

Hi @neel,

The skeleton of a binary object is a centerline (see here).

This means that skeleton of a binary object should (must) have exactly the same thickness everywhere, otherwise its not a line - lines have no “thickness”. This is why the mean and max are the same: because the thickness is the same everywhere.

Because of this, I don’t think it’s meaningful to measure the thickness of a skeleton.

That being said, I’m surprised you’re getting a value of 2. (I might expect 1, presuming the skeleton is measured on a pixel grid with a one-pixel “thick” mask. I’m not familiar with the BoneJ implementation, but it may be that your choice of connectivity rule could affect the value of thickness you get.

From here:

defines the thickness at a point as the diameter of the greatest sphere that fits within the structure and which contains the point.

Hope this helps, but post back if you have more questions,
John

2 Likes

Thanks for responding on my query. I completely agree that the mean and max value of the thickness of the skeleton should be same. But, the value 2 pixel rather than 1 is little doubtful to me.

Actually, I am not interested in the thickness of the skeleton. I was trying to show in my research that the skeleton of any binary object can help in determining the length of the object, considering its thickness is 1 pixel. But, when I tried to see the thickness of skeletonized binary object, the value was 2 pixel.

Neel

1 Like

We’re both surprised then

Do you have an example image to share? That might help us figure it out together.
Also are there any parameters involved in the skeletonization / thickness calculations? Those will probably be important too

John

I have uploaded an example binary image of object. When I skeletonize the binary object and determine the thickness using bonej, the value is coming out to be 2 pixels. Please try and let me know what results you get.

No, I am not changing any parameters for skeletonization/thickness. I am just clicking the buttons of plugins.

Neel

@bogovicj

Neel

Please try again to post the image here (what type is it? how big is it?), or you can post it to some public file / image sharing site (e.g. dropbox) and post a link.

John

*(If you email it to me, then no one else will be able to see it and help or benefit from what we learn).

@bogovicj

I was able to reproduce this.

Page 12 here explains what we’re getting ‘2’.
Gotta run now, so can’t explain further at the moment. Post back if still not clear…

John

1 Like

@bogovicj

Thanks so much for the help on the topic. But, I still need some help to understand this in simple English, which I can also write in my research. Please explain it to me once you get time.

Neel

This is a wrong use of the Local Thickness algorithm. It is trying to measure an infinitesimal distance (a pixel) with an integer ruler (one pixel spacing), which measures radii that can’t be smaller than 1 (then multiplies it by 2 to get a diameter). So, you do get an answer but unfortunately it’s junk because the question is poorly posed.

Local Thickness is a kind of statistical measurement, like getting the average corridor length in your building with only a meter stick. The rounding errors of the partial sticks should even out in the building’s mean corridor length as the length and number of corridors increases. But, there’s still space for bias if all the corridors are exactly the same length. It works better if the pixel spacing is small relative to the feature size and if there’s a bit of variation in feature size (and probably orientation too, to even out the effect of the orthogonal pixel grid).

3 Likes

Hi @neel,

If you mean that measuring the area of the skeleton can give you the length of the object, this is unfortunately not precisely true. There is more discussion at this thread.

For a vertical or horizontal line, length = skeleton area. But for diagonal lines, “extra” pixels have to be added to display the line in the image, making the line 2 pixels wide in some places.

You could maybe get a better estimate by taking the angle into account. Even better, since you already have a skeleton, run Analyze Skeleton. This will give you the end points, and you can get the length using the Pythagorean theorem (Euclidean distance). There are example scripts in the thread I mentioned, and others.

Hope this helps.

2 Likes

@tswayne

Thanks, for correcting my mistake. I realized that using the option “Analyze Skeleton” to determine the length of skeleton is better option than determining the area of a skeleton.

Neel

@mdoube

Thanks, for the reply. So, it means that the value 2 pixels is junk because the minimum possible value of radius of sphere is 1 pixels, and that’s why the diameter becomes two.

However, do you suggest that there is any better tool than Thickness in BoneJ to determine the weighted average thickness of a binary object?

No - I think I wasn’t clear. A skeleton has no thickness, so it makes no sense to try to measure its area, thickness or volume. Although it looks like it is ‘one pixel thick’, that doesn’t have any meaning beyond the screen representation, because single pixels don’t have volume, area, or length: they are infinitesimal. See ‘a pixel is not a little square’.

What I was trying to explain is that Local Thickness is a good algorithm for measuring thickness in binary images, but only if the feature size (the thing you are measuring) is several multiples of the pixel spacing.

1 Like