Skeleton3D: Parallel medial axis thinning of a 3D binary volume
This code calculates the 3D medial axis skeleton of an arbitrary 3d binary volume. It is an optimized MATLAB implementation of the homotopic thinning algorithm described in . We developed it to quantify the network of cell processes in bone , but it should work on images of any tubular or filamentous structures. An example volume (testvol.mat) is included, along with an example script (Test_Skeleton3D.m). Any comments, corrections or suggestions are highly welcome.
skel = Skeleton3D(bin)
where "bin" is a 3D binary image, and "skel" the resulting image containing only the skeleton voxels, or
skel = Skeleton3D(bin,mask)
to mask all foreground voxels in 'mask' from skeletonization, e.g. to preserve certain structures in a image volume.
For additional cleanup, e.g. pruning of short branches, please use my Skel2Graph3D package on MATLAB File Exchange.
This code is inspired by the ITK implementation by Hanno Homann  and the Fiji/ImageJ plugin by Ignacio Arganda-Carreras . If you include this in your own work, please cite our original publicaton .
Philip Kollmannsberger 09/2013
 Ta-Chih Lee, Rangasami L. Kashyap and Chong-Nam Chu
"Building skeleton models via 3-D medial surface/axis thinning algorithms."
Computer Vision, Graphics, and Image Processing, 56(6):462–478, 1994.
 Kollmannsberger, Kerschnitzki et al.,
"The small world of osteocytes: connectomics of the lacuno-canalicular network in bone."
New Journal of Physics 19:073019, 2017.
Kollmannsberger, Kerschnitzki et al., "The small world of osteocytes: connectomics of the lacuno-canalicular network in bone." New Journal of Physics 19:073019, 2017.
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!
Versions that use the GitHub default branch cannot be downloaded
Linked to github
Removed designation of global variables, and added H1 line for help. For cleaning noise such as short artifacts, please use my Skel2Graph3D package.