DGtal  1.0.0
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions
DGtal::ShortcutsGeometry< TKSpace > Class Template Reference

Aim: This class is used to simplify shape and surface creation. With it, you can create new shapes and surface in a few lines. The drawback is that you use specific types or objects, which could lead to faster code or more compact data structures. More...

#include <DGtal/helpers/ShortcutsGeometry.h>

Inheritance diagram for DGtal::ShortcutsGeometry< TKSpace >:
[legend]
Collaboration diagram for DGtal::ShortcutsGeometry< TKSpace >:
[legend]

Public Types

typedef Shortcuts< TKSpace > Base
 
typedef ShortcutsGeometry< TKSpace > Self
 
typedef TKSpace KSpace
 Digital cellular space. More...
 
typedef KSpace::Space Space
 Digital space. More...
 
typedef Space::Integer Integer
 Integer numbers. More...
 
typedef Space::Point Point
 Point with integer coordinates. More...
 
typedef Space::Vector Vector
 Vector with integer coordinates. More...
 
typedef Space::RealVector RealVector
 Vector with floating-point coordinates. More...
 
typedef Space::RealPoint RealPoint
 Point with floating-point coordinates. More...
 
typedef RealVector::Component Scalar
 Floating-point numbers. More...
 
typedef HyperRectDomain< SpaceDomain
 An (hyper-)rectangular domain. More...
 
typedef unsigned char GrayScale
 The type for 8-bits gray-scale elements. More...
 
typedef MPolynomial< Space::dimension, ScalarScalarPolynomial
 defines a multi-variate polynomial : RealPoint -> Scalar More...
 
typedef ImplicitPolynomial3Shape< SpaceImplicitShape3D
 
typedef GaussDigitizer< Space, ImplicitShape3DDigitizedImplicitShape3D
 defines the digitization of an implicit shape. More...
 
typedef ImageContainerBySTLVector< Domain, bool > BinaryImage
 defines a black and white image with (hyper-)rectangular domain. More...
 
typedef ImageContainerBySTLVector< Domain, GrayScaleGrayScaleImage
 defines a grey-level image with (hyper-)rectangular domain. More...
 
typedef ImageContainerBySTLVector< Domain, float > FloatImage
 defines a float image with (hyper-)rectangular domain. More...
 
typedef ImageContainerBySTLVector< Domain, double > DoubleImage
 defines a double image with (hyper-)rectangular domain. More...
 
typedef KSpace::SurfelSet SurfelSet
 defines a set of surfels More...
 
typedef LightImplicitDigitalSurface< KSpace, BinaryImageLightSurfaceContainer
 
typedef ::DGtal::DigitalSurface< LightSurfaceContainerLightDigitalSurface
 defines a connected digital surface over a binary image. More...
 
typedef SetOfSurfels< KSpace, SurfelSetExplicitSurfaceContainer
 defines a heavy container that represents any digital surface. More...
 
typedef ::DGtal::DigitalSurface< ExplicitSurfaceContainerDigitalSurface
 defines an arbitrary digital surface over a binary image. More...
 
typedef IndexedDigitalSurface< ExplicitSurfaceContainerIdxDigitalSurface
 defines a connected or not indexed digital surface. More...
 
typedef LightDigitalSurface::Surfel Surfel
 
typedef LightDigitalSurface::Cell Cell
 
typedef LightDigitalSurface::SCell SCell
 
typedef LightDigitalSurface::Vertex Vertex
 
typedef LightDigitalSurface::Arc Arc
 
typedef LightDigitalSurface::Face Face
 
typedef LightDigitalSurface::ArcRange ArcRange
 
typedef IdxDigitalSurface::Vertex IdxSurfel
 
typedef IdxDigitalSurface::Vertex IdxVertex
 
typedef IdxDigitalSurface::Arc IdxArc
 
typedef IdxDigitalSurface::ArcRange IdxArcRange
 
typedef std::set< IdxSurfelIdxSurfelSet
 
typedef std::vector< SurfelSurfelRange
 
typedef std::vector< CellCellRange
 
typedef std::vector< IdxSurfelIdxSurfelRange
 
typedef std::vector< ScalarScalars
 
typedef std::vector< RealVectorRealVectors
 
typedef std::vector< RealPointRealPoints
 
typedef ::DGtal::Statistic< ScalarScalarStatistic
 
typedef sgf::ShapePositionFunctor< ImplicitShape3DPositionFunctor
 
typedef sgf::ShapeNormalVectorFunctor< ImplicitShape3DNormalFunctor
 
typedef sgf::ShapeMeanCurvatureFunctor< ImplicitShape3DMeanCurvatureFunctor
 
typedef sgf::ShapeGaussianCurvatureFunctor< ImplicitShape3DGaussianCurvatureFunctor
 
typedef TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, PositionFunctorTruePositionEstimator
 
typedef TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, NormalFunctorTrueNormalEstimator
 
typedef TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, MeanCurvatureFunctorTrueMeanCurvatureEstimator
 
typedef TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, GaussianCurvatureFunctorTrueGaussianCurvatureEstimator
 
typedef ::DGtal::Mesh< RealPointMesh
 
typedef ::DGtal::TriangulatedSurface< RealPointTriangulatedSurface
 
typedef ::DGtal::PolygonalSurface< RealPointPolygonalSurface
 
typedef std::map< Surfel, IdxSurfelSurfel2Index
 
typedef std::map< Cell, IdxVertexCell2Index
 
- Public Types inherited from DGtal::Shortcuts< TKSpace >
typedef TKSpace KSpace
 Digital cellular space. More...
 
typedef KSpace::Space Space
 Digital space. More...
 
typedef Space::Integer Integer
 Integer numbers. More...
 
typedef Space::Point Point
 Point with integer coordinates. More...
 
typedef Space::Vector Vector
 Vector with integer coordinates. More...
 
typedef Space::RealVector RealVector
 Vector with floating-point coordinates. More...
 
typedef Space::RealPoint RealPoint
 Point with floating-point coordinates. More...
 
typedef RealVector::Component Scalar
 Floating-point numbers. More...
 
typedef HyperRectDomain< SpaceDomain
 An (hyper-)rectangular domain. More...
 
typedef unsigned char GrayScale
 The type for 8-bits gray-scale elements. More...
 
typedef MPolynomial< Space::dimension, ScalarScalarPolynomial
 defines a multi-variate polynomial : RealPoint -> Scalar More...
 
typedef ImplicitPolynomial3Shape< SpaceImplicitShape3D
 
typedef GaussDigitizer< Space, ImplicitShape3DDigitizedImplicitShape3D
 defines the digitization of an implicit shape. More...
 
typedef ImageContainerBySTLVector< Domain, bool > BinaryImage
 defines a black and white image with (hyper-)rectangular domain. More...
 
typedef ImageContainerBySTLVector< Domain, GrayScaleGrayScaleImage
 defines a grey-level image with (hyper-)rectangular domain. More...
 
typedef ImageContainerBySTLVector< Domain, float > FloatImage
 defines a float image with (hyper-)rectangular domain. More...
 
typedef ImageContainerBySTLVector< Domain, double > DoubleImage
 defines a double image with (hyper-)rectangular domain. More...
 
typedef KSpace::SurfelSet SurfelSet
 defines a set of surfels More...
 
typedef LightImplicitDigitalSurface< KSpace, BinaryImageLightSurfaceContainer
 
typedef ::DGtal::DigitalSurface< LightSurfaceContainerLightDigitalSurface
 defines a connected digital surface over a binary image. More...
 
typedef SetOfSurfels< KSpace, SurfelSetExplicitSurfaceContainer
 defines a heavy container that represents any digital surface. More...
 
typedef ::DGtal::DigitalSurface< ExplicitSurfaceContainerDigitalSurface
 defines an arbitrary digital surface over a binary image. More...
 
typedef IndexedDigitalSurface< ExplicitSurfaceContainerIdxDigitalSurface
 defines a connected or not indexed digital surface. More...
 
typedef LightDigitalSurface::Surfel Surfel
 
typedef LightDigitalSurface::Cell Cell
 
typedef LightDigitalSurface::SCell SCell
 
typedef LightDigitalSurface::Vertex Vertex
 
typedef LightDigitalSurface::Arc Arc
 
typedef LightDigitalSurface::Face Face
 
typedef LightDigitalSurface::ArcRange ArcRange
 
typedef IdxDigitalSurface::Vertex IdxSurfel
 
typedef IdxDigitalSurface::Vertex IdxVertex
 
typedef IdxDigitalSurface::Arc IdxArc
 
typedef IdxDigitalSurface::ArcRange IdxArcRange
 
typedef std::set< IdxSurfelIdxSurfelSet
 
typedef std::vector< SCellSCellRange
 
typedef std::vector< CellCellRange
 
typedef CellRange PointelRange
 
typedef SCellRange SurfelRange
 
typedef std::vector< IdxSurfelIdxSurfelRange
 
typedef std::vector< ScalarScalars
 
typedef std::vector< RealVectorRealVectors
 
typedef std::vector< RealPointRealPoints
 
typedef IdxVertex Idx
 
typedef std::vector< IdxVertexIdxRange
 
typedef ::DGtal::Mesh< RealPointMesh
 
typedef ::DGtal::TriangulatedSurface< RealPointTriangulatedSurface
 
typedef ::DGtal::PolygonalSurface< RealPointPolygonalSurface
 
typedef std::map< Surfel, IdxSurfelSurfel2Index
 
typedef std::map< Cell, IdxVertexCell2Index
 
typedef ::DGtal::Color Color
 
typedef std::vector< ColorColors
 
typedef GradientColorMap< ScalarColorMap
 
typedef TickedColorMap< Scalar, ColorMapZeroTickedColorMap
 

Public Member Functions

 ShortcutsGeometry ()=delete
 
 ~ShortcutsGeometry ()=delete
 
 ShortcutsGeometry (const ShortcutsGeometry &other)=delete
 
 ShortcutsGeometry (ShortcutsGeometry &&other)=delete
 
ShortcutsGeometryoperator= (const ShortcutsGeometry &other)=delete
 
ShortcutsGeometryoperator= (ShortcutsGeometry &&other)=delete
 
- Public Member Functions inherited from DGtal::Shortcuts< TKSpace >
 Shortcuts ()=delete
 
 ~Shortcuts ()=delete
 
 Shortcuts (const Shortcuts &other)=delete
 
 Shortcuts (Shortcuts &&other)=delete
 
Shortcutsoperator= (const Shortcuts &other)=delete
 
Shortcutsoperator= (Shortcuts &&other)=delete
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Static Public Member Functions

static Parameters defaultParameters ()
 
static Parameters parametersShapeGeometry ()
 
static RealPoints getPositions (CountedPtr< ImplicitShape3D > shape, const KSpace &K, const SurfelRange &surfels, const Parameters &params=parametersShapeGeometry())
 
static RealPoints getPositions (CountedPtr< ImplicitShape3D > shape, const RealPoints &points, const Parameters &params=parametersShapeGeometry())
 
static RealVectors getNormalVectors (CountedPtr< ImplicitShape3D > shape, const KSpace &K, const SurfelRange &surfels, const Parameters &params=parametersShapeGeometry())
 
static Scalars getMeanCurvatures (CountedPtr< ImplicitShape3D > shape, const KSpace &K, const SurfelRange &surfels, const Parameters &params=parametersShapeGeometry())
 
static Scalars getGaussianCurvatures (CountedPtr< ImplicitShape3D > shape, const KSpace &K, const SurfelRange &surfels, const Parameters &params=parametersShapeGeometry())
 
static Parameters parametersGeometryEstimation ()
 
static RealVectors getTrivialNormalVectors (const KSpace &K, const SurfelRange &surfels)
 
template<typename TAnyDigitalSurface >
static RealVectors getCTrivialNormalVectors (CountedPtr< TAnyDigitalSurface > surface, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation())
 
template<typename TAnyDigitalSurface >
static RealVectors getVCMNormalVectors (CountedPtr< TAnyDigitalSurface > surface, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation())
 
static RealVectors getIINormalVectors (CountedPtr< BinaryImage > bimage, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace())
 
static RealVectors getIINormalVectors (CountedPtr< DigitizedImplicitShape3D > dshape, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace()|parametersDigitizedImplicitShape3D())
 
template<typename TPointPredicate >
static RealVectors getIINormalVectors (const TPointPredicate &shape, const KSpace &K, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace())
 
static Scalars getIIMeanCurvatures (CountedPtr< BinaryImage > bimage, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace())
 
static Scalars getIIMeanCurvatures (CountedPtr< DigitizedImplicitShape3D > dshape, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace()|parametersDigitizedImplicitShape3D())
 
template<typename TPointPredicate >
static Scalars getIIMeanCurvatures (const TPointPredicate &shape, const KSpace &K, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace())
 
static Scalars getIIGaussianCurvatures (CountedPtr< BinaryImage > bimage, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace())
 
static Scalars getIIGaussianCurvatures (CountedPtr< DigitizedImplicitShape3D > dshape, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace()|parametersDigitizedImplicitShape3D())
 
template<typename TPointPredicate >
static Scalars getIIGaussianCurvatures (const TPointPredicate &shape, const KSpace &K, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace())
 
static void orientVectors (RealVectors &v, const RealVectors &ref_v)
 
static ScalarStatistic getStatistic (const Scalars &v)
 
static Scalars getVectorsAngleDeviation (const RealVectors &v1, const RealVectors &v2)
 
