72int main(
int argc,
char** argv )
74 std::string volfile = (argc > 1) ? argv[1] : (examplesPath +
"samples/cat10.vol");
76 auto params = SH3::defaultParameters() | SHG3::defaultParameters();
77 auto bimage = SH3::makeBinaryImage(volfile, params);
78 auto K = SH3::getKSpace(bimage, params);
79 auto surface = SH3::makeDigitalSurface(bimage,
K, params);
80 auto surfels = SH3::getSurfelRange(
surface);
83 double gridstep = params[
"gridstep"].as<
double>();
95 Estimator::ProbingFactory probingFactory = [&bound](
const Estimator::ProbingFrame& frame,
const SurfacePredicate& surfacePredicate) {
100 return new ProbingAlgorithm(frame.p, { frame.b1, frame.b2, frame.normal }, surfacePredicate, bound);
104 std::unordered_map<Surfel, RealPoint> preEstimations;
117 estimator.init(gridstep, surfels.begin(), surfels.end());
122 std::vector<Estimator::Quantity> quantities;
123 estimator.eval(surfels.begin(), surfels.end(), std::back_inserter(quantities));
130 for (
auto it = surfels.begin(); it != surfels.end(); ++it, ++i)
133 const Estimator::Quantity& n = quantities[i];
137 viewer.drawColor(fillColor);
141 RealPoint const& preEstimation = estimator.getPreEstimation(it);
143 viewer.drawLine(origin, origin + 1.5 * preEstimation.
getNormalized());