00001
00002
00003
00004
00005 #include "volume.h"
00006 using namespace wustl_mm::SkeletonMaker;
00007
00008 #ifndef GRAYSKELETONCPP_VOLUME_SKELETONIZER_H
00009 #define GRAYSKELETONCPP_VOLUME_SKELETONIZER_H
00010
00011 const int MAX_GAUSSIAN_FILTER_RADIUS = 10;
00012 const int DEFAULT_SKELETON_DIRECTION_RADIUS = 3;
00013
00014 namespace wustl_mm {
00015 namespace GraySkeletonCPP {
00016
00017 class VolumeSkeletonizer
00018 {
00019 public:
00020 VolumeSkeletonizer(int pointRadius, int curveRadius, int surfaceRadius, int skeletonDirectionRadius=DEFAULT_SKELETON_DIRECTION_RADIUS);
00021 ~VolumeSkeletonizer();
00022 static Volume * PerformPureJuSkeletonization(Volume * imageVol, string outputPath, double threshold, int minCurveWidth, int minSurfaceWidth);
00023
00024 static void CleanUpSkeleton(Volume * skeleton, int minNumVoxels = 4, float valueThreshold = 0.5);
00025 static void MarkSurfaces(Volume* skeleton);
00026
00027 private:
00028 static bool Are26Neighbors(Vec3<int> u, Vec3<int> v);
00029 static Volume * GetJuSurfaceSkeleton(Volume * sourceVolume, Volume * preserve, double threshold);
00030 static Volume * GetJuCurveSkeleton(Volume * sourceVolume, Volume * preserve, double threshold, bool is3D);
00031 static Volume * GetJuTopologySkeleton(Volume * sourceVolume, Volume * preserve, double threshold);
00032 static void PruneCurves(Volume * sourceVolume, int pruneLength);
00033 static void PruneSurfaces(Volume * sourceVolume, int pruneLength);
00034 static void VoxelOr(Volume * sourceAndDestVolume1, Volume * sourceVolume2);
00035 static Volume * GetJuThinning(Volume * sourceVolume, Volume * preserve, double threshold, char thinningClass);
00036
00037 static const char THINNING_CLASS_SURFACE_PRESERVATION;
00038 static const char THINNING_CLASS_CURVE_PRESERVATION_2D;
00039 static const char THINNING_CLASS_CURVE_PRESERVATION;
00040 static const char THINNING_CLASS_POINT_PRESERVATION;
00041 static const char THINNING_CLASS_TOPOLOGY_PRESERVATION;
00042 static const char PRUNING_CLASS_PRUNE_SURFACES;
00043 static const char PRUNING_CLASS_PRUNE_CURVES;
00044 static const char PRUNING_CLASS_PRUNE_POINTS;
00045
00046
00047
00048
00049
00050
00051
00052
00053 int pointRadius;
00054 int curveRadius;
00055 int surfaceRadius;
00056 int skeletonDirectionRadius;
00057 };
00058 }
00059 }
00060
00061 #endif