static Scalars getScalarsAbsoluteDifference (const Scalars &v1, const Scalars &v2)
 
static Scalar getScalarsNormL2 (const Scalars &v1, const Scalars &v2)
 
static Scalar getScalarsNormL1 (const Scalars &v1, const Scalars &v2)
 
static Scalar getScalarsNormLoo (const Scalars &v1, const Scalars &v2)
 
static Parameters parametersKSpace ()
 
static KSpace getKSpace (const Point &low, const Point &up, Parameters params=parametersKSpace())
 
static KSpace getKSpace (CountedPtr< BinaryImage > bimage, Parameters params=parametersKSpace())
 
static KSpace getKSpace (CountedPtr< GrayScaleImage > gimage, Parameters params=parametersKSpace())
 
template<typename TDigitalSurfaceContainer >
static KSpace getKSpace (CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > surface)
 
template<typename TDigitalSurfaceContainer >
static KSpace getKSpace (CountedPtr< ::DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer > > surface)
 
static KSpace getKSpace (Parameters params=parametersKSpace()|parametersDigitizedImplicitShape3D())
 
static Parameters parametersDigitizedImplicitShape3D ()
 
- Static Public Member Functions inherited from DGtal::Shortcuts< TKSpace >
static Parameters defaultParameters ()
 
static std::map< std::string, std::string > getPolynomialList ()
 
static Parameters parametersImplicitShape3D ()
 
static CountedPtr< ImplicitShape3DmakeImplicitShape3D (const Parameters &params=parametersImplicitShape3D())
 
static Parameters parametersKSpace ()
 
static KSpace getKSpace (const Point &low, const Point &up, Parameters params=parametersKSpace())
 
static KSpace getKSpace (CountedPtr< BinaryImage > bimage, Parameters params=parametersKSpace())
 
static KSpace getKSpace (CountedPtr< GrayScaleImage > gimage, Parameters params=parametersKSpace())
 
template<typename TDigitalSurfaceContainer >
static KSpace getKSpace (CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > surface)
 
template<typename TDigitalSurfaceContainer >
static KSpace getKSpace (CountedPtr< ::DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer > > surface)
 
template<typename TDigitalSurfaceContainer >
static const KSpacerefKSpace (CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > surface)
 
template<typename TDigitalSurfaceContainer >
static const KSpacerefKSpace (CountedPtr< ::DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer > > surface)
 
static CanonicCellEmbedder< KSpacegetCellEmbedder (const KSpace &K)
 
static CanonicSCellEmbedder< KSpacegetSCellEmbedder (const KSpace &K)
 
static Parameters parametersDigitizedImplicitShape3D ()
 
static KSpace getKSpace (Parameters params=parametersKSpace()|parametersDigitizedImplicitShape3D())
 
static CountedPtr< DigitizedImplicitShape3DmakeDigitizedImplicitShape3D (CountedPtr< ImplicitShape3D > shape, Parameters params=parametersDigitizedImplicitShape3D())
 
static Parameters parametersBinaryImage ()
 
static CountedPtr< BinaryImagemakeBinaryImage (Domain shapeDomain)
 
static CountedPtr< BinaryImagemakeBinaryImage (CountedPtr< DigitizedImplicitShape3D > shape_digitization, Parameters params=parametersBinaryImage())
 
static CountedPtr< BinaryImagemakeBinaryImage (CountedPtr< DigitizedImplicitShape3D > shape_digitization, Domain shapeDomain, Parameters params=parametersBinaryImage())
 
static CountedPtr< BinaryImagemakeBinaryImage (CountedPtr< BinaryImage > bimage, Parameters params=parametersBinaryImage())
 
static CountedPtr< BinaryImagemakeBinaryImage (std::string input, Parameters params=parametersBinaryImage())
 
static CountedPtr< BinaryImagemakeBinaryImage (CountedPtr< GrayScaleImage > gray_scale_image, Parameters params=parametersBinaryImage())
 
static bool saveBinaryImage (CountedPtr< BinaryImage > bimage, std::string output)
 
static Parameters parametersGrayScaleImage ()
 
static CountedPtr< GrayScaleImagemakeGrayScaleImage (Domain aDomain)
 
static CountedPtr< GrayScaleImagemakeGrayScaleImage (std::string input)
 
static CountedPtr< GrayScaleImagemakeGrayScaleImage (CountedPtr< BinaryImage > binary_image, std::function< GrayScale(bool) > const &bool2grayscale=[](bool v) { return v ?(unsigned char) 255 :(unsigned char) 0;})
 
static bool saveGrayScaleImage (CountedPtr< GrayScaleImage > gray_scale_image, std::string output)
 
static CountedPtr< GrayScaleImagemakeGrayScaleImage (CountedPtr< FloatImage > fimage, Parameters params=parametersGrayScaleImage())
 
static CountedPtr< GrayScaleImagemakeGrayScaleImage (CountedPtr< DoubleImage > fimage, Parameters params=parametersGrayScaleImage())
 
static CountedPtr< FloatImagemakeFloatImage (Domain aDomain)
 
static CountedPtr< FloatImagemakeFloatImage (std::string input)
 
static CountedPtr< FloatImagemakeFloatImage (CountedPtr< ImplicitShape3D > shape, Parameters params=parametersDigitizedImplicitShape3D())
 
static CountedPtr< DoubleImagemakeDoubleImage (Domain aDomain)
 
static CountedPtr< DoubleImagemakeDoubleImage (std::string input)
 
static CountedPtr< DoubleImagemakeDoubleImage (CountedPtr< ImplicitShape3D > shape, Parameters params=parametersDigitizedImplicitShape3D())
 
static Parameters parametersDigitalSurface ()
 
template<typename TDigitalSurfaceContainer >
static CanonicCellEmbedder< KSpacegetCellEmbedder (CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > surface)
 
template<typename TDigitalSurfaceContainer >
static CanonicSCellEmbedder< KSpacegetSCellEmbedder (CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > surface)
 
template<typename TDigitalSurfaceContainer >
static CanonicCellEmbedder< KSpacegetCellEmbedder (CountedPtr< ::DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer > > surface)
 
template<typename TDigitalSurfaceContainer >
static CanonicSCellEmbedder< KSpacegetSCellEmbedder (CountedPtr< ::DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer > > surface)
 
static CountedPtr< LightDigitalSurfacemakeLightDigitalSurface (CountedPtr< BinaryImage > bimage, const KSpace &K, const Parameters &params=parametersDigitalSurface())
 
static std::vector< CountedPtr< LightDigitalSurface > > makeLightDigitalSurfaces (CountedPtr< BinaryImage > bimage, const KSpace &K, const Parameters &params=parametersDigitalSurface())
 
static std::vector< CountedPtr< LightDigitalSurface > > makeLightDigitalSurfaces (SurfelRange &surfel_reps, CountedPtr< BinaryImage > bimage, const KSpace &K, const Parameters &params=parametersDigitalSurface())
 
template<typename TPointPredicate >
static CountedPtr< DigitalSurfacemakeDigitalSurface (CountedPtr< TPointPredicate > bimage, const KSpace &K, const Parameters &params=parametersDigitalSurface())
 
static CountedPtr< DigitalSurfacemakeDigitalSurface (CountedPtr< IdxDigitalSurface > idx_surface, const Parameters &params=parametersDigitalSurface())
 
static CountedPtr< IdxDigitalSurfacemakeIdxDigitalSurface (CountedPtr< BinaryImage > bimage, const KSpace &K, const Parameters &params=parametersDigitalSurface())
 
template<typename TSurfelRange >
static CountedPtr< IdxDigitalSurfacemakeIdxDigitalSurface (const TSurfelRange &surfels, ConstAlias< KSpace > K, const Parameters &params=parametersDigitalSurface())
 
template<typename TDigitalSurfaceContainer >
static CountedPtr< IdxDigitalSurfacemakeIdxDigitalSurface (CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > surface, const Parameters &params=parametersDigitalSurface())
 
static CountedPtr< IdxDigitalSurfacemakeIdxDigitalSurface (const std::vector< CountedPtr< LightDigitalSurface > > &surfaces, const Parameters &params=parametersDigitalSurface())
 
template<typename TDigitalSurfaceContainer >
static PointelRange getPointelRange (Cell2Index &c2i, CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > surface)
 
template<typename TDigitalSurfaceContainer >
static PointelRange getPointelRange (CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > surface)
 
static PointelRange getPointelRange (const KSpace &K, const SCell &surfel)
 
template<typename TDigitalSurfaceContainer >
static SurfelRange getSurfelRange (CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > surface, const Parameters &params=parametersDigitalSurface())
 
template<typename TDigitalSurfaceContainer >
static SurfelRange getSurfelRange (CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > surface, const Surfel &start_surfel, const Parameters &params=parametersDigitalSurface())
 
static IdxSurfelRange getIdxSurfelRange (CountedPtr< IdxDigitalSurface > surface, const Parameters &params=parametersDigitalSurface())
 
static IdxSurfelRange getIdxSurfelRange (CountedPtr< IdxDigitalSurface > surface, const IdxSurfel &start_surfel, const Parameters &params=parametersDigitalSurface())
 
template<typename TDigitalSurfaceContainer , typename TCellEmbedder >
static bool saveOBJ (CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > digsurf, const TCellEmbedder &embedder, const RealVectors &normals, const Colors &diffuse_colors, std::string objfile, const Color &ambient_color=Color(32, 32, 32), const Color &diffuse_color=Color(200, 200, 255), const Color &specular_color=Color::White)
 
template<typename TDigitalSurfaceContainer >
static bool saveOBJ (CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > digsurf, const RealVectors &normals, const Colors &diffuse_colors, std::string objfile, const Color &ambient_color=Color(32, 32, 32), const Color &diffuse_color=Color(200, 200, 255), const Color &specular_color=Color::White)
 
template<typename TDigitalSurfaceContainer >
static bool saveOBJ (CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > digsurf, std::string objfile, const Color &ambient_color=Color(32, 32, 32), const Color &diffuse_color=Color(200, 200, 255), const Color &specular_color=Color::White)
 
static Parameters parametersMesh ()
 
static CountedPtr< TriangulatedSurfacemakeTriangulatedSurface (CountedPtr< Mesh > aMesh)
 
static CountedPtr< MeshmakeMesh (CountedPtr< TriangulatedSurface > triSurf, const Color &aColor=Color::White)
 
static CountedPtr< MeshmakeMesh (CountedPtr< PolygonalSurface > polySurf, const Color &aColor=Color::White)
 
template<typename TContainer >
static CountedPtr< TriangulatedSurfacemakeTriangulatedSurface (Surfel2Index &s2i, CountedPtr< ::DGtal::DigitalSurface< TContainer > > aSurface)
 
template<typename TContainer >
static CountedPtr< TriangulatedSurfacemakeTriangulatedSurface (CountedPtr< ::DGtal::DigitalSurface< TContainer > > aSurface)
 
static CountedPtr< TriangulatedSurfacemakeTriangulatedSurface (CountedPtr< PolygonalSurface > polySurf, const Parameters &params=parametersMesh())
 
static CountedPtr< PolygonalSurfacemakePolygonalSurface (CountedPtr< Mesh > aMesh)
 
static CountedPtr< PolygonalSurfacemakePolygonalSurface (CountedPtr< GrayScaleImage > gray_scale_image, const Parameters &params=parametersKSpace()|parametersBinaryImage()|parametersDigitalSurface())
 
static CountedPtr< TriangulatedSurfacemakeTriangulatedSurface (CountedPtr< GrayScaleImage > gray_scale_image, const Parameters &params=parametersKSpace()|parametersBinaryImage()|parametersDigitalSurface())
 
template<typename TContainer >
static CountedPtr< PolygonalSurfacemakeDualPolygonalSurface (Surfel2Index &s2i, CountedPtr< ::DGtal::DigitalSurface< TContainer > > aSurface)
 
template<typename TContainer >
static CountedPtr< PolygonalSurfacemakeDualPolygonalSurface (CountedPtr< ::DGtal::DigitalSurface< TContainer > > aSurface)
 
template<typename TContainer >
static CountedPtr< PolygonalSurfacemakeDualPolygonalSurface (CountedPtr< ::DGtal::IndexedDigitalSurface< TContainer > > aSurface)
 
template<typename TContainer >
static CountedPtr< PolygonalSurfacemakePrimalPolygonalSurface (Cell2Index &c2i, CountedPtr< ::DGtal::DigitalSurface< TContainer > > aSurface)
 
template<typename TContainer >
static CountedPtr< PolygonalSurfacemakePrimalPolygonalSurface (CountedPtr< ::DGtal::DigitalSurface< TContainer > > aSurface)
 
template<typename TContainer >
static CountedPtr< PolygonalSurfacemakePrimalPolygonalSurface (CountedPtr< ::DGtal::IndexedDigitalSurface< TContainer > > aSurface)
 
template<typename TPoint >
static bool saveOBJ (CountedPtr< ::DGtal::PolygonalSurface< TPoint > > polysurf, const std::string &objfile)
 
template<typename TPoint >
static bool saveOBJ (CountedPtr< ::DGtal::TriangulatedSurface< TPoint > > trisurf, const std::string &objfile)
 
template<typename TPoint >
static bool saveOBJ (CountedPtr< ::DGtal::PolygonalSurface< TPoint > > polysurf, const RealVectors &normals, const Colors &diffuse_colors, std::string objfile, const Color &ambient_color=Color(32, 32, 32), const Color &diffuse_color=Color(200, 200, 255), const Color &specular_color=Color::White)
 
