Open Source Implementation of 3D Thinning algorithm I am looking for open source implementation of thinning algorithm in 3D. 


  Thinning algorithm: Convert binary shapes to 1-pixel wide lines, without shortening it or breaking it apart. For example, the thresholded version of hand written or printed alphanumerics can be thinned for better represetation and further processing.


This particular thinning algorithm I am looking for does not disconnect an object or split an object up into multiple parts. Moreover, it does not shorten the shape. 

Are there such source codes available? If 3D is not available, 2D is fine too. I can take it from there.

UPDATE:

Somebody has requested me to elaborate on what am I after. Here:  http://www.mip.sdu.dk/ipl98/how_to_use_ipl98/tutorial/node52.html There are several images in the link here on thinning and skeletonization. I can see that thinned algorithm and skeletonization algorithm produce similar yet different result. But what I am after is to have all shapes in a binary image to become thinned without shortening the shape. To clarify things further, here is what I wanted:

This is original image:



This is skeleton image:



This is thinned image:



As you can see, skeleton image and thinned image have different results. Thinned image has lesser lines and produce an outline that looks more like the thinned original. But these images are in 2D, I am looking for an algorithm to do thinned binary image in 3D.
If you would be happy with 3D skeleton and are looking for a Java implementation, there a popular image processing package in Life Science called ImageJ. In a distribution of ImageJ called Fiji, you will find a solid implementation by Ignacio Arganda-Carreras.

Check here: http://fiji.sc/wiki/index.php/Skeletonize3D. You will find a link to the source as well as links to tutorials.

Here is video describing how to use it from with the Fiji software: http://fiji.sc/wiki/index.php/Skeleton_analysis_video_tutorial