Tools related to skeletonization of objects.
The codes requires the ITK library to work and CMake
to build.
- Create a build directory for compilation
$ mkdir build
- Set the
ITK_DIR
variable inside theCMakeLists.txt
. The exact path will depend on the location where ITK is installed on your machine. Run following command (with appropriatepath/to/ITK
) to set the variable.
$sed -i '10s/.*/set(ITK_DIR \/path\/to\/ITK)/' CMakeLists.txt
- Change into the build directory and generate make files using cmake
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=Release ..
- Compile using
make
$ make -j2
If all goes well you should now have skeltools
executable insed the build folder.
To compute (boundary distance weighted) medial curve for dinosaur
sample image run
$ skeltool -priority distance -curve -input data/dinosaur.tif -smooth 0.2 -fillholes -outputFolder results -anchor aof
If everything runs without errors you should see dinosaur_distance_curve.tif
inside results
folder.
To compute medial surface for dinosaur
sample image run
$ skeltool -priority distance -surface -input data/dinosaur.tif -smooth 0.1 -fillholes -output results/dino_surface.tif -anchor aof
The output of the above command should be the medial surface dino_surface.tif
inside the results
folder.
MapToBoundaryImageFilter
can be used to map features (for example object width) from medial surface to the object boundary. Example
map-medial-thickness-to-boundary.cpp
computes object width weighted medial skeleton of `dinosaur.tif' and maps it back to
the boundary.
[1] Siddiqi, K., Bouix, S., Tannenbaum, A., & Zucker, S. W. (2002). Hamilton-jacobi skeletons. International Journal of Computer Vision, 48, 215-231.
[2] Dimitrov, P., Damon, J. N., & Siddiqi, K. (2003, June). Flux invariants for shape. In 2003 IEEE Computer Society Conference on Computer Vision and Pattern Recognition, 2003. Proceedings. (Vol. 1, pp. I-I). IEEE.
[3] Siddiqi, K., & Pizer, S. (Eds.). (2008). Medial representations: mathematics, algorithms and applications (Vol. 37). Springer Science & Business Media.