template<typename TPoint >
static bool saveOBJ (CountedPtr< ::DGtal::TriangulatedSurface< TPoint > > trisurf, const RealVectors &normals, const Colors &diffuse_colors, std::string objfile, const Color &ambient_color=Color(32, 32, 32), const Color &diffuse_color=Color(200, 200, 255), const Color &specular_color=Color::White)
 
static Parameters parametersUtilities ()
 
template<typename TValue >
static IdxRange getRangeMatch (const std::vector< TValue > &s1, const std::vector< TValue > &s2, bool perfect=false)
 
template<typename TValue >
static std::vector< TValue > getMatchedRange (const std::vector< TValue > &range, const IdxRange &match)
 
static ColorMap getColorMap (Scalar min, Scalar max, const Parameters &params=parametersUtilities())
 
static ZeroTickedColorMap getZeroTickedColorMap (Scalar min, Scalar max, const Parameters &params=parametersUtilities())
 
template<typename TCellEmbedder = CanonicCellEmbedder< KSpace >>
static bool outputSurfelsAsObj (std::ostream &output, const SurfelRange &surfels, const TCellEmbedder &embedder)
 
template<typename TAnyDigitalSurface >
static bool outputPrimalDigitalSurfaceAsObj (std::ostream &output, CountedPtr< TAnyDigitalSurface > surface)
 
template<typename TAnyDigitalSurface , typename TCellEmbedder = CanonicCellEmbedder< KSpace >>
static bool outputPrimalDigitalSurfaceAsObj (std::ostream &output, CountedPtr< TAnyDigitalSurface > surface, const TCellEmbedder &embedder)
 
static bool outputPrimalIdxDigitalSurfaceAsObj (std::ostream &output, CountedPtr< IdxDigitalSurface > surface)
 
template<typename TCellEmbedder = CanonicCellEmbedder< KSpace >>
static bool outputPrimalIdxDigitalSurfaceAsObj (std::ostream &output, CountedPtr< IdxDigitalSurface > surface, const TCellEmbedder &embedder)
 
template<typename TDigitalSurfaceContainer >
static bool outputDualDigitalSurfaceAsObj (std::ostream &output, CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > surface, const Parameters &params=parametersMesh())
 
template<typename TDigitalSurfaceContainer , typename TCellEmbedder = CanonicCellEmbedder< KSpace >>
static bool outputDualDigitalSurfaceAsObj (std::ostream &output, CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > surface, const TCellEmbedder &embedder, const Parameters &params=parametersMesh())
 
template<typename TSCellMap , typename TValueWriter >
static bool outputSCellMapAsCSV (std::ostream &output, const KSpace &K, const TSCellMap &anyMap, const TValueWriter &writer)
 
template<typename TCellMap , typename TValueWriter >
static bool outputCellMapAsCSV (std::ostream &output, const KSpace &K, const TCellMap &anyMap, const TValueWriter &writer)
 
static CellRange getPrimalVertices (const KSpace &K, const SCell &s)
 
static CellRange getPrimalVertices (const KSpace &K, const Surfel &s, bool ccw)
 

Private Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CCellularGridSpaceND< TKSpace >))
 

Detailed Description

template<typename TKSpace>
class DGtal::ShortcutsGeometry< TKSpace >

Aim: This class is used to simplify shape and surface creation. With it, you can create new shapes and surface in a few lines. The drawback is that you use specific types or objects, which could lead to faster code or more compact data structures.

Description of template class 'ShortcutsGeometry'

Template Parameters
TKSpaceany cellular grid space, a model of concepts::CCellularGridSpaceND like KhalimskySpaceND.

Definition at line 70 of file ShortcutsGeometry.h.

Member Typedef Documentation

◆ Arc

template<typename TKSpace >
typedef LightDigitalSurface::Arc DGtal::ShortcutsGeometry< TKSpace >::Arc

Definition at line 138 of file ShortcutsGeometry.h.

◆ ArcRange

template<typename TKSpace >
typedef LightDigitalSurface::ArcRange DGtal::ShortcutsGeometry< TKSpace >::ArcRange

Definition at line 140 of file ShortcutsGeometry.h.

◆ Base

template<typename TKSpace >
typedef Shortcuts< TKSpace > DGtal::ShortcutsGeometry< TKSpace >::Base

Definition at line 74 of file ShortcutsGeometry.h.

◆ BinaryImage

template<typename TKSpace >
typedef ImageContainerBySTLVector<Domain, bool> DGtal::ShortcutsGeometry< TKSpace >::BinaryImage

defines a black and white image with (hyper-)rectangular domain.

Definition at line 114 of file ShortcutsGeometry.h.

◆ Cell

template<typename TKSpace >
typedef LightDigitalSurface::Cell DGtal::ShortcutsGeometry< TKSpace >::Cell

Definition at line 135 of file ShortcutsGeometry.h.

◆ Cell2Index

template<typename TKSpace >
typedef std::map<Cell, IdxVertex> DGtal::ShortcutsGeometry< TKSpace >::Cell2Index

Definition at line 172 of file ShortcutsGeometry.h.

◆ CellRange

template<typename TKSpace >
typedef std::vector< Cell > DGtal::ShortcutsGeometry< TKSpace >::CellRange

Definition at line 147 of file ShortcutsGeometry.h.

◆ DigitalSurface

template<typename TKSpace >
typedef ::DGtal::DigitalSurface< ExplicitSurfaceContainer > DGtal::ShortcutsGeometry< TKSpace >::DigitalSurface

defines an arbitrary digital surface over a binary image.

Definition at line 131 of file ShortcutsGeometry.h.

◆ DigitizedImplicitShape3D

template<typename TKSpace >
typedef GaussDigitizer< Space, ImplicitShape3D > DGtal::ShortcutsGeometry< TKSpace >::DigitizedImplicitShape3D

defines the digitization of an implicit shape.

Definition at line 112 of file ShortcutsGeometry.h.

◆ Domain

template<typename TKSpace >
typedef HyperRectDomain<Space> DGtal::ShortcutsGeometry< TKSpace >::Domain

An (hyper-)rectangular domain.

Definition at line 100 of file ShortcutsGeometry.h.

◆ DoubleImage

template<typename TKSpace >
typedef ImageContainerBySTLVector<Domain, double> DGtal::ShortcutsGeometry< TKSpace >::DoubleImage

defines a double image with (hyper-)rectangular domain.

Definition at line 120 of file ShortcutsGeometry.h.

◆ ExplicitSurfaceContainer

template<typename TKSpace >
typedef SetOfSurfels< KSpace, SurfelSet > DGtal::ShortcutsGeometry< TKSpace >::ExplicitSurfaceContainer

defines a heavy container that represents any digital surface.

Definition at line 129 of file ShortcutsGeometry.h.

◆ Face

template<typename TKSpace >
typedef LightDigitalSurface::Face DGtal::ShortcutsGeometry< TKSpace >::Face

Definition at line 139 of file ShortcutsGeometry.h.

◆ FloatImage

template<typename TKSpace >
typedef ImageContainerBySTLVector<Domain, float> DGtal::ShortcutsGeometry< TKSpace >::FloatImage

defines a float image with (hyper-)rectangular domain.

Definition at line 118 of file ShortcutsGeometry.h.

◆ GaussianCurvatureFunctor

Definition at line 158 of file ShortcutsGeometry.h.

◆ GrayScale

template<typename TKSpace >
typedef unsigned char DGtal::ShortcutsGeometry< TKSpace >::GrayScale

The type for 8-bits gray-scale elements.

Definition at line 102 of file ShortcutsGeometry.h.

◆ GrayScaleImage

template<typename TKSpace >
typedef ImageContainerBySTLVector<Domain, GrayScale> DGtal::ShortcutsGeometry< TKSpace >::GrayScaleImage

defines a grey-level image with (hyper-)rectangular domain.

Definition at line 116 of file ShortcutsGeometry.h.

◆ IdxArc

template<typename TKSpace >
typedef IdxDigitalSurface::Arc DGtal::ShortcutsGeometry< TKSpace >::IdxArc

Definition at line 143 of file ShortcutsGeometry.h.

◆ IdxArcRange

template<typename TKSpace >
typedef IdxDigitalSurface::ArcRange DGtal::ShortcutsGeometry< TKSpace >::IdxArcRange

Definition at line 144 of file ShortcutsGeometry.h.

◆ IdxDigitalSurface

defines a connected or not indexed digital surface.

Definition at line 133 of file ShortcutsGeometry.h.

◆ IdxSurfel

template<typename TKSpace >
typedef IdxDigitalSurface::Vertex DGtal::ShortcutsGeometry< TKSpace >::IdxSurfel

Definition at line 141 of file ShortcutsGeometry.h.

◆ IdxSurfelRange

template<typename TKSpace >
typedef std::vector< IdxSurfel > DGtal::ShortcutsGeometry< TKSpace >::IdxSurfelRange

Definition at line 148 of file ShortcutsGeometry.h.

◆ IdxSurfelSet

template<typename TKSpace >
typedef std::set< IdxSurfel > DGtal::ShortcutsGeometry< TKSpace >::IdxSurfelSet

Definition at line 145 of file ShortcutsGeometry.h.

◆ IdxVertex

template<typename TKSpace >
typedef IdxDigitalSurface::Vertex DGtal::ShortcutsGeometry< TKSpace >::IdxVertex

Definition at line 142 of file ShortcutsGeometry.h.

◆ ImplicitShape3D

template<typename TKSpace >
typedef ImplicitPolynomial3Shape<Space> DGtal::ShortcutsGeometry< TKSpace >::ImplicitShape3D

defines an implicit shape of the space, which is the zero-level set of a ScalarPolynomial.

Definition at line 110 of file ShortcutsGeometry.h.

◆ Integer

template<typename TKSpace >
typedef Space::Integer DGtal::ShortcutsGeometry< TKSpace >::Integer

Integer numbers.

Definition at line 88 of file ShortcutsGeometry.h.

◆ KSpace

template<typename TKSpace >
typedef TKSpace DGtal::ShortcutsGeometry< TKSpace >::KSpace

Digital cellular space.

Definition at line 84 of file ShortcutsGeometry.h.

◆ LightDigitalSurface

template<typename TKSpace >
typedef ::DGtal::DigitalSurface< LightSurfaceContainer > DGtal::ShortcutsGeometry< TKSpace >::LightDigitalSurface

defines a connected digital surface over a binary image.

Definition at line 127 of file ShortcutsGeometry.h.

◆ LightSurfaceContainer

defines a light container that represents a connected digital surface over a binary image.

Definition at line 125 of file ShortcutsGeometry.h.

◆ MeanCurvatureFunctor

Definition at line 157 of file ShortcutsGeometry.h.

◆ Mesh

template<typename TKSpace >
typedef ::DGtal::Mesh<RealPoint> DGtal::ShortcutsGeometry< TKSpace >::Mesh

Definition at line 168 of file ShortcutsGeometry.h.

◆ NormalFunctor

template<typename TKSpace >
typedef sgf::ShapeNormalVectorFunctor<ImplicitShape3D> DGtal::ShortcutsGeometry< TKSpace >::NormalFunctor

Definition at line 156 of file ShortcutsGeometry.h.

◆ Point

template<typename TKSpace >
typedef Space::Point DGtal::ShortcutsGeometry< TKSpace >::Point

Point with integer coordinates.

Definition at line 90 of file ShortcutsGeometry.h.

◆ PolygonalSurface

template<typename TKSpace >
typedef ::DGtal::PolygonalSurface<RealPoint> DGtal::ShortcutsGeometry< TKSpace >::PolygonalSurface

Definition at line 170 of file ShortcutsGeometry.h.

◆ PositionFunctor

template<typename TKSpace >
typedef sgf::ShapePositionFunctor<ImplicitShape3D> DGtal::ShortcutsGeometry< TKSpace >::PositionFunctor

Definition at line 155 of file ShortcutsGeometry.h.

◆ RealPoint

template<typename TKSpace >
typedef Space::RealPoint DGtal::ShortcutsGeometry< TKSpace >::RealPoint

Point with floating-point coordinates.

Definition at line 96 of file ShortcutsGeometry.h.

◆ RealPoints

template<typename TKSpace >
typedef std::vector< RealPoint > DGtal::ShortcutsGeometry< TKSpace >::RealPoints

Definition at line 151 of file ShortcutsGeometry.h.

◆ RealVector

template<typename TKSpace >
typedef Space::RealVector DGtal::ShortcutsGeometry< TKSpace >::RealVector

Vector with floating-point coordinates.

Definition at line 94 of file ShortcutsGeometry.h.

◆ RealVectors

template<typename TKSpace >
typedef std::vector< RealVector > DGtal::ShortcutsGeometry< TKSpace >::RealVectors

Definition at line 150 of file ShortcutsGeometry.h.

◆ Scalar

template<typename TKSpace >
typedef RealVector::Component DGtal::ShortcutsGeometry< TKSpace >::Scalar

Floating-point numbers.

Definition at line 98 of file ShortcutsGeometry.h.

◆ ScalarPolynomial

template<typename TKSpace >
typedef MPolynomial< Space::dimension, Scalar > DGtal::ShortcutsGeometry< TKSpace >::ScalarPolynomial

defines a multi-variate polynomial : RealPoint -> Scalar

Definition at line 107 of file ShortcutsGeometry.h.

◆ Scalars

