34#include "DGtal/base/Common.h"
35#include "DGtal/helpers/StdDefs.h"
36#include "DGtal/helpers/Shortcuts.h"
37#include "DGtal/topology/DigitalSurface2DSlice.h"
38#include "ConfigTest.h"
39#include "DGtalCatch.h"
41#include "DGtal/geometry/curves/ArithmeticalDSSComputer.h"
42#include "DGtal/geometry/surfaces/ArithmeticalDSSComputerOnSurfels.h"
43#include "DGtal/geometry/curves/SaturatedSegmentation.h"
63 std::vector<Surfel> contour;
66std::pair<KSpace, Slice>
getSlice (std::string
const& shape =
"ellipsoid",
double gridstep = 1.0)
71 params(
"polynomial", shape)(
"gridstep", gridstep);
84 auto tracker =
surface->container().newTracker(surfel);
85 SurfaceSlice surfaceSlice(tracker, dim1);
88 std::vector<Surfel> contour(surfaceSlice.begin(), surfaceSlice.end());
90 Slice slice{dim1, dim2, surfel, contour};
92 return { kspace, slice };
97 std::vector<Z2i::Point> points;
100 points.push_back(initialPoints.first);
101 points.push_back(initialPoints.second);
103 for (
auto sit = slice.contour.begin() + 1; sit != slice.contour.end(); ++sit)
107 points.push_back(pt);
119 std::tie(kspace, slice) =
getSlice();
123 SegmentationSurfels segmentationSurfels(slice.contour.begin(), slice.contour.end(), recognitionAlgorithmSurfels);
126 std::vector<Z2i::Point> points =
extractPoints(recognitionAlgorithmSurfels, slice);
130 Segmentation segmentation(points.begin(), points.end(), recognitionAlgorithm);
133 bool allEqual =
true;
134 auto segIt = segmentation.
begin();
135 auto segSurfelIt = segmentationSurfels.
begin();
136 while (segIt != segmentation.
end() && segSurfelIt != segmentationSurfels.
end()) {
138 allEqual = allEqual && (segIt->primitive() == segSurfelIt->primitive());
Aim: This class is a wrapper around ArithmeticalDSS that is devoted to the dynamic recognition of dig...
std::pair< Point, Point > getProjectedPointsFromSurfel(SCell const &aSurfel) const
Point getNextProjectedPoint(SCell const &aSurfel) const
Aim: This class is a wrapper around ArithmeticalDSS that is devoted to the dynamic recognition of dig...
Aim: Represents a 2-dimensional slice in a DigitalSurface. In a sense, it is a 4-connected contour,...
Aim: This class is a model of CCellularGridSpaceND. It represents the cubical grid as a cell complex,...
SignedKhalimskyCell< dim, Integer > SCell
typename PreCellularGridSpace::DirIterator DirIterator
Aim: Computes the saturated segmentation, that is the whole set of maximal segments within a range gi...
SaturatedSegmentation::SegmentComputerIterator end() const
SaturatedSegmentation::SegmentComputerIterator begin() const
Aim: This class is used to simplify shape and surface creation. With it, you can create new shapes an...
static KSpace getKSpace(const Point &low, const Point &up, Parameters params=parametersKSpace())
static CountedPtr< DigitizedImplicitShape3D > makeDigitizedImplicitShape3D(CountedPtr< ImplicitShape3D > shape, Parameters params=parametersDigitizedImplicitShape3D())
static CountedPtr< DigitalSurface > makeDigitalSurface(CountedPtr< TPointPredicate > bimage, const KSpace &K, const Parameters ¶ms=parametersDigitalSurface())
static Parameters defaultParameters()
static CountedPtr< BinaryImage > makeBinaryImage(Domain shapeDomain)
static CountedPtr< ImplicitShape3D > makeImplicitShape3D(const Parameters ¶ms=parametersImplicitShape3D())
static SCell findABel(const KSpace &K, const PointPredicate &pp, unsigned int nbtries=1000)
CountedPtr< SH3::DigitalSurface > surface
CountedPtr< SH3::BinaryImage > binary_image
KhalimskySpaceND< 3, Integer > KSpace
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::uint32_t Dimension
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.
std::pair< KSpace, Slice > getSlice(std::string const &shape="ellipsoid", double gridstep=1.0)
std::vector< Z2i::Point > extractPoints(SegmentComputerOnSurfels const &sc, Slice const &slice)
TEST_CASE("Testing ArithmeticalDSSComputerOnSurfels")
REQUIRE(domain.isInside(aPoint))