Thinning algorithms for three-dimensional gray images and their application to medicalimages with comparative evaluation of performanc