template<typename TKSpace >
typedef std::vector< Scalar > DGtal::ShortcutsGeometry< TKSpace >::Scalars

Definition at line 149 of file ShortcutsGeometry.h.

◆ ScalarStatistic

template<typename TKSpace >
typedef ::DGtal::Statistic<Scalar> DGtal::ShortcutsGeometry< TKSpace >::ScalarStatistic

Definition at line 153 of file ShortcutsGeometry.h.

◆ SCell

template<typename TKSpace >
typedef LightDigitalSurface::SCell DGtal::ShortcutsGeometry< TKSpace >::SCell

Definition at line 136 of file ShortcutsGeometry.h.

◆ Self

template<typename TKSpace >
typedef ShortcutsGeometry< TKSpace > DGtal::ShortcutsGeometry< TKSpace >::Self

Definition at line 75 of file ShortcutsGeometry.h.

◆ Space

template<typename TKSpace >
typedef KSpace::Space DGtal::ShortcutsGeometry< TKSpace >::Space

Digital space.

Definition at line 86 of file ShortcutsGeometry.h.

◆ Surfel

template<typename TKSpace >
typedef LightDigitalSurface::Surfel DGtal::ShortcutsGeometry< TKSpace >::Surfel

Definition at line 134 of file ShortcutsGeometry.h.

◆ Surfel2Index

template<typename TKSpace >
typedef std::map<Surfel, IdxSurfel> DGtal::ShortcutsGeometry< TKSpace >::Surfel2Index

Definition at line 171 of file ShortcutsGeometry.h.

◆ SurfelRange

template<typename TKSpace >
typedef std::vector< Surfel > DGtal::ShortcutsGeometry< TKSpace >::SurfelRange

Definition at line 146 of file ShortcutsGeometry.h.

◆ SurfelSet

template<typename TKSpace >
typedef KSpace::SurfelSet DGtal::ShortcutsGeometry< TKSpace >::SurfelSet

defines a set of surfels

Definition at line 122 of file ShortcutsGeometry.h.

◆ TriangulatedSurface

template<typename TKSpace >
typedef ::DGtal::TriangulatedSurface<RealPoint> DGtal::ShortcutsGeometry< TKSpace >::TriangulatedSurface

Definition at line 169 of file ShortcutsGeometry.h.

◆ TrueGaussianCurvatureEstimator

Definition at line 166 of file ShortcutsGeometry.h.

◆ TrueMeanCurvatureEstimator

Definition at line 164 of file ShortcutsGeometry.h.

◆ TrueNormalEstimator

Definition at line 162 of file ShortcutsGeometry.h.

◆ TruePositionEstimator

Definition at line 160 of file ShortcutsGeometry.h.

◆ Vector

template<typename TKSpace >
typedef Space::Vector DGtal::ShortcutsGeometry< TKSpace >::Vector

Vector with integer coordinates.

Definition at line 92 of file ShortcutsGeometry.h.

◆ Vertex

template<typename TKSpace >
typedef LightDigitalSurface::Vertex DGtal::ShortcutsGeometry< TKSpace >::Vertex

Definition at line 137 of file ShortcutsGeometry.h.

Constructor & Destructor Documentation

◆ ShortcutsGeometry() [1/3]

template<typename TKSpace >
DGtal::ShortcutsGeometry< TKSpace >::ShortcutsGeometry ( )
delete

Default constructor.

◆ ~ShortcutsGeometry()

template<typename TKSpace >
DGtal::ShortcutsGeometry< TKSpace >::~ShortcutsGeometry ( )
delete

Destructor.

◆ ShortcutsGeometry() [2/3]

template<typename TKSpace >
DGtal::ShortcutsGeometry< TKSpace >::ShortcutsGeometry ( const ShortcutsGeometry< TKSpace > &  other)
delete

Copy constructor.

Parameters
otherthe object to clone.

◆ ShortcutsGeometry() [3/3]

template<typename TKSpace >
DGtal::ShortcutsGeometry< TKSpace >::ShortcutsGeometry ( ShortcutsGeometry< TKSpace > &&  other)
delete

Move constructor.

Parameters
otherthe object to move.

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT()

template<typename TKSpace >
DGtal::ShortcutsGeometry< TKSpace >::BOOST_CONCEPT_ASSERT ( (concepts::CCellularGridSpaceND< TKSpace >)  )
private

◆ defaultParameters()

template<typename TKSpace >
static Parameters DGtal::ShortcutsGeometry< TKSpace >::defaultParameters ( )
inlinestatic

◆ getCTrivialNormalVectors()

template<typename TKSpace >
template<typename TAnyDigitalSurface >
static RealVectors DGtal::ShortcutsGeometry< TKSpace >::getCTrivialNormalVectors ( CountedPtr< TAnyDigitalSurface >  surface,
const SurfelRange surfels,
const Parameters params = parametersGeometryEstimation() 
)
inlinestatic

Given a digital surface surface, a sequence of surfels, and some parameters params, returns the convolved trivial normal vector estimations at the specified surfels, in the same order.

Template Parameters
TAnyDigitalSurfaceeither kind of DigitalSurface, like ShortcutsGeometry::LightDigitalSurface or ShortcutsGeometry::DigitalSurface.
Parameters
[in]surfacethe digital surface
[in]surfelsthe sequence of surfels at which we compute the normals
[in]paramsthe parameters:
  • verbose [ 1]: verbose trace mode 0: silent, 1: verbose.
  • t-ring [ 3.0]: the radius used when computing convolved trivial normals (it is a graph distance, not related to the grid step).
Returns
the vector containing the estimated normals, in the same order as surfels.

Definition at line 457 of file ShortcutsGeometry.h.

460  {
461  int verbose = params[ "verbose" ].as<int>();
462  Scalar t = params[ "t-ring" ].as<double>();
463  typedef typename TAnyDigitalSurface::DigitalSurfaceContainer SurfaceContainer;
464  typedef ExactPredicateLpSeparableMetric<Space,2> Metric;
465  typedef functors::HatFunction<Scalar> Functor;
466  typedef functors::ElementaryConvolutionNormalVectorEstimator
467  < Surfel, CanonicSCellEmbedder<KSpace> > SurfelFunctor;
468  typedef LocalEstimatorFromSurfelFunctorAdapter
469  < SurfaceContainer, Metric, SurfelFunctor, Functor> NormalEstimator;
470  if ( verbose > 0 )
471  trace.info() << " CTrivial normal t=" << t << " (discrete)" << std::endl;
472  const Functor fct( 1.0, t );
473  const KSpace & K = surface->container().space();
474  Metric aMetric;
475  CanonicSCellEmbedder<KSpace> canonic_embedder( K );
476  std::vector< RealVector > n_estimations;
477  SurfelFunctor surfelFct( canonic_embedder, 1.0 );
478  NormalEstimator estimator;
479  estimator.attach( *surface);
480  estimator.setParams( aMetric, surfelFct, fct, t );
481  estimator.init( 1.0, surfels.begin(), surfels.end());
482  estimator.eval( surfels.begin(), surfels.end(),
483  std::back_inserter( n_estimations ) );
484  std::transform( n_estimations.cbegin(), n_estimations.cend(), n_estimations.begin(),
485  [] ( RealVector v ) { return -v; } );
486  return n_estimations;
487  }
InHalfPlaneBySimple3x3Matrix< Point, double > Functor
Trace trace
Definition: Common.h:144
LightDigitalSurface::Surfel Surfel
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:165
std::ostream & info()
RealVector::Component Scalar
Floating-point numbers.
KSpace K
Aim: This class is a model of CCellularGridSpaceND. It represents the cubical grid as a cell complex,...

References DGtal::Trace::info(), K, and DGtal::trace.

◆ getGaussianCurvatures()

template<typename TKSpace >
static Scalars DGtal::ShortcutsGeometry< TKSpace >::getGaussianCurvatures ( CountedPtr< ImplicitShape3D shape,
const KSpace K,
const SurfelRange surfels,
const Parameters params = parametersShapeGeometry() 
)
inlinestatic

Given a space K, an implicit shape, a sequence of surfels, and a gridstep h, returns the gaussian curvatures at the specified surfels, in the same order.

Note
that the gaussian curvature is approximated by projecting the surfel centroid onto the implicit 3D shape.
Parameters
[in]shapethe implicit shape.
[in]Kthe Khalimsky space whose domain encompasses the digital shape.
[in]surfelsthe sequence of surfels at which we compute the normals
[in]paramsthe parameters:
  • projectionMaxIter [ 20]: the maximum number of iteration for the projection.
  • projectionAccuracy[0.0001]: the zero-proximity stop criterion during projection.
  • projectionGamma [ 0.5]: the damping coefficient of the projection.
  • gridstep [ 1.0]: the gridstep that defines the digitization (often called h).
Returns
the vector containing the gaussian curvatures, in the same order as surfels.

Definition at line 369 of file ShortcutsGeometry.h.

373  {
374  Scalars n_true_estimations;
375  TrueGaussianCurvatureEstimator true_estimator;
376  int maxIter = params[ "projectionMaxIter" ].as<int>();
377  double accuracy = params[ "projectionAccuracy" ].as<double>();
378  double gamma = params[ "projectionGamma" ].as<double>();
379  Scalar gridstep = params[ "gridstep" ].as<Scalar>();
380  true_estimator.attach( *shape );
381  true_estimator.setParams( K, GaussianCurvatureFunctor(), maxIter, accuracy, gamma );
382  true_estimator.init( gridstep, surfels.begin(), surfels.end() );
383  true_estimator.eval( surfels.begin(), surfels.end(),
384  std::back_inserter( n_true_estimations ) );
385  return n_true_estimations;
386  }
sgf::ShapeGaussianCurvatureFunctor< ImplicitShape3D > GaussianCurvatureFunctor
std::vector< Scalar > Scalars
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, GaussianCurvatureFunctor > TrueGaussianCurvatureEstimator
RealVector::Component Scalar
Floating-point numbers.
KSpace K

References DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::attach(), DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::eval(), DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::init(), K, and DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::setParams().

◆ getIIGaussianCurvatures() [1/3]

template<typename TKSpace >
static Scalars DGtal::ShortcutsGeometry< TKSpace >::getIIGaussianCurvatures ( CountedPtr< BinaryImage bimage,
const SurfelRange surfels,
const Parameters params = parametersGeometryEstimation() | parametersKSpace() 
)
inlinestatic

Given a digital shape bimage, a sequence of surfels, and some parameters vm, returns the Gaussian curvature Integral Invariant (II) estimation at the specified surfels, in the same order.

Parameters
[in]bimagethe characteristic function of the shape as a binary image (inside is true, outside is false).
[in]surfelsthe sequence of surfels at which we compute the Gaussian curvatures
[in]paramsthe parameters:
  • verbose [ 1]: verbose trace mode 0: silent, 1: verbose.
  • r-radius [ 3.0]: the constant for kernel radius parameter r in r(h)=r h^alpha (VCM,II,Trivial).
  • alpha [ 0.33]: the parameter alpha in r(h)=r h^alpha (VCM, II)."
  • gridstep [ 1.0]: the digitization gridstep (often denoted by h).
Returns
the vector containing the estimated Gaussian curvatures, in the same order as surfels.
Note
The function is faster when surfels are in a specific order, as given for instance by a depth-first traversal (
See also
getSurfelRange)

Definition at line 851 of file ShortcutsGeometry.h.

856  {
857  auto K = getKSpace( bimage, params );
858  return getIIGaussianCurvatures( *bimage, K, surfels, params );
859  }
static Scalars getIIGaussianCurvatures(CountedPtr< BinaryImage > bimage, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace())
static KSpace getKSpace(const Point &low, const Point &up, Parameters params=parametersKSpace())
Definition: Shortcuts.h:327
KSpace K

References DGtal::Shortcuts< TKSpace >::getKSpace(), and K.

Referenced by DGtal::ShortcutsGeometry< TKSpace >::getIIGaussianCurvatures().

◆ getIIGaussianCurvatures() [2/3]

template<typename TKSpace >
static Scalars DGtal::ShortcutsGeometry< TKSpace >::getIIGaussianCurvatures ( CountedPtr< DigitizedImplicitShape3D dshape,
const SurfelRange surfels,
const Parameters params = parametersGeometryEstimation() | parametersKSpace() | parametersDigitizedImplicitShape3D() 
)
inlinestatic

Given a digitized implicit shape dshape, a sequence of surfels, and some parameters params, returns the Gaussian curvature Integral Invariant (II) estimation at the specified surfels, in the same order.

Parameters
[in]dshapethe digitized implicit shape, which is an implicitly defined characteristic function.
[in]surfelsthe sequence of surfels at which we compute the normals
[in]paramsthe parameters:
  • verbose [ 1]: verbose trace mode 0: silent, 1: verbose.
  • r-radius [ 3.0]: the constant for kernel radius parameter r in r(h)=r h^alpha (VCM,II,Trivial).
  • alpha [ 0.33]: the parameter alpha in r(h)=r h^alpha (VCM, II)."
  • gridstep [ 1.0]: the digitization gridstep (often denoted by h).
  • minAABB [ -10.0]: the min value of the AABB bounding box (domain)
  • maxAABB [ 10.0]: the max value of the AABB bounding box (domain)
  • offset [ 5.0]: the digital dilation of the digital space, useful when you process shapes and that you add noise.
  • closed [ 1]: specifies if the Khalimsky space is closed (!=0) or not (==0)
