I programmed, during my thesis, a library of functions in C allowing to perform thinning on 2d and 3d images. I will soon publish my source code here (it needs some cleaning first).