72int main(
int argc,
char** argv )
74 QApplication application(argc, argv);
76 std::string volfile = (argc > 1) ? argv[1] : (examplesPath +
"samples/cat10.vol");
78 auto params = SH3::defaultParameters() | SHG3::defaultParameters();
79 auto bimage = SH3::makeBinaryImage(volfile, params);
80 auto K = SH3::getKSpace(bimage, params);
81 auto surface = SH3::makeDigitalSurface(bimage,
K, params);
82 auto surfels = SH3::getSurfelRange(
surface);
85 double gridstep = params[
"gridstep"].as<
double>();
99 Estimator::ProbingFactory probingFactory = [&bound](
const Estimator::ProbingFrame& frame,
const SurfacePredicate& surfacePredicate) {
104 return new ProbingAlgorithm(frame.p, { frame.b1, frame.b2, frame.normal }, surfacePredicate, bound);
108 std::unordered_map<Surfel, RealPoint> preEstimations;
121 estimator.init(gridstep, surfels.begin(), surfels.end());
126 std::vector<Estimator::Quantity> quantities;
127 estimator.eval(surfels.begin(), surfels.end(), std::back_inserter(quantities));
133 Color fillColor = viewer.getFillColor();
136 for (
auto it = surfels.begin(); it != surfels.end(); ++it, ++i)
139 const Estimator::Quantity& n = quantities[i];
143 viewer.setFillColor(fillColor);
147 RealPoint const& preEstimation = estimator.getPreEstimation(it);
149 viewer.addLine(origin, origin + 1.5 * preEstimation.
getNormalized(), 0.3);
153 viewer.addLine(origin, origin + 1.5 * n.
getNormalized(), 0.3);
156 viewer << Viewer3D<>::updateDisplay;