Returns
the vector containing the estimated Gaussian curvatures, in the same order as surfels.
Note
It is better to have surfels in a specific order, as given for instance by a depth-first traversal (
See also
getSurfelRange)

Definition at line 887 of file ShortcutsGeometry.h.

893  {
894  auto K = getKSpace( params );
895  return getIIGaussianCurvatures( *dshape, K, surfels, params );
896  }
static Scalars getIIGaussianCurvatures(CountedPtr< BinaryImage > bimage, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace())
static KSpace getKSpace(const Point &low, const Point &up, Parameters params=parametersKSpace())
Definition: Shortcuts.h:327
KSpace K

References DGtal::ShortcutsGeometry< TKSpace >::getIIGaussianCurvatures(), DGtal::Shortcuts< TKSpace >::getKSpace(), and K.

◆ getIIGaussianCurvatures() [3/3]

template<typename TKSpace >
template<typename TPointPredicate >
static Scalars DGtal::ShortcutsGeometry< TKSpace >::getIIGaussianCurvatures ( const TPointPredicate &  shape,
const KSpace K,
const SurfelRange surfels,
const Parameters params = parametersGeometryEstimation() | parametersKSpace() 
)
inlinestatic

Given an arbitrary PointPredicate shape: Point -> boolean, a Khalimsky space K, a sequence of surfels, and some parameters params, returns the Gaussian curvature Integral Invariant (II) estimation at the specified surfels, in the same order.

Template Parameters
TPointPredicateany type of map Point -> boolean.
Parameters
[in]shapea function Point -> boolean telling if you are inside the shape.
[in]Kthe Khalimsky space where the shape and surfels live.
[in]surfelsthe sequence of surfels at which we compute the Gaussian curvatures
[in]paramsthe parameters:
  • verbose [ 1]: verbose trace mode 0: silent, 1: verbose.
  • r-radius [ 3.0]: the constant for kernel radius parameter r in r(h)=r h^alpha (VCM,II,Trivial).
  • alpha [ 0.33]: the parameter alpha in r(h)=r h^alpha (VCM, II)."
  • gridstep [ 1.0]: the digitization gridstep (often denoted by h).
Returns
the vector containing the estimated Gaussian curvatures, in the same order as surfels.
Note
The function is faster when surfels are in a specific order, as given for instance by a depth-first traversal (
See also
getSurfelRange)

Definition at line 922 of file ShortcutsGeometry.h.

928  {
929  typedef functors::IIGaussianCurvature3DFunctor<Space> IIGaussianCurvFunctor;
930  typedef IntegralInvariantCovarianceEstimator
931  <KSpace, TPointPredicate, IIGaussianCurvFunctor> IIGaussianCurvEstimator;
932 
933  Scalars mc_estimations;
934  int verbose = params[ "verbose" ].as<int>();
935  Scalar h = params[ "gridstep" ].as<Scalar>();
936  Scalar r = params[ "r-radius" ].as<Scalar>();
937  Scalar alpha = params[ "alpha" ].as<Scalar>();
938  if ( alpha != 1.0 ) r *= pow( h, alpha-1.0 );
939  if ( verbose > 0 )
940  {
941  trace.info() << "- II Gaussian curvature alpha=" << alpha << std::endl;
942  trace.info() << "- II Gaussian curvature r=" << (r*h) << " (continuous) "
943  << r << " (discrete)" << std::endl;
944  }
945  IIGaussianCurvFunctor functor;
946  functor.init( h, r*h );
947  IIGaussianCurvEstimator ii_estimator( functor );
948  ii_estimator.attach( K, shape );
949  ii_estimator.setParams( r );
950  ii_estimator.init( h, surfels.begin(), surfels.end() );
951  ii_estimator.eval( surfels.begin(), surfels.end(),
952  std::back_inserter( mc_estimations ) );
953  return mc_estimations;
954  }
TKSpace KSpace
Digital cellular space.
Trace trace
Definition: Common.h:144
std::vector< Scalar > Scalars
std::ostream & info()
RealVector::Component Scalar
Floating-point numbers.
KSpace K

References DGtal::Trace::info(), K, and DGtal::trace.

◆ getIIMeanCurvatures() [1/3]

template<typename TKSpace >
static Scalars DGtal::ShortcutsGeometry< TKSpace >::getIIMeanCurvatures ( CountedPtr< BinaryImage bimage,
const SurfelRange surfels,
const Parameters params = parametersGeometryEstimation() | parametersKSpace() 
)
inlinestatic

Given a digital shape bimage, a sequence of surfels, and some parameters vm, returns the mean curvature Integral Invariant (II) estimation at the specified surfels, in the same order.

Parameters
[in]bimagethe characteristic function of the shape as a binary image (inside is true, outside is false).
[in]surfelsthe sequence of surfels at which we compute the mean curvatures
[in]paramsthe parameters:
  • verbose [ 1]: verbose trace mode 0: silent, 1: verbose.
  • r-radius [ 3.0]: the constant for kernel radius parameter r in r(h)=r h^alpha (VCM,II,Trivial).
  • alpha [ 0.33]: the parameter alpha in r(h)=r h^alpha (VCM, II)."
  • gridstep [ 1.0]: the digitization gridstep (often denoted by h).
Returns
the vector containing the estimated mean curvatures, in the same order as surfels.
Note
The function is faster when surfels are in a specific order, as given for instance by a depth-first traversal (
See also
getSurfelRange)

Definition at line 727 of file ShortcutsGeometry.h.

732  {
733  auto K = getKSpace( bimage, params );
734  return getIIMeanCurvatures( *bimage, K, surfels, params );
735  }
static Scalars getIIMeanCurvatures(CountedPtr< BinaryImage > bimage, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace())
static KSpace getKSpace(const Point &low, const Point &up, Parameters params=parametersKSpace())
Definition: Shortcuts.h:327
KSpace K

References DGtal::Shortcuts< TKSpace >::getKSpace(), and K.

Referenced by DGtal::ShortcutsGeometry< TKSpace >::getIIMeanCurvatures().

◆ getIIMeanCurvatures() [2/3]

template<typename TKSpace >
static Scalars DGtal::ShortcutsGeometry< TKSpace >::getIIMeanCurvatures ( CountedPtr< DigitizedImplicitShape3D dshape,
const SurfelRange surfels,
const Parameters params = parametersGeometryEstimation() | parametersKSpace() | parametersDigitizedImplicitShape3D() 
)
inlinestatic

Given a digitized implicit shape dshape, a sequence of surfels, and some parameters params, returns the mean curvature Integral Invariant (II) estimation at the specified surfels, in the same order.

Parameters
[in]dshapethe digitized implicit shape, which is an implicitly defined characteristic function.
[in]surfelsthe sequence of surfels at which we compute the normals
[in]paramsthe parameters:
  • verbose [ 1]: verbose trace mode 0: silent, 1: verbose.
  • r-radius [ 3.0]: the constant for kernel radius parameter r in r(h)=r h^alpha (VCM,II,Trivial).
  • alpha [ 0.33]: the parameter alpha in r(h)=r h^alpha (VCM, II)."
  • gridstep [ 1.0]: the digitization gridstep (often denoted by h).
  • minAABB [ -10.0]: the min value of the AABB bounding box (domain)
  • maxAABB [ 10.0]: the max value of the AABB bounding box (domain)
  • offset [ 5.0]: the digital dilation of the digital space, useful when you process shapes and that you add noise.
  • closed [ 1]: specifies if the Khalimsky space is closed (!=0) or not (==0)
Returns
the vector containing the estimated mean curvatures, in the same order as surfels.
Note
It is better to have surfels in a specific order, as given for instance by a depth-first traversal (
See also
getSurfelRange)

Definition at line 763 of file ShortcutsGeometry.h.

769  {
770  auto K = getKSpace( params );
771  return getIIMeanCurvatures( *dshape, K, surfels, params );
772  }
static Scalars getIIMeanCurvatures(CountedPtr< BinaryImage > bimage, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace())
static KSpace getKSpace(const Point &low, const Point &up, Parameters params=parametersKSpace())
Definition: Shortcuts.h:327
KSpace K

References DGtal::ShortcutsGeometry< TKSpace >::getIIMeanCurvatures(), DGtal::Shortcuts< TKSpace >::getKSpace(), and K.

◆ getIIMeanCurvatures() [3/3]

template<typename TKSpace >
template<typename TPointPredicate >
static Scalars DGtal::ShortcutsGeometry< TKSpace >::getIIMeanCurvatures ( const TPointPredicate &  shape,
const KSpace K,
const SurfelRange surfels,
const Parameters params = parametersGeometryEstimation() | parametersKSpace() 
)
inlinestatic

Given an arbitrary PointPredicate shape: Point -> boolean, a Khalimsky space K, a sequence of surfels, and some parameters params, returns the mean curvature Integral Invariant (II) estimation at the specified surfels, in the same order.

Template Parameters
TPointPredicateany type of map Point -> boolean.
Parameters
[in]shapea function Point -> boolean telling if you are inside the shape.
[in]Kthe Khalimsky space where the shape and surfels live.
[in]surfelsthe sequence of surfels at which we compute the mean curvatures
[in]paramsthe parameters:
  • verbose [ 1]: verbose trace mode 0: silent, 1: verbose.
  • r-radius [ 3.0]: the constant for kernel radius parameter r in r(h)=r h^alpha (VCM,II,Trivial).
  • alpha [ 0.33]: the parameter alpha in r(h)=r h^alpha (VCM, II)."
  • gridstep [ 1.0]: the digitization gridstep (often denoted by h).
Returns
the vector containing the estimated mean curvatures, in the same order as surfels.
Note
The function is faster when surfels are in a specific order, as given for instance by a depth-first traversal (
See also
getSurfelRange)

Definition at line 798 of file ShortcutsGeometry.h.

804  {
805  typedef functors::IIMeanCurvature3DFunctor<Space> IIMeanCurvFunctor;
806  typedef IntegralInvariantVolumeEstimator
807  <KSpace, TPointPredicate, IIMeanCurvFunctor> IIMeanCurvEstimator;
808 
809  Scalars mc_estimations;
810  int verbose = params[ "verbose" ].as<int>();
811  Scalar h = params[ "gridstep" ].as<Scalar>();
812  Scalar r = params[ "r-radius" ].as<Scalar>();
813  Scalar alpha = params[ "alpha" ].as<Scalar>();
814  if ( alpha != 1.0 ) r *= pow( h, alpha-1.0 );
815  if ( verbose > 0 )
816  {
817  trace.info() << "- II mean curvature alpha=" << alpha << std::endl;
818  trace.info() << "- II mean curvature r=" << (r*h) << " (continuous) "
819  << r << " (discrete)" << std::endl;
820  }
821  IIMeanCurvFunctor functor;
822  functor.init( h, r*h );
823  IIMeanCurvEstimator ii_estimator( functor );
824  ii_estimator.attach( K, shape );
825  ii_estimator.setParams( r );
826  ii_estimator.init( h, surfels.begin(), surfels.end() );
827  ii_estimator.eval( surfels.begin(), surfels.end(),
828  std::back_inserter( mc_estimations ) );
829  return mc_estimations;
830  }
TKSpace KSpace
Digital cellular space.
Trace trace
Definition: Common.h:144
std::vector< Scalar > Scalars
std::ostream & info()
RealVector::Component Scalar
Floating-point numbers.
KSpace K

References DGtal::Trace::info(), K, and DGtal::trace.

◆ getIINormalVectors() [1/3]

template<typename TKSpace >
static RealVectors DGtal::ShortcutsGeometry< TKSpace >::getIINormalVectors ( CountedPtr< BinaryImage bimage,
const SurfelRange surfels,
const Parameters params = parametersGeometryEstimation() | parametersKSpace() 
)
inlinestatic

Given a digital shape bimage, a sequence of surfels, and some parameters params, returns the normal Integral Invariant (II) estimation at the specified surfels, in the same order.

Parameters
[in]bimagethe characteristic function of the shape as a binary image (inside is true, outside is false).
[in]surfelsthe sequence of surfels at which we compute the normals
[in]paramsthe parameters:
  • verbose [ 1]: verbose trace mode 0: silent, 1: verbose.
  • r-radius [ 3.0]: the constant for kernel radius parameter r in r(h)=r h^alpha (VCM,II,Trivial).
  • alpha [ 0.33]: the parameter alpha in r(h)=r h^alpha (VCM, II)."
  • gridstep [ 1.0]: the digitization gridstep (often denoted by h).
Returns
the vector containing the estimated normals, in the same order as surfels.
Note
It is better to have surfels in a specific order, as given for instance by a depth-first traversal (
See also
getSurfelRange)

Definition at line 602 of file ShortcutsGeometry.h.

607  {
608  auto K = getKSpace( bimage, params );
609  return getIINormalVectors( *bimage, K, surfels, params );
610  }
static KSpace getKSpace(const Point &low, const Point &up, Parameters params=parametersKSpace())
Definition: Shortcuts.h:327
KSpace K
static RealVectors getIINormalVectors(CountedPtr< BinaryImage > bimage, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace())

References DGtal::Shortcuts< TKSpace >::getKSpace(), and K.

Referenced by DGtal::ShortcutsGeometry< TKSpace >::getIINormalVectors().

◆ getIINormalVectors() [2/3]

template<typename TKSpace >
static RealVectors DGtal::ShortcutsGeometry< TKSpace >::getIINormalVectors ( CountedPtr< DigitizedImplicitShape3D dshape,
const SurfelRange surfels,
const Parameters params = parametersGeometryEstimation() | parametersKSpace() | parametersDigitizedImplicitShape3D() 
)
inlinestatic

