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
$ skeltools -priority distance -curve -input data/dinosaur.tif -smooth 0.2 -fillholes -outputFolder results
If everything runs without errors you should see dinosaur_distance_curve.tif
inside results
folder.
To compute medial surface for dinosaur
sample image run
$ skeltools -priority distance -surface -input data/dinosaur.tif -smooth 0.1 -fillholes -output results/dino_surface.tif
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.