Given a digitized implicit shape dshape, a sequence of surfels, and some parameters params, returns the normal Integral Invariant (II) estimation at the specified surfels, in the same order.

Parameters
[in]dshapethe digitized implicit shape, which is an implicitly defined characteristic function.
[in]surfelsthe sequence of surfels at which we compute the normals
[in]paramsthe parameters:
  • verbose [ 1]: verbose trace mode 0: silent, 1: verbose.
  • r-radius [ 3.0]: the constant for kernel radius parameter r in r(h)=r h^alpha (VCM,II,Trivial).
  • alpha [ 0.33]: the parameter alpha in r(h)=r h^alpha (VCM, II)."
  • gridstep [ 1.0]: the digitization gridstep (often denoted by h).
  • minAABB [ -10.0]: the min value of the AABB bounding box (domain)
  • maxAABB [ 10.0]: the max value of the AABB bounding box (domain)
  • offset [ 5.0]: the digital dilation of the digital space, useful when you process shapes and that you add noise.
  • closed [ 1]: specifies if the Khalimsky space is closed (!=0) or not (==0)
Returns
the vector containing the estimated normals, in the same order as surfels.
Note
It is better to have surfels in a specific order, as given for instance by a depth-first traversal (
See also
getSurfelRange)

Definition at line 638 of file ShortcutsGeometry.h.

644  {
645  auto K = getKSpace( params );
646  return getIINormalVectors( *dshape, K, surfels, params );
647  }
static KSpace getKSpace(const Point &low, const Point &up, Parameters params=parametersKSpace())
Definition: Shortcuts.h:327
KSpace K
static RealVectors getIINormalVectors(CountedPtr< BinaryImage > bimage, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace())

References DGtal::ShortcutsGeometry< TKSpace >::getIINormalVectors(), DGtal::Shortcuts< TKSpace >::getKSpace(), and K.

◆ getIINormalVectors() [3/3]

template<typename TKSpace >
template<typename TPointPredicate >
static RealVectors DGtal::ShortcutsGeometry< TKSpace >::getIINormalVectors ( const TPointPredicate &  shape,
const KSpace K,
const SurfelRange surfels,
const Parameters params = parametersGeometryEstimation() | parametersKSpace() 
)
inlinestatic

Given an arbitrary PointPredicate shape: Point -> boolean, a Khalimsky space K, a sequence of surfels, and some parameters params, returns the normal Integral Invariant (II) estimation at the specified surfels, in the same order.

Template Parameters
TPointPredicateany type of map Point -> boolean.
Parameters
[in]shapea function Point -> boolean telling if you are inside the shape.
[in]Kthe Khalimsky space where the shape and surfels live.
[in]surfelsthe sequence of surfels at which we compute the normals
[in]paramsthe parameters:
  • verbose [ 1]: verbose trace mode 0: silent, 1: verbose.
  • r-radius [ 3.0]: the constant for kernel radius parameter r in r(h)=r h^alpha (VCM,II,Trivial).
  • alpha [ 0.33]: the parameter alpha in r(h)=r h^alpha (VCM, II)."
  • gridstep [ 1.0]: the digitization gridstep (often denoted by h).
Returns
the vector containing the estimated normals, in the same order as surfels.
Note
It is better to have surfels in a specific order, as given for instance by a depth-first traversal (
See also
getSurfelRange)

Definition at line 671 of file ShortcutsGeometry.h.

677  {
678  typedef functors::IINormalDirectionFunctor<Space> IINormalFunctor;
679  typedef IntegralInvariantCovarianceEstimator
680  <KSpace, TPointPredicate, IINormalFunctor> IINormalEstimator;
681 
682  RealVectors n_estimations;
683  int verbose = params[ "verbose" ].as<int>();
684  Scalar h = params[ "gridstep" ].as<Scalar>();
685  Scalar r = params[ "r-radius" ].as<Scalar>();
686  Scalar alpha = params[ "alpha" ].as<Scalar>();
687  if ( alpha != 1.0 ) r *= pow( h, alpha-1.0 );
688  if ( verbose > 0 )
689  {
690  trace.info() << "- II normal alpha=" << alpha << std::endl;
691  trace.info() << "- II normal r=" << (r*h) << " (continuous) "
692  << r << " (discrete)" << std::endl;
693  }
694  IINormalFunctor functor;
695  functor.init( h, r*h );
696  IINormalEstimator ii_estimator( functor );
697  ii_estimator.attach( K, shape );
698  ii_estimator.setParams( r );
699  ii_estimator.init( h, surfels.begin(), surfels.end() );
700  ii_estimator.eval( surfels.begin(), surfels.end(),
701  std::back_inserter( n_estimations ) );
702  const RealVectors n_trivial = getTrivialNormalVectors( K, surfels );
703  orientVectors( n_estimations, n_trivial );
704  return n_estimations;
705  }
TKSpace KSpace
Digital cellular space.
Trace trace
Definition: Common.h:144
static void orientVectors(RealVectors &v, const RealVectors &ref_v)
std::ostream & info()
RealVector::Component Scalar
Floating-point numbers.
static RealVectors getTrivialNormalVectors(const KSpace &K, const SurfelRange &surfels)
KSpace K
std::vector< RealVector > RealVectors

References DGtal::ShortcutsGeometry< TKSpace >::getTrivialNormalVectors(), DGtal::Trace::info(), K, DGtal::ShortcutsGeometry< TKSpace >::orientVectors(), and DGtal::trace.

◆ getKSpace() [1/6]

template<typename TKSpace >
static KSpace DGtal::Shortcuts< TKSpace >::getKSpace
inlinestatic

Builds a Khalimsky space that encompasses the domain of the given image. Note that digital points are cells of the Khalimsky space with maximal dimensions. A closed Khalimsky space adds lower dimensional cells all around its boundary to define a closed complex.

Parameters
[in]bimageany binary image
[in]paramsthe parameters:
  • closed [1]: specifies if the Khalimsky space is closed (!=0) or not (==0).
Returns
the Khalimsky space.

Definition at line 349 of file Shortcuts.h.

351  {
352  int closed = params[ "closed" ].as<int>();
353  KSpace K;
354  if ( ! K.init( bimage->domain().lowerBound(),
355  bimage->domain().upperBound(),
356  closed ) )
357  trace.error() << "[Shortcuts::getKSpace]"
358  << " Error building Khalimsky space K=" << K << std::endl;
359  return K;
360  }
Trace trace
Definition: Common.h:144
bool init(const Point &lower, const Point &upper, bool isClosed)
Specifies the upper and lower bounds for the maximal cells in this space.
KSpace K
std::ostream & error()
Aim: This class is a model of CCellularGridSpaceND. It represents the cubical grid as a cell complex,...

◆ getKSpace() [2/6]

template<typename TKSpace >
static KSpace DGtal::Shortcuts< TKSpace >::getKSpace
inlinestatic

Builds a Khalimsky space that encompasses the lower and upper digital points. Note that digital points are cells of the Khalimsky space with maximal dimensions. A closed Khalimsky space adds lower dimensional cells all around its boundary to define a closed complex.

Parameters
[in]lowthe lowest point in the space
[in]upthe highest point in the space
[in]paramsthe parameters:
  • closed [1]: specifies if the Khalimsky space is closed (!=0) or not (==0).
Returns
the Khalimsky space.

Definition at line 327 of file Shortcuts.h.

329  {
330  int closed = params[ "closed" ].as<int>();
331  KSpace K;
332  if ( ! K.init( low, up, closed ) )
333  trace.error() << "[Shortcuts::getKSpace]"
334  << " Error building Khalimsky space K=" << K << std::endl;
335  return K;
336  }
Trace trace
Definition: Common.h:144
bool init(const Point &lower, const Point &upper, bool isClosed)
Specifies the upper and lower bounds for the maximal cells in this space.
KSpace K
std::ostream & error()
Aim: This class is a model of CCellularGridSpaceND. It represents the cubical grid as a cell complex,...

◆ getKSpace() [3/6]

template<typename TKSpace >
static KSpace DGtal::Shortcuts< TKSpace >::getKSpace
inlinestatic

Builds a Khalimsky space that encompasses the domain of the given image. Note that digital points are cells of the Khalimsky space with maximal dimensions. A closed Khalimsky space adds lower dimensional cells all around its boundary to define a closed complex.

Parameters
[in]gimageany gray-scale image
[in]paramsthe parameters:
  • closed [1]: specifies if the Khalimsky space is closed (!=0) or not (==0).
Returns
the Khalimsky space.

Definition at line 373 of file Shortcuts.h.

375  {
376  int closed = params[ "closed" ].as<int>();
377  KSpace K;
378  if ( ! K.init( gimage->domain().lowerBound(),
379  gimage->domain().upperBound(),
380  closed ) )
381  trace.error() << "[Shortcuts::getKSpace]"
382  << " Error building Khalimsky space K=" << K << std::endl;
383  return K;
384  }
Trace trace
Definition: Common.h:144
bool init(const Point &lower, const Point &upper, bool isClosed)
Specifies the upper and lower bounds for the maximal cells in this space.
KSpace K
std::ostream & error()
Aim: This class is a model of CCellularGridSpaceND. It represents the cubical grid as a cell complex,...

◆ getKSpace() [4/6]

template<typename TKSpace >
template<typename TDigitalSurfaceContainer >
static KSpace DGtal::Shortcuts< TKSpace >::getKSpace ( typename TDigitalSurfaceContainer  )
inlinestatic
Template Parameters
TDigitalSurfaceContainereither kind of DigitalSurfaceContainer
Parameters
[in]surfacea smart pointer on any indexed digital surface.
Returns
the Khalimsky space associated to the given surface.

Definition at line 403 of file Shortcuts.h.

404  {
405  return surface->container().space();
406  }

◆ getKSpace() [5/6]

template<typename TKSpace >
static KSpace DGtal::Shortcuts< TKSpace >::getKSpace
inlinestatic

Builds a Khalimsky space that encompasses the bounding box specified by a digitization in params. It is useful when digitizing an implicit shape.

Parameters
[in]paramsthe parameters:
  • minAABB [-10.0]: the min value of the AABB bounding box (domain)
  • maxAABB [ 10.0]: the max value of the AABB bounding box (domain)
  • gridstep [ 1.0]: the gridstep that defines the digitization (often called h).
  • offset [ 5.0]: the digital dilation of the digital space, useful when you process shapes and that you add noise.
  • closed [1] : specifies if the Khalimsky space is closed (!=0) or not (==0).
Returns
the Khalimsky space.
See also
makeDigitizedImplicitShape3D

Definition at line 481 of file Shortcuts.h.

483  {
484  Scalar min_x = params[ "minAABB" ].as<Scalar>();
485  Scalar max_x = params[ "maxAABB" ].as<Scalar>();
486  Scalar h = params[ "gridstep" ].as<Scalar>();
487  Scalar offset = params[ "offset" ].as<Scalar>();
488  bool closed = params[ "closed" ].as<int>();
489  RealPoint p1( min_x - offset * h, min_x - offset * h, min_x - offset * h );
490  RealPoint p2( max_x + offset * h, max_x + offset * h, max_x + offset * h );
491  CountedPtr<DigitizedImplicitShape3D> dshape( new DigitizedImplicitShape3D() );
492  dshape->init( p1, p2, h );
493  Domain domain = dshape->getDomain();
494  KSpace K;
495  if ( ! K.init( domain.lowerBound(), domain.upperBound(), closed ) )
496  trace.error() << "[Shortcuts::getKSpace]"
497  << " Error building Khalimsky space K=" << K << std::endl;
498  return K;
499  }
HyperRectDomain< Space > Domain
Trace trace
Definition: Common.h:144
const Point & upperBound() const
Domain domain
bool init(const Point &lower, const Point &upper, bool isClosed)
Specifies the upper and lower bounds for the maximal cells in this space.
const Point & lowerBound() const
GaussDigitizer< Space, ImplicitShape3D > DigitizedImplicitShape3D
defines the digitization of an implicit shape.
RealVector::Component Scalar
Floating-point numbers.
KSpace K
std::ostream & error()
Aim: This class is a model of CCellularGridSpaceND. It represents the cubical grid as a cell complex,...

◆ getKSpace() [6/6]

template<typename TKSpace >
template<typename TDigitalSurfaceContainer >
static KSpace DGtal::Shortcuts< TKSpace >::getKSpace ( typename TDigitalSurfaceContainer  )
inlinestatic
Template Parameters
TDigitalSurfaceContainereither kind of DigitalSurfaceContainer
Parameters
[in]surfacea smart pointer on a (light or not) digital surface (e.g. DigitalSurface or LightDigitalSurface).
Returns
the Khalimsky space associated to the given surface.

Definition at line 392 of file Shortcuts.h.

393  {
394  return surface->container().space();
395  }

◆ getMeanCurvatures()

template<typename TKSpace >
static Scalars DGtal::ShortcutsGeometry< TKSpace >::getMeanCurvatures ( CountedPtr< ImplicitShape3D shape,
const KSpace K,
const SurfelRange surfels,
const Parameters params = parametersShapeGeometry() 
)
inlinestatic

Given a space K, an implicit shape, a sequence of surfels, and a gridstep h, returns the mean curvatures at the specified surfels, in the same order.

Note
that the mean curvature is approximated by projecting the surfel centroid onto the implicit 3D shape.
Parameters
[in]shapethe implicit shape.
[in]Kthe Khalimsky space whose domain encompasses the digital shape.
[in]surfelsthe sequence of surfels at which we compute the normals
[in]paramsthe parameters:
  • projectionMaxIter [ 20]: the maximum number of iteration for the projection.
  • projectionAccuracy[0.0001]: the zero-proximity stop criterion during projection.
  • projectionGamma [ 0.5]: the damping coefficient of the projection.
  • gridstep [ 1.0]: the gridstep that defines the digitization (often called h).
Returns
the vector containing the mean curvatures, in the same order as surfels.

Definition at line 329 of file ShortcutsGeometry.h.

333  {
334  Scalars n_true_estimations;
335  TrueMeanCurvatureEstimator true_estimator;
336  int maxIter = params[ "projectionMaxIter" ].as<int>();
337  double accuracy = params[ "projectionAccuracy" ].as<double>();
338  double gamma = params[ "projectionGamma" ].as<double>();
339  Scalar gridstep = params[ "gridstep" ].as<Scalar>();
340  true_estimator.attach( *shape );
341  true_estimator.setParams( K, MeanCurvatureFunctor(), maxIter, accuracy, gamma );
342  true_estimator.init( gridstep, surfels.begin(), surfels.end() );
343  true_estimator.eval( surfels.begin(), surfels.end(),
344  std::back_inserter( n_true_estimations ) );
345  return n_true_estimations;
346  }
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, MeanCurvatureFunctor > TrueMeanCurvatureEstimator
std::vector< Scalar > Scalars
sgf::ShapeMeanCurvatureFunctor< ImplicitShape3D > MeanCurvatureFunctor
RealVector::Component Scalar
Floating-point numbers.
KSpace K

References DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::attach(), DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::eval(), DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::init(), K, and DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::setParams().

◆ getNormalVectors()

template<typename TKSpace >
static RealVectors DGtal::ShortcutsGeometry< TKSpace >::getNormalVectors ( CountedPtr< ImplicitShape3D shape,
const KSpace K,
const SurfelRange surfels,
const Parameters params = parametersShapeGeometry() 
)
inlinestatic

Given a space K, an implicit shape, a sequence of surfels, and a gridstep h, returns the normal vectors at the specified surfels, in the same order.

Note
that the normal vector is approximated by projecting the surfel centroid onto the implicit 3D shape.
Parameters
[in]shapethe implicit shape.
[in]Kthe Khalimsky space whose domain encompasses the digital shape.
[in]surfelsthe sequence of surfels at which we compute the normals
[in]paramsthe parameters:
  • projectionMaxIter [ 20]: the maximum number of iteration for the projection.
  • projectionAccuracy[0.0001]: the zero-proximity stop criterion during projection.
  • projectionGamma [ 0.5]: the damping coefficient of the projection.
  • gridstep [ 1.0]: the gridstep that defines the digitization (often called h).
Returns
the vector containing the true normals, in the same order as surfels.

Definition at line 290 of file ShortcutsGeometry.h.

294  {
295  RealVectors n_true_estimations;
296  TrueNormalEstimator true_estimator;
297  int maxIter = params[ "projectionMaxIter" ].as<int>();
298  double accuracy = params[ "projectionAccuracy" ].as<double>();
299  double gamma = params[ "projectionGamma" ].as<double>();
300  Scalar gridstep = params[ "gridstep" ].as<Scalar>();
301  true_estimator.attach( *shape );
302  true_estimator.setParams( K, NormalFunctor(), maxIter, accuracy, gamma );
303  true_estimator.init( gridstep, surfels.begin(), surfels.end() );
304  true_estimator.eval( surfels.begin(), surfels.end(),
305  std::back_inserter( n_true_estimations ) );
306  return n_true_estimations;
307  }
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, NormalFunctor > TrueNormalEstimator
RealVector::Component Scalar
Floating-point numbers.
sgf::ShapeNormalVectorFunctor< ImplicitShape3D > NormalFunctor
KSpace K
std::vector< RealVector > RealVectors

References DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::attach(), DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::eval(), DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::init(), K, and DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::setParams().

◆ getPositions() [1/2]

template<typename TKSpace >
static RealPoints DGtal::ShortcutsGeometry< TKSpace >::getPositions ( CountedPtr< ImplicitShape3D shape,
const KSpace K,
const SurfelRange surfels,
const Parameters params = parametersShapeGeometry() 
)
inlinestatic

Given a space K, an implicit shape, a sequence of surfels, and a gridstep h, returns the closest positions on the surface at the specified surfels, in the same order.

Note
The surfel centroids are iteratively projected onto the implicit surface through a damped Newton process.
Parameters
[in]shapethe implicit shape.
[in]Kthe Khalimsky space whose domain encompasses the digital shape.
[in]surfelsthe sequence of surfels that we project onto the shape's surface
[in]paramsthe parameters:
  • projectionMaxIter [ 20]: the maximum number of iteration for the projection.
  • projectionAccuracy[0.0001]: the zero-proximity stop criterion during projection.
  • projectionGamma [ 0.5]: the damping coefficient of the projection.
  • gridstep [ 1.0]: the gridstep that defines the digitization (often called h).
Returns
the vector containing the true normals, in the same order as surfels.

Definition at line 222 of file ShortcutsGeometry.h.

226  {
227  RealVectors n_true_estimations;
228  TruePositionEstimator true_estimator;
229  int maxIter = params[ "projectionMaxIter" ].as<int>();
230  double accuracy = params[ "projectionAccuracy" ].as<double>();
231  double gamma = params[ "projectionGamma" ].as<double>();
232  Scalar gridstep = params[ "gridstep" ].as<Scalar>();
233  true_estimator.attach( *shape );
234  true_estimator.setParams( K, PositionFunctor(), maxIter, accuracy, gamma );
235  true_estimator.init( gridstep, surfels.begin(), surfels.end() );
236  true_estimator.eval( surfels.begin(), surfels.end(),
237  std::back_inserter( n_true_estimations ) );
238  return n_true_estimations;
239  }
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, PositionFunctor > TruePositionEstimator
RealVector::Component Scalar
Floating-point numbers.
KSpace K
std::vector< RealVector > RealVectors
sgf::ShapePositionFunctor< ImplicitShape3D > PositionFunctor

References DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::attach(), DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::eval(), DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::init(), K, and DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::setParams().

◆ getPositions() [2/2]

template<typename TKSpace >
static RealPoints DGtal::ShortcutsGeometry< TKSpace >::getPositions ( CountedPtr< ImplicitShape3D shape,
const RealPoints points,
const Parameters params = parametersShapeGeometry() 
)
inlinestatic

Given an implicit shape and a sequence of points, returns the closest positions on the surface at the specified points, in the same order.

Parameters
[in]shapethe implicit shape.
[in]pointsthe sequence of points that we project onto the shape's surface.
[in]paramsthe parameters:
  • projectionMaxIter [ 20]: the maximum number of iteration for the projection.
  • projectionAccuracy[0.0001]: the zero-proximity stop criterion during projection.
  • projectionGamma [ 0.5]: the damping coefficient of the projection.
  • gridstep [ 1.0]: the gridstep that defines the digitization (often called h).
Returns
the vector containing the projected points.

Definition at line 256 of file ShortcutsGeometry.h.

259  {
260  RealPoints proj_points( points.size() );
261  int maxIter = params[ "projectionMaxIter" ].as<int>();
262  double accuracy = params[ "projectionAccuracy" ].as<double>();
263  double gamma = params[ "projectionGamma" ].as<double>();
264  for ( unsigned int i = 0; i < points.size(); ++i )
265  proj_points[ i ] = shape->nearestPoint( points[ i ], accuracy,
266  maxIter, gamma );
267  return proj_points;
268  }
std::vector< RealPoint > RealPoints

References DGtal::ImplicitPolynomial3Shape< TSpace >::nearestPoint().

◆ getScalarsAbsoluteDifference()

template<typename TKSpace >
static Scalars DGtal::ShortcutsGeometry< TKSpace >::getScalarsAbsoluteDifference ( const Scalars v1,
const Scalars v2 
)
inlinestatic

Computes the absolute difference between each element of the two vectors.

Parameters
[in]v1any vector of values.
[in]v2any vector of values.
Returns
the vector composed of elemenst |v1[i]-v2[i]|.

Definition at line 1022 of file ShortcutsGeometry.h.

1024  {
1025  Scalars result( v1.size() );
1026  std::transform( v2.cbegin(), v2.cend(), v1.cbegin(), result.begin(),
1027  [] ( Scalar val1, Scalar val2 )
1028  { return fabs( val1 - val2 ); } );
1029  return result;
1030  }
std::vector< Scalar > Scalars
RealVector::Component Scalar
Floating-point numbers.

◆ getScalarsNormL1()

template<typename TKSpace >
static Scalar DGtal::ShortcutsGeometry< TKSpace >::getScalarsNormL1 ( const Scalars v1,
const Scalars v2 
)
inlinestatic

Computes the l1-norm of v1-v2, ie the average of the absolute differences of the two vectors.

Parameters
[in]v1any vector of values.
[in]v2any vector of values.
Returns
the normL1 of v1-v2, ie. 1/n sum_i |v1[i]-v2[i]|.

Definition at line 1055 of file ShortcutsGeometry.h.

1057  {
1058  Scalar sum = 0;
1059  for ( unsigned int i = 0; i < v1.size(); i++ )
1060  sum += fabs( v1[ i ] - v2[ i ] );
1061  return sum / v1.size();
1062  }
RealVector::Component Scalar
Floating-point numbers.

◆ getScalarsNormL2()

template<typename TKSpace >
static Scalar DGtal::ShortcutsGeometry< TKSpace >::getScalarsNormL2 ( const Scalars v1,
const Scalars v2 
)
inlinestatic

Computes the l2-norm of v1-v2, ie the square root of the mean-squared error of the two vectors.

Parameters
[in]v1any vector of values.
[in]v2any vector of values.
Returns
the normL2 of v1-v2, ie. sqrt( 1/n sum_i (v1[i]-v2[i])^2 ).

Definition at line 1039 of file ShortcutsGeometry.h.

1041  {
1042  Scalar sum = 0;
1043  for ( unsigned int i = 0; i < v1.size(); i++ )
1044  sum += ( v1[ i ] - v2[ i ] ) * ( v1[ i ] - v2[ i ] );
1045  return sqrt( sum / v1.size() );
1046  }
RealVector::Component Scalar
Floating-point numbers.

◆ getScalarsNormLoo()

template<typename TKSpace >
static Scalar DGtal::ShortcutsGeometry< TKSpace >::getScalarsNormLoo ( const Scalars v1,
const Scalars v2 
)
inlinestatic

Computes the loo-norm of v1-v2, ie the maximum of the absolute differences of the two vectors.

Parameters
[in]v1any vector of values.
[in]v2any vector of values.
Returns
the normLoo of v1-v2, ie. max_i |v1[i]-v2[i]|.

Definition at line 1071 of file ShortcutsGeometry.h.

1073  {
1074  Scalar loo = 0;
1075  for ( unsigned int i = 0; i < v1.size(); i++ )
1076  loo = std::max( loo, fabs( v1[ i ] - v2[ i ] ) );
1077  return loo;
1078  }
int max(int a, int b)
RealVector::Component Scalar
Floating-point numbers.

References max().

◆ getStatistic()

template<typename TKSpace >
static ScalarStatistic DGtal::ShortcutsGeometry< TKSpace >::getStatistic ( const Scalars v)
inlinestatic

Computes the statistic of a vector of scalars

Parameters
[in]va vector of scalars
Returns
its statistic.

Definition at line 979 of file ShortcutsGeometry.h.

980  {
981  ScalarStatistic stat;
982  stat.addValues( v.begin(), v.end() );
983  stat.terminate();
984  return stat;
985  }
::DGtal::Statistic< Scalar > ScalarStatistic

References DGtal::Statistic< TQuantity >::addValues(), and DGtal::Statistic< TQuantity >::terminate().

◆ getTrivialNormalVectors()

template<typename TKSpace >
static RealVectors DGtal::ShortcutsGeometry< TKSpace >::getTrivialNormalVectors ( const KSpace K,
const SurfelRange surfels 
)
inlinestatic

Given a digital space K and a vector of surfels, returns the trivial normals at the specified surfels, in the same order.

Parameters
[in]Kthe Khalimsky space whose domain encompasses the digital shape.
[in]surfelsthe sequence of surfels at which we compute the normals
Returns
the vector containing the trivial normal vectors, in the same order as surfels.

Definition at line 424 of file ShortcutsGeometry.h.

426  {
427  std::vector< RealVector > result;
428  for ( auto s : surfels )
429  {
430  Dimension k = K.sOrthDir( s );
431  bool direct = K.sDirect( s, k );
433  t[ k ] = direct ? -1.0 : 1.0;
434  result.push_back( t );
435  }
436  return result;
437  }
bool sDirect(const SCell &p, Dimension k) const
Return 'true' if the direct orientation of [p] along [k] is in the positive coordinate direction.
DGtal::uint32_t Dimension
Definition: Common.h:127
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:165
Dimension sOrthDir(const SCell &s) const
Given a signed surfel [s], returns its orthogonal direction (ie, the coordinate where the surfel is c...
static Self zero
Static const for zero PointVector.
Definition: PointVector.h:1582
KSpace K

References K, DGtal::KhalimskySpaceND< dim, TInteger >::sDirect(), DGtal::KhalimskySpaceND< dim, TInteger >::sOrthDir(), and DGtal::PointVector< dim, TEuclideanRing, TContainer >::zero.

Referenced by DGtal::ShortcutsGeometry< TKSpace >::getIINormalVectors().

◆ getVCMNormalVectors()

template<typename TKSpace >
template<typename TAnyDigitalSurface >
static RealVectors DGtal::ShortcutsGeometry< TKSpace >::getVCMNormalVectors ( CountedPtr< TAnyDigitalSurface >  surface,
const SurfelRange surfels,
const Parameters params = parametersGeometryEstimation() 
)
inlinestatic

Given a digital surface surface, a sequence of surfels, and some parameters params, returns the normal Voronoi Covariance Measure (VCM) estimation at the specified surfels, in the same order.

Template Parameters
TAnyDigitalSurfaceeither kind of DigitalSurface, like ShortcutsGeometry::LightDigitalSurface or ShortcutsGeometry::DigitalSurface.
Parameters
[in]surfacethe digital surface
[in]surfelsthe sequence of surfels at which we compute the normals
[in]paramsthe parameters:
  • verbose [ 1]: verbose trace mode 0: silent, 1: verbose.
  • t-ring [ 3.0]: the radius used when computing convolved trivial normals (it is a graph distance, not related to the grid step).
  • R-radius [ 10.0]: the constant for distance parameter R in R(h)=R h^alpha (VCM).
  • r-radius [ 3.0]: the constant for kernel radius parameter r in r(h)=r h^alpha (VCM,II,Trivial).
  • kernel [ "hat"]: the kernel integration function chi_r, either "hat" or "ball". )
  • alpha [ 0.33]: the parameter alpha in r(h)=r h^alpha (VCM, II)."
  • surfelEmbedding [ 0]: the surfel -> point embedding for VCM estimator: 0: Pointels, 1: InnerSpel, 2: OuterSpel.
  • gridstep [ 1.0]: the gridstep that defines the digitization (often called h).
Returns
the vector containing the estimated normals, in the same order as surfels.

Definition at line 513 of file ShortcutsGeometry.h.

516  {
517  typedef ExactPredicateLpSeparableMetric<Space,2> Metric;
518  typedef typename TAnyDigitalSurface::DigitalSurfaceContainer SurfaceContainer;
519  RealVectors n_estimations;
520  int verbose = params[ "verbose" ].as<int>();
521  std::string kernel = params[ "kernel" ].as<std::string>();
522  Scalar h = params[ "gridstep" ].as<Scalar>();
523  Scalar R = params[ "R-radius" ].as<Scalar>();
524  Scalar r = params[ "r-radius" ].as<Scalar>();
525  Scalar t = params[ "t-ring" ].as<Scalar>();
526  Scalar alpha = params[ "alpha" ].as<Scalar>();
527  int embedding = params[ "embedding" ].as<int>();
528  // Adjust parameters according to gridstep if specified.
529  if ( alpha != 1.0 ) R *= pow( h, alpha-1.0 );
530  if ( alpha != 1.0 ) r *= pow( h, alpha-1.0 );
531  Surfel2PointEmbedding embType = embedding == 0 ? Pointels :
532  embedding == 1 ? InnerSpel : OuterSpel;
533  if ( verbose > 0 )
534  {
535  trace.info() << "- VCM normal kernel=" << kernel << " emb=" << embedding
536  << " alpha=" << alpha << std::endl;
537  trace.info() << "- VCM normal r=" << (r*h) << " (continuous) "
538  << r << " (discrete)" << std::endl;
539  trace.info() << "- VCM normal R=" << (R*h) << " (continuous) "
540  << R << " (discrete)" << std::endl;
541  trace.info() << "- VCM normal t=" << t << " (discrete)" << std::endl;
542  }
543  if ( kernel == "hat" )
544  {
545  typedef functors::HatPointFunction<Point,Scalar> KernelFunction;
546  typedef VoronoiCovarianceMeasureOnDigitalSurface
547  < SurfaceContainer, Metric, KernelFunction > VCMOnSurface;
548  typedef functors::VCMNormalVectorFunctor<VCMOnSurface> NormalVFunctor;
549  typedef VCMDigitalSurfaceLocalEstimator
550  < SurfaceContainer, Metric, KernelFunction, NormalVFunctor> VCMNormalEstimator;
551  KernelFunction chi_r( 1.0, r );
552  VCMNormalEstimator estimator;
553  estimator.attach( *surface );
554  estimator.setParams( embType, R, r, chi_r, t, Metric(), verbose > 0 );
555  estimator.init( h, surfels.begin(), surfels.end() );
556  estimator.eval( surfels.begin(), surfels.end(),
557  std::back_inserter( n_estimations ) );
558  }
559  else if ( kernel == "ball" )
560  {
561  typedef functors::BallConstantPointFunction<Point,Scalar> KernelFunction;
562  typedef VoronoiCovarianceMeasureOnDigitalSurface
563  < SurfaceContainer, Metric, KernelFunction > VCMOnSurface;
564  typedef functors::VCMNormalVectorFunctor<VCMOnSurface> NormalVFunctor;
565  typedef VCMDigitalSurfaceLocalEstimator
566  < SurfaceContainer, Metric, KernelFunction, NormalVFunctor> VCMNormalEstimator;
567  KernelFunction chi_r( 1.0, r );
568  VCMNormalEstimator estimator;
569  estimator.attach( *surface );
570  estimator.setParams( embType, R, r, chi_r, t, Metric(), verbose > 0 );
571  estimator.init( h, surfels.begin(), surfels.end() );
572  estimator.eval( surfels.begin(), surfels.end(),
573  std::back_inserter( n_estimations ) );
574  }
575  else
576  {
577  trace.warning() << "[ShortcutsGeometry::getVCMNormalVectors] Unknown kernel: "
578  << kernel << std::endl;
579  }
580  return n_estimations;
581  }
Trace trace
Definition: Common.h:144
std::ostream & warning()
std::ostream & info()
RealVector::Component Scalar
Floating-point numbers.
std::vector< RealVector > RealVectors
Surfel2PointEmbedding
Possible embeddings for surfel as point(s)

References DGtal::Trace::info(), DGtal::InnerSpel, DGtal::OuterSpel, DGtal::Pointels, DGtal::trace, and DGtal::Trace::warning().

◆ getVectorsAngleDeviation()

template<typename TKSpace >
static Scalars DGtal::ShortcutsGeometry< TKSpace >::getVectorsAngleDeviation ( const RealVectors v1,
const RealVectors v2 
)
inlinestatic

Computes the statistic that measures the angle differences between the two arrays of unit vectors.

Parameters
[in]v1the first array of unit vectors (normals)
[in]v2the second array of unit vectors (normals)
Returns
the vector of angle differences.

Definition at line 994 of file ShortcutsGeometry.h.

996  {
997  Scalars v( v1.size() );
998  if ( v1.size() == v2.size() )
999  {
1000  auto outIt = v.begin();
1001  for ( auto it1 = v1.cbegin(), it2 = v2.cbegin(), itE1 = v1.cend();
1002  it1 != itE1; ++it1, ++it2 )
1003  {
1004  Scalar angle_error = acos( (*it1).dot( *it2 ) );
1005  *outIt++ = angle_error;
1006  }
1007  }
1008  else
1009  {
1010  trace.warning() << "[ShortcutsGeometry::getVectorsAngleDeviation]"
1011  << " v1.size()=" << v1.size() << " should be equal to "
1012  << " v2.size()=" << v2.size() << std::endl;
1013  }
1014  return v;
1015  }
Trace trace
Definition: Common.h:144
std::vector< Scalar > Scalars
std::ostream & warning()
RealVector::Component Scalar
Floating-point numbers.

References DGtal::trace, and DGtal::Trace::warning().

◆ operator=() [1/2]

template<typename TKSpace >
ShortcutsGeometry& DGtal::ShortcutsGeometry< TKSpace >::operator= ( const ShortcutsGeometry< TKSpace > &  other)
delete

Copy assignment operator.

Parameters
otherthe object to copy.
Returns
a reference on 'this'.

◆ operator=() [2/2]

template<typename TKSpace >
ShortcutsGeometry& DGtal::ShortcutsGeometry< TKSpace >::operator= ( ShortcutsGeometry< TKSpace > &&  other)
delete

Move assignment operator.

Parameters
otherthe object to move.
Returns
a reference on 'this'.

◆ orientVectors()

template<typename TKSpace >
static void DGtal::ShortcutsGeometry< TKSpace >::orientVectors ( RealVectors v,
const RealVectors ref_v 
)
inlinestatic

Orient v so that it points in the same direction as ref_v (scalar product is then non-negative afterwards).

Parameters
[in,out]vthe vectors to reorient.
[in]ref_vthe vectors having the reference orientation.

Definition at line 966 of file ShortcutsGeometry.h.

968  {
969  std::transform( ref_v.cbegin(), ref_v.cend(), v.cbegin(), v.begin(),
970  [] ( RealVector rw, RealVector w )
971  { return rw.dot( w ) >= 0.0 ? w : -w; } );
972  }
auto dot(const PointVector< dim, OtherComponent, OtherStorage > &v) const -> decltype(DGtal::dotProduct(*this, v))
Dot product with a PointVector.
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:165

References DGtal::PointVector< dim, TEuclideanRing, TContainer >::dot().

Referenced by DGtal::ShortcutsGeometry< TKSpace >::getIINormalVectors().

◆ parametersDigitizedImplicitShape3D()

template<typename TKSpace >
static Parameters DGtal::Shortcuts< TKSpace >::parametersDigitizedImplicitShape3D
inlinestatic
Returns
the parameters and their default values which are used for digitization.
  • minAABB [-10.0]: the min value of the AABB bounding box (domain)
  • maxAABB [ 10.0]: the max value of the AABB bounding box (domain)
  • gridstep [ 1.0]: the gridstep that defines the digitization (often called h).
  • offset [ 5.0]: the digital dilation of the digital space, useful when you process shapes and that you add noise.

Definition at line 456 of file Shortcuts.h.

457  {
458  return Parameters
459  ( "minAABB", -10.0 )
460  ( "maxAABB", 10.0 )
461  ( "gridstep", 1.0 )
462  ( "offset", 5.0 );
463  }

◆ parametersGeometryEstimation()

template<typename TKSpace >
static Parameters DGtal::ShortcutsGeometry< TKSpace >::parametersGeometryEstimation ( )
inlinestatic
Returns
the parameters and their default values which are used to estimate the geometry of a digital surface.
  • verbose [ 1]: verbose trace mode 0: silent, 1: verbose.
  • t-ring [ 3.0]: the radius used when computing convolved trivial normals (it is a graph distance, not related to the grid step).
  • R-radius [ 10.0]: the constant for distance parameter R in R(h)=R h^alpha (VCM).
  • r-radius [ 3.0]: the constant for kernel radius parameter r in r(h)=r h^alpha (VCM,II,Trivial).
  • kernel [ "hat"]: the kernel integration function chi_r, either "hat" or "ball". )
  • alpha [ 0.33]: the parameter alpha in r(h)=r h^alpha (VCM, II)."
  • surfelEmbedding [ 0]: the surfel -> point embedding for VCM estimator: 0: Pointels, 1: InnerSpel, 2: OuterSpel.

Definition at line 402 of file ShortcutsGeometry.h.

403  {
404  return Parameters
405  ( "verbose", 1 )
406  ( "t-ring", 3.0 )
407  ( "kernel", "hat" )
408  ( "R-radius", 10.0 )
409  ( "r-radius", 3.0 )
410  ( "alpha", 0.33 )
411  ( "surfelEmbedding", 0 );
412  }

Referenced by DGtal::ShortcutsGeometry< TKSpace >::defaultParameters().

◆ parametersKSpace()

template<typename TKSpace >
static Parameters DGtal::Shortcuts< TKSpace >::parametersKSpace
inlinestatic
Returns
the parameters and their default values which are used for digitization.
  • closed [1 ]: specifies if the Khalimsky space is closed (!=0) or not (==0).
  • gridsizex[1.0]: specifies the space between points along x.
  • gridsizey[1.0]: specifies the space between points along y.
  • gridsizez[1.0]: specifies the space between points along z.

Definition at line 306 of file Shortcuts.h.

307  {
308  return Parameters
309  ( "closed", 1 )
310  ( "gridsizex", 1.0 )
311  ( "gridsizey", 1.0 )
312  ( "gridsizez", 1.0 );
313  }

◆ parametersShapeGeometry()

template<typename TKSpace >
static Parameters DGtal::ShortcutsGeometry< TKSpace >::parametersShapeGeometry ( )
inlinestatic
Returns
the parameters and their default values which are used to approximate the geometry of continuous shape.
  • projectionMaxIter [ 20]: the maximum number of iteration for the projection.
  • projectionAccuracy[0.0001]: the zero-proximity stop criterion during projection.
  • projectionGamma [ 0.5]: the damping coefficient of the projection.
  • gridstep [ 1.0]: the gridstep that defines the digitization (often called h).

Definition at line 193 of file ShortcutsGeometry.h.

194  {
195  return Parameters
196  ( "projectionMaxIter", 20 )
197  ( "projectionAccuracy", 0.0001 )
198  ( "projectionGamma", 0.5 )
199  ( "gridstep", 1.0 );
200  }

Referenced by DGtal::ShortcutsGeometry< TKSpace >::defaultParameters().


The documentation for this class was generated from the following file: