DGtal 1.4.2
Loading...
Searching...
No Matches
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]

Public Types

typedef Shortcuts< TKSpace > Base
 
typedef ShortcutsGeometry< TKSpace > Self
 
typedef TKSpace KSpace
 Digital cellular space.
 
typedef KSpace::Space Space
 Digital space.
 
typedef Space::Integer Integer
 Integer numbers.
 
typedef Space::Point Point
 Point with integer coordinates.
 
typedef Space::Vector Vector
 Vector with integer coordinates.
 
typedef Space::RealVector RealVector
 Vector with floating-point coordinates.
 
typedef Space::RealPoint RealPoint
 Point with floating-point coordinates.
 
typedef RealVector::Component Scalar
 Floating-point numbers.
 
typedef HyperRectDomain< SpaceDomain
 An (hyper-)rectangular domain.
 
typedef unsigned char GrayScale
 The type for 8-bits gray-scale elements.
 
typedef MPolynomial< Space::dimension, ScalarScalarPolynomial
 defines a multi-variate polynomial : RealPoint -> Scalar
 
typedef ImplicitPolynomial3Shape< SpaceImplicitShape3D
 
typedef GaussDigitizer< Space, ImplicitShape3DDigitizedImplicitShape3D
 defines the digitization of an implicit shape.
 
typedef ImageContainerBySTLVector< Domain, bool > BinaryImage
 defines a black and white image with (hyper-)rectangular domain.
 
typedef ImageContainerBySTLVector< Domain, GrayScaleGrayScaleImage
 defines a grey-level image with (hyper-)rectangular domain.
 
typedef ImageContainerBySTLVector< Domain, float > FloatImage
 defines a float image with (hyper-)rectangular domain.
 
typedef ImageContainerBySTLVector< Domain, double > DoubleImage
 defines a double image with (hyper-)rectangular domain.
 
typedef KSpace::SurfelSet SurfelSet
 defines a set of surfels
 
typedef LightImplicitDigitalSurface< KSpace, BinaryImageLightSurfaceContainer
 
typedef ::DGtal::DigitalSurface< LightSurfaceContainerLightDigitalSurface
 defines a connected digital surface over a binary image.
 
typedef SetOfSurfels< KSpace, SurfelSetExplicitSurfaceContainer
 defines a heavy container that represents any digital surface.
 
typedef ::DGtal::DigitalSurface< ExplicitSurfaceContainerDigitalSurface
 defines an arbitrary digital surface over a binary image.
 
typedef IndexedDigitalSurface< ExplicitSurfaceContainerIdxDigitalSurface
 defines a connected or not indexed digital surface.
 
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 sgf::ShapeFirstPrincipalCurvatureFunctor< ImplicitShape3DFirstPrincipalCurvatureFunctor
 
typedef sgf::ShapeSecondPrincipalCurvatureFunctor< ImplicitShape3DSecondPrincipalCurvatureFunctor
 
typedef sgf::ShapeFirstPrincipalDirectionFunctor< ImplicitShape3DFirstPrincipalDirectionFunctor
 
typedef sgf::ShapeSecondPrincipalDirectionFunctor< ImplicitShape3DSecondPrincipalDirectionFunctor
 
typedef sgf::ShapePrincipalCurvaturesAndDirectionsFunctor< ImplicitShape3DPrincipalCurvaturesAndDirectionsFunctor
 
typedef functors::IIPrincipalCurvaturesAndDirectionsFunctor< Space >::Quantity CurvatureTensorQuantity
 
typedef std::vector< CurvatureTensorQuantityCurvatureTensorQuantities
 
typedef TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, PositionFunctorTruePositionEstimator
 
typedef TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, NormalFunctorTrueNormalEstimator
 
typedef TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, MeanCurvatureFunctorTrueMeanCurvatureEstimator
 
typedef TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, GaussianCurvatureFunctorTrueGaussianCurvatureEstimator
 
typedef TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, FirstPrincipalCurvatureFunctorTrueFirstPrincipalCurvatureEstimator
 
typedef TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, SecondPrincipalCurvatureFunctorTrueSecondPrincipalCurvatureEstimator
 
typedef TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, FirstPrincipalDirectionFunctorTrueFirstPrincipalDirectionEstimator
 
typedef TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, SecondPrincipalDirectionFunctorTrueSecondPrincipalDirectionEstimator
 
typedef TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, PrincipalCurvaturesAndDirectionsFunctorTruePrincipalCurvaturesAndDirectionsEstimator
 
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.
 
typedef KSpace::Space Space
 Digital space.
 
typedef Space::Integer Integer
 Integer numbers.
 
typedef Space::Point Point
 Point with integer coordinates.
 
typedef Space::Vector Vector
 Vector with integer coordinates.
 
typedef Space::RealVector RealVector
 Vector with floating-point coordinates.
 
typedef Space::RealPoint RealPoint
 Point with floating-point coordinates.
 
typedef RealVector::Component Scalar
 Floating-point numbers.
 
typedef HyperRectDomain< SpaceDomain
 An (hyper-)rectangular domain.
 
typedef unsigned char GrayScale
 The type for 8-bits gray-scale elements.
 
typedef MPolynomial< Space::dimension, ScalarScalarPolynomial
 defines a multi-variate polynomial : RealPoint -> Scalar
 
typedef ImplicitPolynomial3Shape< SpaceImplicitShape3D
 
typedef GaussDigitizer< Space, ImplicitShape3DDigitizedImplicitShape3D
 defines the digitization of an implicit shape.
 
typedef ImageContainerBySTLVector< Domain, bool > BinaryImage
 defines a black and white image with (hyper-)rectangular domain.
 
typedef ImageContainerBySTLVector< Domain, GrayScaleGrayScaleImage
 defines a grey-level image with (hyper-)rectangular domain.
 
typedef ImageContainerBySTLVector< Domain, float > FloatImage
 defines a float image with (hyper-)rectangular domain.
 
typedef ImageContainerBySTLVector< Domain, double > DoubleImage
 defines a double image with (hyper-)rectangular domain.
 
typedef KSpace::SurfelSet SurfelSet
 defines a set of surfels
 
typedef LightImplicitDigitalSurface< KSpace, BinaryImageLightSurfaceContainer
 
typedef ::DGtal::DigitalSurface< LightSurfaceContainerLightDigitalSurface
 defines a connected digital surface over a binary image.
 
typedef SetOfSurfels< KSpace, SurfelSetExplicitSurfaceContainer
 defines a heavy container that represents any digital surface.
 
typedef ::DGtal::DigitalSurface< ExplicitSurfaceContainerDigitalSurface
 defines an arbitrary digital surface over a binary image.
 
typedef IndexedDigitalSurface< ExplicitSurfaceContainerIdxDigitalSurface
 defines a connected or not indexed digital surface.
 
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 ::DGtal::SurfaceMesh< RealPoint, RealPointSurfaceMesh
 
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

Standard services
 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 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 ()
 
Exact geometry services
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 Scalars getFirstPrincipalCurvatures (CountedPtr< ImplicitShape3D > shape, const KSpace &K, const SurfelRange &surfels, const Parameters &params=parametersShapeGeometry())
 
static Scalars getSecondPrincipalCurvatures (CountedPtr< ImplicitShape3D > shape, const KSpace &K, const SurfelRange &surfels, const Parameters &params=parametersShapeGeometry())
 
static RealVectors getFirstPrincipalDirections (CountedPtr< ImplicitShape3D > shape, const KSpace &K, const SurfelRange &surfels, const Parameters &params=parametersShapeGeometry())
 
static RealVectors getSecondPrincipalDirections (CountedPtr< ImplicitShape3D > shape, const KSpace &K, const SurfelRange &surfels, const Parameters &params=parametersShapeGeometry())
 
static CurvatureTensorQuantities getPrincipalCurvaturesAndDirections (CountedPtr< ImplicitShape3D > shape, const KSpace &K, const SurfelRange &surfels, const Parameters &params=parametersShapeGeometry())
 
Geometry estimation services
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 CurvatureTensorQuantities getIIPrincipalCurvaturesAndDirections (CountedPtr< BinaryImage > bimage, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace())
 
static CurvatureTensorQuantities getIIPrincipalCurvaturesAndDirections (CountedPtr< DigitizedImplicitShape3D > dshape, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace()|parametersDigitizedImplicitShape3D())
 
template<typename TPointPredicate >
static CurvatureTensorQuantities getIIPrincipalCurvaturesAndDirections (const TPointPredicate &shape, const KSpace &K, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace())
 
AT approximation services
static Parameters parametersATApproximation ()
 
template<typename TAnyDigitalSurface , typename VectorFieldInput >
static VectorFieldInput getATVectorFieldApproximation (CountedPtr< TAnyDigitalSurface > surface, const SurfelRange &surfels, const VectorFieldInput &input, const Parameters &params=parametersATApproximation()|parametersGeometryEstimation())
 
template<typename TAnyDigitalSurface , typename VectorFieldInput , typename CellRangeConstIterator >
static VectorFieldInput getATVectorFieldApproximation (Scalars &features, CellRangeConstIterator itB, CellRangeConstIterator itE, CountedPtr< TAnyDigitalSurface > surface, const SurfelRange &surfels, const VectorFieldInput &input, const Parameters &params=parametersATApproximation()|parametersGeometryEstimation())
 
template<typename TAnyDigitalSurface >
static Scalars getATScalarFieldApproximation (CountedPtr< TAnyDigitalSurface > surface, const SurfelRange &surfels, const Scalars &input, const Parameters &params=parametersATApproximation()|parametersGeometryEstimation())
 
template<typename TAnyDigitalSurface , typename CellRangeConstIterator >
static Scalars getATScalarFieldApproximation (Scalars &features, CellRangeConstIterator itB, CellRangeConstIterator itE, CountedPtr< TAnyDigitalSurface > surface, const SurfelRange &surfels, const Scalars &input, const Parameters &params=parametersATApproximation()|parametersGeometryEstimation())
 
Error measure services
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 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 CellRange getCellRange (Cell2Index &c2i, CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > surface, const Dimension k)
 
template<typename TDigitalSurfaceContainer >
static PointelRange getCellRange (CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > surface, const Dimension k)
 
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 saveOFF (CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > digsurf, const TCellEmbedder &embedder, std::string off_file, const Color &face_color=DGtal::Color::None)
 
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 saveOFF (CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > digsurf, std::string off_file, const Color &face_color=Color(32, 32, 32))
 
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 bool saveVectorFieldOBJ (const RealPoints &positions, const RealVectors &vf, double thickness, 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 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 TContainer >
static CountedPtr< SurfaceMeshmakePrimalSurfaceMesh (Cell2Index &c2i, CountedPtr< ::DGtal::DigitalSurface< TContainer > > aSurface)
 
template<typename TContainer >
static CountedPtr< SurfaceMeshmakePrimalSurfaceMesh (CountedPtr< ::DGtal::DigitalSurface< TContainer > > aSurface)
 
template<typename TContainer >
static CountedPtr< SurfaceMeshmakePrimalSurfaceMesh (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 saveOFF (CountedPtr< ::DGtal::PolygonalSurface< TPoint > > polysurf, std::string off_file, const Color &face_color=DGtal::Color::None)
 
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)
 
template<typename TPoint >
static bool saveOFF (CountedPtr< ::DGtal::TriangulatedSurface< TPoint > > trisurf, std::string off_file, const Color &face_color=DGtal::Color::None)
 
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 getPrimalCells (const KSpace &K, const SCell &s, const Dimension k)
 
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.
Examples
geometry/meshes/curvature-comparator-ii-cnc-3d.cpp, geometry/meshes/digpoly-curvature-measures-cnc-3d.cpp, geometry/meshes/digpoly-curvature-measures-cnc-XY-3d.cpp, geometry/meshes/vol-curvature-measures-icnc-3d.cpp, and geometry/meshes/vol-curvature-measures-icnc-XY-3d.cpp.

Definition at line 74 of file ShortcutsGeometry.h.

Member Typedef Documentation

◆ Arc

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

Definition at line 142 of file ShortcutsGeometry.h.

◆ ArcRange

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

Definition at line 144 of file ShortcutsGeometry.h.

◆ Base

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

Definition at line 78 of file ShortcutsGeometry.h.

◆ BinaryImage

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

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

Definition at line 118 of file ShortcutsGeometry.h.

◆ Cell

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

Definition at line 139 of file ShortcutsGeometry.h.

◆ Cell2Index

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

Definition at line 196 of file ShortcutsGeometry.h.

◆ CellRange

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

Definition at line 151 of file ShortcutsGeometry.h.

◆ CurvatureTensorQuantities

template<typename TKSpace >
std::vector< CurvatureTensorQuantity > DGtal::ShortcutsGeometry< TKSpace >::CurvatureTensorQuantities

Definition at line 170 of file ShortcutsGeometry.h.

◆ CurvatureTensorQuantity

template<typename TKSpace >
functors::IIPrincipalCurvaturesAndDirectionsFunctor<Space>::Quantity DGtal::ShortcutsGeometry< TKSpace >::CurvatureTensorQuantity

Definition at line 169 of file ShortcutsGeometry.h.

◆ DigitalSurface

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

defines an arbitrary digital surface over a binary image.

Definition at line 135 of file ShortcutsGeometry.h.

◆ DigitizedImplicitShape3D

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

defines the digitization of an implicit shape.

Definition at line 116 of file ShortcutsGeometry.h.

◆ Domain

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

An (hyper-)rectangular domain.

Definition at line 104 of file ShortcutsGeometry.h.

◆ DoubleImage

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

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

Definition at line 124 of file ShortcutsGeometry.h.

◆ ExplicitSurfaceContainer

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

defines a heavy container that represents any digital surface.

Definition at line 133 of file ShortcutsGeometry.h.

◆ Face

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

Definition at line 143 of file ShortcutsGeometry.h.

◆ FirstPrincipalCurvatureFunctor

template<typename TKSpace >
sgf::ShapeFirstPrincipalCurvatureFunctor<ImplicitShape3D> DGtal::ShortcutsGeometry< TKSpace >::FirstPrincipalCurvatureFunctor

Definition at line 163 of file ShortcutsGeometry.h.

◆ FirstPrincipalDirectionFunctor

template<typename TKSpace >
sgf::ShapeFirstPrincipalDirectionFunctor<ImplicitShape3D> DGtal::ShortcutsGeometry< TKSpace >::FirstPrincipalDirectionFunctor

Definition at line 165 of file ShortcutsGeometry.h.

◆ FloatImage

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

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

Definition at line 122 of file ShortcutsGeometry.h.

◆ GaussianCurvatureFunctor

template<typename TKSpace >
sgf::ShapeGaussianCurvatureFunctor<ImplicitShape3D> DGtal::ShortcutsGeometry< TKSpace >::GaussianCurvatureFunctor

Definition at line 162 of file ShortcutsGeometry.h.

◆ GrayScale

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

The type for 8-bits gray-scale elements.

Definition at line 106 of file ShortcutsGeometry.h.

◆ GrayScaleImage

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

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

Definition at line 120 of file ShortcutsGeometry.h.

◆ IdxArc

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

Definition at line 147 of file ShortcutsGeometry.h.

◆ IdxArcRange

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

Definition at line 148 of file ShortcutsGeometry.h.

◆ IdxDigitalSurface

template<typename TKSpace >
IndexedDigitalSurface< ExplicitSurfaceContainer > DGtal::ShortcutsGeometry< TKSpace >::IdxDigitalSurface

defines a connected or not indexed digital surface.

Definition at line 137 of file ShortcutsGeometry.h.

◆ IdxSurfel

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

Definition at line 145 of file ShortcutsGeometry.h.

◆ IdxSurfelRange

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

Definition at line 152 of file ShortcutsGeometry.h.

◆ IdxSurfelSet

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

Definition at line 149 of file ShortcutsGeometry.h.

◆ IdxVertex

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

Definition at line 146 of file ShortcutsGeometry.h.

◆ ImplicitShape3D

template<typename TKSpace >
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 114 of file ShortcutsGeometry.h.

◆ Integer

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

Integer numbers.

Definition at line 92 of file ShortcutsGeometry.h.

◆ KSpace

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

Digital cellular space.

Definition at line 88 of file ShortcutsGeometry.h.

◆ LightDigitalSurface

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

defines a connected digital surface over a binary image.

Definition at line 131 of file ShortcutsGeometry.h.

◆ LightSurfaceContainer

template<typename TKSpace >
LightImplicitDigitalSurface< KSpace, BinaryImage > DGtal::ShortcutsGeometry< TKSpace >::LightSurfaceContainer

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

Definition at line 129 of file ShortcutsGeometry.h.

◆ MeanCurvatureFunctor

template<typename TKSpace >
sgf::ShapeMeanCurvatureFunctor<ImplicitShape3D> DGtal::ShortcutsGeometry< TKSpace >::MeanCurvatureFunctor

Definition at line 161 of file ShortcutsGeometry.h.

◆ Mesh

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

Definition at line 192 of file ShortcutsGeometry.h.

◆ NormalFunctor

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

Definition at line 160 of file ShortcutsGeometry.h.

◆ Point

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

Point with integer coordinates.

Definition at line 94 of file ShortcutsGeometry.h.

◆ PolygonalSurface

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

Definition at line 194 of file ShortcutsGeometry.h.

◆ PositionFunctor

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

Definition at line 159 of file ShortcutsGeometry.h.

◆ PrincipalCurvaturesAndDirectionsFunctor

template<typename TKSpace >
sgf::ShapePrincipalCurvaturesAndDirectionsFunctor<ImplicitShape3D> DGtal::ShortcutsGeometry< TKSpace >::PrincipalCurvaturesAndDirectionsFunctor

Definition at line 167 of file ShortcutsGeometry.h.

◆ RealPoint

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

Point with floating-point coordinates.

Definition at line 100 of file ShortcutsGeometry.h.

◆ RealPoints

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

Definition at line 155 of file ShortcutsGeometry.h.

◆ RealVector

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

Vector with floating-point coordinates.

Definition at line 98 of file ShortcutsGeometry.h.

◆ RealVectors

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

Definition at line 154 of file ShortcutsGeometry.h.

◆ Scalar

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

Floating-point numbers.

Definition at line 102 of file ShortcutsGeometry.h.

◆ ScalarPolynomial

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

defines a multi-variate polynomial : RealPoint -> Scalar

Definition at line 111 of file ShortcutsGeometry.h.

◆ Scalars

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

Definition at line 153 of file ShortcutsGeometry.h.

◆ ScalarStatistic

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

Definition at line 157 of file ShortcutsGeometry.h.

◆ SCell

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

Definition at line 140 of file ShortcutsGeometry.h.

◆ SecondPrincipalCurvatureFunctor

template<typename TKSpace >
sgf::ShapeSecondPrincipalCurvatureFunctor<ImplicitShape3D> DGtal::ShortcutsGeometry< TKSpace >::SecondPrincipalCurvatureFunctor

Definition at line 164 of file ShortcutsGeometry.h.

◆ SecondPrincipalDirectionFunctor

template<typename TKSpace >
sgf::ShapeSecondPrincipalDirectionFunctor<ImplicitShape3D> DGtal::ShortcutsGeometry< TKSpace >::SecondPrincipalDirectionFunctor

Definition at line 166 of file ShortcutsGeometry.h.

◆ Self

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

Definition at line 79 of file ShortcutsGeometry.h.

◆ Space

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

Digital space.

Definition at line 90 of file ShortcutsGeometry.h.

◆ Surfel

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

Definition at line 138 of file ShortcutsGeometry.h.

◆ Surfel2Index

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

Definition at line 195 of file ShortcutsGeometry.h.

◆ SurfelRange

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

Definition at line 150 of file ShortcutsGeometry.h.

◆ SurfelSet

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

defines a set of surfels

Definition at line 126 of file ShortcutsGeometry.h.

◆ TriangulatedSurface

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

Definition at line 193 of file ShortcutsGeometry.h.

◆ TrueFirstPrincipalCurvatureEstimator

template<typename TKSpace >
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, FirstPrincipalCurvatureFunctor > DGtal::ShortcutsGeometry< TKSpace >::TrueFirstPrincipalCurvatureEstimator

Definition at line 182 of file ShortcutsGeometry.h.

◆ TrueFirstPrincipalDirectionEstimator

template<typename TKSpace >
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, FirstPrincipalDirectionFunctor > DGtal::ShortcutsGeometry< TKSpace >::TrueFirstPrincipalDirectionEstimator

Definition at line 186 of file ShortcutsGeometry.h.

◆ TrueGaussianCurvatureEstimator

template<typename TKSpace >
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, GaussianCurvatureFunctor > DGtal::ShortcutsGeometry< TKSpace >::TrueGaussianCurvatureEstimator

Definition at line 180 of file ShortcutsGeometry.h.

◆ TrueMeanCurvatureEstimator

template<typename TKSpace >
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, MeanCurvatureFunctor > DGtal::ShortcutsGeometry< TKSpace >::TrueMeanCurvatureEstimator

Definition at line 178 of file ShortcutsGeometry.h.

◆ TrueNormalEstimator

template<typename TKSpace >
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, NormalFunctor > DGtal::ShortcutsGeometry< TKSpace >::TrueNormalEstimator

Definition at line 176 of file ShortcutsGeometry.h.

◆ TruePositionEstimator

template<typename TKSpace >
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, PositionFunctor > DGtal::ShortcutsGeometry< TKSpace >::TruePositionEstimator

Definition at line 174 of file ShortcutsGeometry.h.

◆ TruePrincipalCurvaturesAndDirectionsEstimator

template<typename TKSpace >
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, PrincipalCurvaturesAndDirectionsFunctor > DGtal::ShortcutsGeometry< TKSpace >::TruePrincipalCurvaturesAndDirectionsEstimator

Definition at line 190 of file ShortcutsGeometry.h.

◆ TrueSecondPrincipalCurvatureEstimator

template<typename TKSpace >
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, SecondPrincipalCurvatureFunctor > DGtal::ShortcutsGeometry< TKSpace >::TrueSecondPrincipalCurvatureEstimator

Definition at line 184 of file ShortcutsGeometry.h.

◆ TrueSecondPrincipalDirectionEstimator

template<typename TKSpace >
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, SecondPrincipalDirectionFunctor > DGtal::ShortcutsGeometry< TKSpace >::TrueSecondPrincipalDirectionEstimator

Definition at line 188 of file ShortcutsGeometry.h.

◆ Vector

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

Vector with integer coordinates.

Definition at line 96 of file ShortcutsGeometry.h.

◆ Vertex

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

Definition at line 141 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

◆ getATScalarFieldApproximation() [1/2]

template<typename TKSpace >
template<typename TAnyDigitalSurface >
static Scalars DGtal::ShortcutsGeometry< TKSpace >::getATScalarFieldApproximation ( CountedPtr< TAnyDigitalSurface > surface,
const SurfelRange & surfels,
const Scalars & input,
const Parameters & params = parametersATApproximation() | parametersGeometryEstimation() )
inlinestatic

Given any digital surface, a surfel range surfels, and an input scalar field input, returns a piece-smooth approximation of input using Ambrosio-Tortorelli functional.

See also
Piecewise-smooth approximation using a discrete calculus model of Ambrosio-Tortorelli functional
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:
  • at-alpha [ 0.1 ]: parameter alpha in AT (data fit)
  • at-lambda [ 0.025 ]: parameter lambda in AT (1/length of discontinuities)
  • at-epsilon [ 0.5 ]: (last value of) parameter epsilon in AT (width of discontinuities)
  • at-epsilon-start[ 2.0 ]: first value for parameter epsilon in Gamma-convergence optimization (sequence of AT optimization with decreasing epsilon)
  • at-epsilon-ratio[ 2.0 ]: ratio between two consecutive epsilon value in Gamma-convergence optimization (sequence of AT optimization with decreasing epsilon)
  • at-max-iter [ 10 ]: maximum number of alternate minization in AT optimization
  • at-diff-v-max [ 0.0001]: stopping criterion that measures the loo-norm of the evolution of v between two iterations
[in]inputthe input scalar field (a vector of scalar values)
Returns
the piecewise-smooth approximation of input.
Note
Requires Eigen linear algebra backend. Use cmake -DWITH_EIGEN=true ..

Definition at line 1525 of file ShortcutsGeometry.h.

1530 {
1531 (void)surface; //param not used FIXME: JOL
1532
1533 int verbose = params[ "verbose" ].as<int>();
1534 Scalar alpha_at = params[ "at-alpha" ].as<Scalar>();
1535 Scalar lambda_at = params[ "at-lambda" ].as<Scalar>();
1536 Scalar epsilon1 = params[ "at-epsilon-start" ].as<Scalar>();
1537 Scalar epsilon2 = params[ "at-epsilon" ].as<Scalar>();
1538 Scalar epsilonr = params[ "at-epsilon-ratio" ].as<Scalar>();
1539 int max_iter = params[ "at-max-iter" ].as<int>();
1540 Scalar diff_v_max= params[ "at-diff-v-max" ].as<Scalar>();
1541 typedef DiscreteExteriorCalculusFactory<EigenLinearAlgebraBackend> CalculusFactory;
1542 const auto calculus = CalculusFactory::createFromNSCells<2>( surfels.cbegin(), surfels.cend() );
1543 ATSolver2D< KSpace > at_solver( calculus, verbose );
1544 at_solver.initInputScalarFieldU2( input, surfels.cbegin(), surfels.cend() );
1545 at_solver.setUp( alpha_at, lambda_at );
1546 at_solver.solveGammaConvergence( epsilon1, epsilon2, epsilonr, false, diff_v_max, max_iter );
1547 auto output = input;
1548 at_solver.getOutputScalarFieldU2( output, surfels.cbegin(), surfels.cend() );
1549 return output;
1550 }
PolyCalculus * calculus
CountedPtr< SH3::DigitalSurface > surface

References calculus, DGtal::ATSolver2D< TKSpace, TLinearAlgebra >::getOutputScalarFieldU2(), DGtal::ATSolver2D< TKSpace, TLinearAlgebra >::initInputScalarFieldU2(), DGtal::ATSolver2D< TKSpace, TLinearAlgebra >::setUp(), DGtal::ATSolver2D< TKSpace, TLinearAlgebra >::solveGammaConvergence(), and surface.

◆ getATScalarFieldApproximation() [2/2]

template<typename TKSpace >
template<typename TAnyDigitalSurface , typename CellRangeConstIterator >
static Scalars DGtal::ShortcutsGeometry< TKSpace >::getATScalarFieldApproximation ( Scalars & features,
CellRangeConstIterator itB,
CellRangeConstIterator itE,
CountedPtr< TAnyDigitalSurface > surface,
const SurfelRange & surfels,
const Scalars & input,
const Parameters & params = parametersATApproximation() | parametersGeometryEstimation() )
inlinestatic

Given any digital surface, a surfel range surfels, and an input scalar field input, returns a piece-smooth approximation of input using Ambrosio-Tortorelli functional. Given a range of pointels, linels or 2-cells [itB,itE), it also outputs the feature vector features, corresponding to 0-form v in AT (the average of v for linels/surfels).

See also
Piecewise-smooth approximation using a discrete calculus model of Ambrosio-Tortorelli functional
Template Parameters
TAnyDigitalSurfaceeither kind of DigitalSurface, like ShortcutsGeometry::LightDigitalSurface or ShortcutsGeometry::DigitalSurface.
CellRangeConstIteratorthe type of iterator for traversing a range of cells
Parameters
[out]featuresthe vector of scalar feature values (a scalar field where 1 means continuity and 0 discontinuity in the reconstruction), evaluated in the range[itB,itE).
[in]itBthe start of the range of cells.
[in]itEpast the end of the range of cells.
[in]surfacethe digital surface
[in]surfelsthe sequence of surfels at which we compute the normals
[in]paramsthe parameters:
  • at-alpha [ 0.1 ]: parameter alpha in AT (data fit)
  • at-lambda [ 0.025 ]: parameter lambda in AT (1/length of discontinuities)
  • at-epsilon [ 0.5 ]: (last value of) parameter epsilon in AT (width of discontinuities)
  • at-epsilon-start[ 2.0 ]: first value for parameter epsilon in Gamma-convergence optimization (sequence of AT optimization with decreasing epsilon)
  • at-epsilon-ratio[ 2.0 ]: ratio between two consecutive epsilon value in Gamma-convergence optimization (sequence of AT optimization with decreasing epsilon)
  • at-max-iter [ 10 ]: maximum number of alternate minization in AT optimization
  • at-diff-v-max [ 0.0001]: stopping criterion that measures the loo-norm of the evolution of v between two iterations
  • at-v-policy ["Maximum"]: the policy when outputing feature vector v onto cells: "Average"|"Minimum"|"Maximum"
[in]inputthe input scalar field (a vector of scalar values)
Returns
the piecewise-smooth approximation of input.
Note
Requires Eigen linear algebra backend. Use cmake -DWITH_EIGEN=true ..

Definition at line 1591 of file ShortcutsGeometry.h.

1599 {
1600 (void)surface; //param not used FIXME: JOL
1601
1602 int verbose = params[ "verbose" ].as<int>();
1603 Scalar alpha_at = params[ "at-alpha" ].as<Scalar>();
1604 Scalar lambda_at = params[ "at-lambda" ].as<Scalar>();
1605 Scalar epsilon1 = params[ "at-epsilon-start" ].as<Scalar>();
1606 Scalar epsilon2 = params[ "at-epsilon" ].as<Scalar>();
1607 Scalar epsilonr = params[ "at-epsilon-ratio" ].as<Scalar>();
1608 int max_iter = params[ "at-max-iter" ].as<int>();
1609 Scalar diff_v_max= params[ "at-diff-v-max" ].as<Scalar>();
1610 std::string policy = params[ "at-v-policy" ].as<std::string>();
1611 typedef DiscreteExteriorCalculusFactory<EigenLinearAlgebraBackend> CalculusFactory;
1612 const auto calculus = CalculusFactory::createFromNSCells<2>( surfels.cbegin(), surfels.cend() );
1613 ATSolver2D< KSpace > at_solver( calculus, verbose );
1614 at_solver.initInputScalarFieldU2( input, surfels.cbegin(), surfels.cend() );
1615 at_solver.setUp( alpha_at, lambda_at );
1616 at_solver.solveGammaConvergence( epsilon1, epsilon2, epsilonr, false, diff_v_max, max_iter );
1617 auto output = input;
1618 at_solver.getOutputScalarFieldU2( output, surfels.cbegin(), surfels.cend() );
1619 auto p = ( policy == "Average" ) ? at_solver.Average
1620 : ( policy == "Minimum" ) ? at_solver.Minimum
1621 : at_solver.Maximum;
1622 at_solver.getOutputScalarFieldV0( features, itB, itE, p );
1623 return output;
1624 }

References DGtal::ATSolver2D< TKSpace, TLinearAlgebra >::Average, calculus, DGtal::ATSolver2D< TKSpace, TLinearAlgebra >::getOutputScalarFieldU2(), DGtal::ATSolver2D< TKSpace, TLinearAlgebra >::getOutputScalarFieldV0(), DGtal::ATSolver2D< TKSpace, TLinearAlgebra >::initInputScalarFieldU2(), DGtal::ATSolver2D< TKSpace, TLinearAlgebra >::Maximum, DGtal::ATSolver2D< TKSpace, TLinearAlgebra >::Minimum, DGtal::ATSolver2D< TKSpace, TLinearAlgebra >::setUp(), DGtal::ATSolver2D< TKSpace, TLinearAlgebra >::solveGammaConvergence(), and surface.

◆ getATVectorFieldApproximation() [1/2]

template<typename TKSpace >
template<typename TAnyDigitalSurface , typename VectorFieldInput >
static VectorFieldInput DGtal::ShortcutsGeometry< TKSpace >::getATVectorFieldApproximation ( CountedPtr< TAnyDigitalSurface > surface,
const SurfelRange & surfels,
const VectorFieldInput & input,
const Parameters & params = parametersATApproximation() | parametersGeometryEstimation() )
inlinestatic

Given any digital surface, a surfel range surfels, and an input vector field input, returns a piece-smooth approximation of input using Ambrosio-Tortorelli functional.

See also
Piecewise-smooth approximation using a discrete calculus model of Ambrosio-Tortorelli functional
Template Parameters
TAnyDigitalSurfaceeither kind of DigitalSurface, like ShortcutsGeometry::LightDigitalSurface or ShortcutsGeometry::DigitalSurface.
VectorFieldInputthe type of vector field for input values (RandomAccess container)
Parameters
[in]surfacethe digital surface
[in]surfelsthe sequence of surfels at which we compute the normals
[in]paramsthe parameters:
  • at-alpha [ 0.1 ]: parameter alpha in AT (data fit)
  • at-lambda [ 0.025 ]: parameter lambda in AT (1/length of discontinuities)
  • at-epsilon [ 0.5 ]: (last value of) parameter epsilon in AT (width of discontinuities)
  • at-epsilon-start[ 2.0 ]: first value for parameter epsilon in Gamma-convergence optimization (sequence of AT optimization with decreasing epsilon)
  • at-epsilon-ratio[ 2.0 ]: ratio between two consecutive epsilon value in Gamma-convergence optimization (sequence of AT optimization with decreasing epsilon)
  • at-max-iter [ 10 ]: maximum number of alternate minization in AT optimization
  • at-diff-v-max [ 0.0001]: stopping criterion that measures the loo-norm of the evolution of v between two iterations
[in]inputthe input vector field (a vector of vector values)
Returns
the piecewise-smooth approximation of input.
Note
Requires Eigen linear algebra backend. Use cmake -DWITH_EIGEN=true ..

Definition at line 1400 of file ShortcutsGeometry.h.

1405 {
1406 (void)surface; //param not used. FIXME: JOL
1407
1408 int verbose = params[ "verbose" ].as<int>();
1409 Scalar alpha_at = params[ "at-alpha" ].as<Scalar>();
1410 Scalar lambda_at = params[ "at-lambda" ].as<Scalar>();
1411 Scalar epsilon1 = params[ "at-epsilon-start" ].as<Scalar>();
1412 Scalar epsilon2 = params[ "at-epsilon" ].as<Scalar>();
1413 Scalar epsilonr = params[ "at-epsilon-ratio" ].as<Scalar>();
1414 int max_iter = params[ "at-max-iter" ].as<int>();
1415 Scalar diff_v_max= params[ "at-diff-v-max" ].as<Scalar>();
1416 typedef DiscreteExteriorCalculusFactory<EigenLinearAlgebraBackend> CalculusFactory;
1417 const auto calculus = CalculusFactory::createFromNSCells<2>( surfels.cbegin(), surfels.cend() );
1418 ATSolver2D< KSpace > at_solver( calculus, verbose );
1419 at_solver.initInputVectorFieldU2( input, surfels.cbegin(), surfels.cend() );
1420 at_solver.setUp( alpha_at, lambda_at );
1421 at_solver.solveGammaConvergence( epsilon1, epsilon2, epsilonr, false, diff_v_max, max_iter );
1422 auto output = input;
1423 at_solver.getOutputVectorFieldU2( output, surfels.cbegin(), surfels.cend() );
1424 return output;
1425 }

References calculus, DGtal::ATSolver2D< TKSpace, TLinearAlgebra >::getOutputVectorFieldU2(), DGtal::ATSolver2D< TKSpace, TLinearAlgebra >::initInputVectorFieldU2(), DGtal::ATSolver2D< TKSpace, TLinearAlgebra >::setUp(), DGtal::ATSolver2D< TKSpace, TLinearAlgebra >::solveGammaConvergence(), and surface.

Referenced by main().

◆ getATVectorFieldApproximation() [2/2]

template<typename TKSpace >
template<typename TAnyDigitalSurface , typename VectorFieldInput , typename CellRangeConstIterator >
static VectorFieldInput DGtal::ShortcutsGeometry< TKSpace >::getATVectorFieldApproximation ( Scalars & features,
CellRangeConstIterator itB,
CellRangeConstIterator itE,
CountedPtr< TAnyDigitalSurface > surface,
const SurfelRange & surfels,
const VectorFieldInput & input,
const Parameters & params = parametersATApproximation() | parametersGeometryEstimation() )
inlinestatic

Given any digital surface, a surfel range surfels, and an input vector field input, returns a piece-smooth approximation of input using Ambrosio-Tortorelli functional. Given a range of pointels, linels or 2-cells [itB,itE), it also outputs the feature vector features, corresponding to 0-form v in AT (the average of v for linels/surfels).

See also
Piecewise-smooth approximation using a discrete calculus model of Ambrosio-Tortorelli functional
Template Parameters
TAnyDigitalSurfaceeither kind of DigitalSurface, like ShortcutsGeometry::LightDigitalSurface or ShortcutsGeometry::DigitalSurface.
VectorFieldInputthe type of vector field for input values (RandomAccess container)
CellRangeConstIteratorthe type of iterator for traversing a range of cells
Parameters
[out]featuresthe vector of scalar feature values (a scalar field where 1 means continuity and 0 discontinuity in the reconstruction), evaluated in the range[itB,itE).
[in]itBthe start of the range of cells.
[in]itEpast the end of the range of cells.
[in]surfacethe digital surface
[in]surfelsthe sequence of surfels at which we compute the normals
[in]paramsthe parameters:
  • at-alpha [ 0.1 ]: parameter alpha in AT (data fit)
  • at-lambda [ 0.025 ]: parameter lambda in AT (1/length of discontinuities)
  • at-epsilon [ 0.5 ]: (last value of) parameter epsilon in AT (width of discontinuities)
  • at-epsilon-start[ 2.0 ]: first value for parameter epsilon in Gamma-convergence optimization (sequence of AT optimization with decreasing epsilon)
  • at-epsilon-ratio[ 2.0 ]: ratio between two consecutive epsilon value in Gamma-convergence optimization (sequence of AT optimization with decreasing epsilon)
  • at-max-iter [ 10 ]: maximum number of alternate minization in AT optimization
  • at-diff-v-max [ 0.0001]: stopping criterion that measures the loo-norm of the evolution of v between two iterations
  • at-v-policy ["Maximum"]: the policy when outputing feature vector v onto cells: "Average"|"Minimum"|"Maximum"
[in]inputthe input vector field (a vector of vector values)
Returns
the piecewise-smooth approximation of input.
Note
Requires Eigen linear algebra backend. Use cmake -DWITH_EIGEN=true ..

Definition at line 1463 of file ShortcutsGeometry.h.

1471 {
1472 (void)surface; //param not used FIXME: JOL
1473
1474 int verbose = params[ "verbose" ].as<int>();
1475 Scalar alpha_at = params[ "at-alpha" ].as<Scalar>();
1476 Scalar lambda_at = params[ "at-lambda" ].as<Scalar>();
1477 Scalar epsilon1 = params[ "at-epsilon-start" ].as<Scalar>();
1478 Scalar epsilon2 = params[ "at-epsilon" ].as<Scalar>();
1479 Scalar epsilonr = params[ "at-epsilon-ratio" ].as<Scalar>();
1480 int max_iter = params[ "at-max-iter" ].as<int>();
1481 Scalar diff_v_max= params[ "at-diff-v-max" ].as<Scalar>();
1482 std::string policy = params[ "at-v-policy" ].as<std::string>();
1483 typedef DiscreteExteriorCalculusFactory<EigenLinearAlgebraBackend> CalculusFactory;
1484 const auto calculus = CalculusFactory::createFromNSCells<2>( surfels.cbegin(), surfels.cend() );
1485 ATSolver2D< KSpace > at_solver( calculus, verbose );
1486 at_solver.initInputVectorFieldU2( input, surfels.cbegin(), surfels.cend() );
1487 at_solver.setUp( alpha_at, lambda_at );
1488 at_solver.solveGammaConvergence( epsilon1, epsilon2, epsilonr, false, diff_v_max, max_iter );
1489 auto output = input;
1490 at_solver.getOutputVectorFieldU2( output, surfels.cbegin(), surfels.cend() );
1491 auto p = ( policy == "Average" ) ? at_solver.Average
1492 : ( policy == "Minimum" ) ? at_solver.Minimum
1493 : at_solver.Maximum;
1494 at_solver.getOutputScalarFieldV0( features, itB, itE, p );
1495 return output;
1496 }

References DGtal::ATSolver2D< TKSpace, TLinearAlgebra >::Average, calculus, DGtal::ATSolver2D< TKSpace, TLinearAlgebra >::getOutputScalarFieldV0(), DGtal::ATSolver2D< TKSpace, TLinearAlgebra >::getOutputVectorFieldU2(), DGtal::ATSolver2D< TKSpace, TLinearAlgebra >::initInputVectorFieldU2(), DGtal::ATSolver2D< TKSpace, TLinearAlgebra >::Maximum, DGtal::ATSolver2D< TKSpace, TLinearAlgebra >::Minimum, DGtal::ATSolver2D< TKSpace, TLinearAlgebra >::setUp(), DGtal::ATSolver2D< TKSpace, TLinearAlgebra >::solveGammaConvergence(), and surface.

◆ 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 696 of file ShortcutsGeometry.h.

700 {
701 int verbose = params[ "verbose" ].as<int>();
702 Scalar t = params[ "t-ring" ].as<double>();
703 typedef typename TAnyDigitalSurface::DigitalSurfaceContainer SurfaceContainer;
704 typedef LpMetric<Space> Metric;
705 typedef functors::HatFunction<Scalar> Functor;
706 typedef functors::ElementaryConvolutionNormalVectorEstimator
707 < Surfel, CanonicSCellEmbedder<KSpace> > SurfelFunctor;
708 typedef LocalEstimatorFromSurfelFunctorAdapter
709 < SurfaceContainer, Metric, SurfelFunctor, Functor> NormalEstimator;
710 if ( verbose > 0 )
711 trace.info() << "- CTrivial normal t-ring=" << t << " (discrete)" << std::endl;
712 const Functor fct( 1.0, t );
713 const KSpace & K = surface->container().space();
714 Metric aMetric( 2.0 );
715 CanonicSCellEmbedder<KSpace> canonic_embedder( K );
716 std::vector< RealVector > n_estimations;
717 SurfelFunctor surfelFct( canonic_embedder, 1.0 );
718 NormalEstimator estimator;
719 estimator.attach( *surface);
720 estimator.setParams( aMetric, surfelFct, fct, t );
721 estimator.init( 1.0, surfels.begin(), surfels.end());
722 estimator.eval( surfels.begin(), surfels.end(),
723 std::back_inserter( n_estimations ) );
724 std::transform( n_estimations.cbegin(), n_estimations.cend(), n_estimations.begin(),
725 [] ( RealVector v ) { return -v; } );
726 return n_estimations;
727 }
LightDigitalSurface::Surfel Surfel
std::ostream & info()
Trace trace
Definition Common.h:153
InHalfPlaneBySimple3x3Matrix< Point, double > Functor
KSpace K

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

◆ getFirstPrincipalCurvatures()

template<typename TKSpace >
static Scalars DGtal::ShortcutsGeometry< TKSpace >::getFirstPrincipalCurvatures ( 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 first (smallest) principal curvatures at the specified surfels, in the same order.

Note
that the first principal 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 first principal curvatures, in the same order as surfels.

Definition at line 436 of file ShortcutsGeometry.h.

441 {
442 Scalars n_true_estimations;
444 int maxIter = params[ "projectionMaxIter" ].as<int>();
445 double accuracy = params[ "projectionAccuracy" ].as<double>();
446 double gamma = params[ "projectionGamma" ].as<double>();
447 Scalar gridstep = params[ "gridstep" ].as<Scalar>();
448 true_estimator.attach( *shape );
449 true_estimator.setParams( K, FirstPrincipalCurvatureFunctor(),
450 maxIter, accuracy, gamma );
451 true_estimator.init( gridstep, surfels.begin(), surfels.end() );
452 true_estimator.eval( surfels.begin(), surfels.end(),
453 std::back_inserter( n_true_estimations ) );
454 return n_true_estimations;
455 }
sgf::ShapeFirstPrincipalCurvatureFunctor< ImplicitShape3D > FirstPrincipalCurvatureFunctor
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, FirstPrincipalCurvatureFunctor > TrueFirstPrincipalCurvatureEstimator

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().

Referenced by main().

◆ getFirstPrincipalDirections()

template<typename TKSpace >
static RealVectors DGtal::ShortcutsGeometry< TKSpace >::getFirstPrincipalDirections ( 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 first principal directions (corresponding to the smallest principal curvature) at the specified surfels, in the same order.

Note
that the first principal direction 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 first principal directions, in the same order as surfels.

Definition at line 520 of file ShortcutsGeometry.h.

525 {
526 RealVectors n_true_estimations;
528 int maxIter = params[ "projectionMaxIter" ].as<int>();
529 double accuracy = params[ "projectionAccuracy" ].as<double>();
530 double gamma = params[ "projectionGamma" ].as<double>();
531 Scalar gridstep = params[ "gridstep" ].as<Scalar>();
532 true_estimator.attach( *shape );
533 true_estimator.setParams( K, FirstPrincipalDirectionFunctor(),
534 maxIter, accuracy, gamma );
535 true_estimator.init( gridstep, surfels.begin(), surfels.end() );
536 true_estimator.eval( surfels.begin(), surfels.end(),
537 std::back_inserter( n_true_estimations ) );
538 return n_true_estimations;
539 }
std::vector< RealVector > RealVectors
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, FirstPrincipalDirectionFunctor > TrueFirstPrincipalDirectionEstimator
sgf::ShapeFirstPrincipalDirectionFunctor< ImplicitShape3D > FirstPrincipalDirectionFunctor

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().

Referenced by main().

◆ 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 395 of file ShortcutsGeometry.h.

400 {
401 Scalars n_true_estimations;
402 TrueGaussianCurvatureEstimator true_estimator;
403 int maxIter = params[ "projectionMaxIter" ].as<int>();
404 double accuracy = params[ "projectionAccuracy" ].as<double>();
405 double gamma = params[ "projectionGamma" ].as<double>();
406 Scalar gridstep = params[ "gridstep" ].as<Scalar>();
407 true_estimator.attach( *shape );
408 true_estimator.setParams( K, GaussianCurvatureFunctor(), maxIter, accuracy, gamma );
409 true_estimator.init( gridstep, surfels.begin(), surfels.end() );
410 true_estimator.eval( surfels.begin(), surfels.end(),
411 std::back_inserter( n_true_estimations ) );
412 return n_true_estimations;
413 }
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, GaussianCurvatureFunctor > TrueGaussianCurvatureEstimator
sgf::ShapeGaussianCurvatureFunctor< ImplicitShape3D > GaussianCurvatureFunctor

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().

Referenced by main().

◆ getIIGaussianCurvatures() [1/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 getSurfelRange)

Definition at line 1174 of file ShortcutsGeometry.h.

1180 {
1181 typedef functors::IIGaussianCurvature3DFunctor<Space> IIGaussianCurvFunctor;
1182 typedef IntegralInvariantCovarianceEstimator
1183 <KSpace, TPointPredicate, IIGaussianCurvFunctor> IIGaussianCurvEstimator;
1184
1185 Scalars mc_estimations;
1186 int verbose = params[ "verbose" ].as<int>();
1187 Scalar h = params[ "gridstep" ].as<Scalar>();
1188 Scalar r = params[ "r-radius" ].as<Scalar>();
1189 Scalar alpha = params[ "alpha" ].as<Scalar>();
1190 if ( alpha != 1.0 ) r *= pow( h, alpha-1.0 );
1191 if ( verbose > 0 )
1192 {
1193 trace.info() << "- II Gaussian curvature alpha=" << alpha << std::endl;
1194 trace.info() << "- II Gaussian curvature r=" << (r*h) << " (continuous) "
1195 << r << " (discrete)" << std::endl;
1196 }
1197 IIGaussianCurvFunctor functor;
1198 functor.init( h, r*h );
1199 IIGaussianCurvEstimator ii_estimator( functor );
1200 ii_estimator.attach( K, shape );
1201 ii_estimator.setParams( r );
1202 ii_estimator.init( h, surfels.begin(), surfels.end() );
1203 ii_estimator.eval( surfels.begin(), surfels.end(),
1204 std::back_inserter( mc_estimations ) );
1205 return mc_estimations;
1206 }
TKSpace KSpace
Digital cellular space.

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

◆ getIIGaussianCurvatures() [2/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 getSurfelRange)

Definition at line 1103 of file ShortcutsGeometry.h.

1108 {
1109 auto K = getKSpace( bimage, params );
1110 return getIIGaussianCurvatures( *bimage, K, surfels, params );
1111 }
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:332

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

Referenced by DGtal::ShortcutsGeometry< TKSpace >::getIIGaussianCurvatures(), DGtal::ShortcutsGeometry< TKSpace >::getIIGaussianCurvatures(), main(), and TEST_CASE().

◆ getIIGaussianCurvatures() [3/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 getSurfelRange)

Definition at line 1139 of file ShortcutsGeometry.h.

1145 {
1146 auto K = getKSpace( params );
1147 return getIIGaussianCurvatures( *dshape, K, surfels, params );
1148 }

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

◆ getIIMeanCurvatures() [1/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 getSurfelRange)

Definition at line 1050 of file ShortcutsGeometry.h.

1056 {
1057 typedef functors::IIMeanCurvature3DFunctor<Space> IIMeanCurvFunctor;
1058 typedef IntegralInvariantVolumeEstimator
1059 <KSpace, TPointPredicate, IIMeanCurvFunctor> IIMeanCurvEstimator;
1060
1061 Scalars mc_estimations;
1062 int verbose = params[ "verbose" ].as<int>();
1063 Scalar h = params[ "gridstep" ].as<Scalar>();
1064 Scalar r = params[ "r-radius" ].as<Scalar>();
1065 Scalar alpha = params[ "alpha" ].as<Scalar>();
1066 if ( alpha != 1.0 ) r *= pow( h, alpha-1.0 );
1067 if ( verbose > 0 )
1068 {
1069 trace.info() << "- II mean curvature alpha=" << alpha << std::endl;
1070 trace.info() << "- II mean curvature r=" << (r*h) << " (continuous) "
1071 << r << " (discrete)" << std::endl;
1072 }
1073 IIMeanCurvFunctor functor;
1074 functor.init( h, r*h );
1075 IIMeanCurvEstimator ii_estimator( functor );
1076 ii_estimator.attach( K, shape );
1077 ii_estimator.setParams( r );
1078 ii_estimator.init( h, surfels.begin(), surfels.end() );
1079 ii_estimator.eval( surfels.begin(), surfels.end(),
1080 std::back_inserter( mc_estimations ) );
1081 return mc_estimations;
1082 }

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

◆ getIIMeanCurvatures() [2/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 getSurfelRange)

Definition at line 979 of file ShortcutsGeometry.h.

984 {
985 auto K = getKSpace( bimage, params );
986 return getIIMeanCurvatures( *bimage, K, surfels, params );
987 }
static Scalars getIIMeanCurvatures(CountedPtr< BinaryImage > bimage, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace())

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

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

◆ getIIMeanCurvatures() [3/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 getSurfelRange)

Definition at line 1015 of file ShortcutsGeometry.h.

1021 {
1022 auto K = getKSpace( params );
1023 return getIIMeanCurvatures( *dshape, K, surfels, params );
1024 }

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

◆ getIINormalVectors() [1/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
Be careful, normals are reoriented with respect to Trivial normals. If you wish a more robust orientation, use getCTrivialNormalVectors.
It is better to have surfels in a specific order, as given for instance by a depth-first traversal (see getSurfelRange)

Definition at line 923 of file ShortcutsGeometry.h.

929 {
930 typedef functors::IINormalDirectionFunctor<Space> IINormalFunctor;
931 typedef IntegralInvariantCovarianceEstimator
932 <KSpace, TPointPredicate, IINormalFunctor> IINormalEstimator;
933
934 RealVectors n_estimations;
935 int verbose = params[ "verbose" ].as<int>();
936 Scalar h = params[ "gridstep" ].as<Scalar>();
937 Scalar r = params[ "r-radius" ].as<Scalar>();
938 Scalar alpha = params[ "alpha" ].as<Scalar>();
939 if ( alpha != 1.0 ) r *= pow( h, alpha-1.0 );
940 if ( verbose > 0 )
941 {
942 trace.info() << "- II normal alpha=" << alpha << std::endl;
943 trace.info() << "- II normal r=" << (r*h) << " (continuous) "
944 << r << " (discrete)" << std::endl;
945 }
946 IINormalFunctor functor;
947 functor.init( h, r*h );
948 IINormalEstimator ii_estimator( functor );
949 ii_estimator.attach( K, shape );
950 ii_estimator.setParams( r );
951 ii_estimator.init( h, surfels.begin(), surfels.end() );
952 ii_estimator.eval( surfels.begin(), surfels.end(),
953 std::back_inserter( n_estimations ) );
954 const RealVectors n_trivial = getTrivialNormalVectors( K, surfels );
955 orientVectors( n_estimations, n_trivial );
956 return n_estimations;
957 }
static RealVectors getTrivialNormalVectors(const KSpace &K, const SurfelRange &surfels)
static void orientVectors(RealVectors &v, const RealVectors &ref_v)

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

◆ getIINormalVectors() [2/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
Be careful, normals are reoriented with respect to Trivial normals. If you wish a more robust orientation, use getCTrivialNormalVectors.
It is better to have surfels in a specific order, as given for instance by a depth-first traversal (see getSurfelRange)

Definition at line 846 of file ShortcutsGeometry.h.

851 {
852 auto K = getKSpace( bimage, params );
853 return getIINormalVectors( *bimage, K, surfels, params );
854 }
static RealVectors getIINormalVectors(CountedPtr< BinaryImage > bimage, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace())

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

Referenced by DGtal::ShortcutsGeometry< TKSpace >::getIINormalVectors(), DGtal::ShortcutsGeometry< TKSpace >::getIINormalVectors(), main(), main(), precompute(), and TEST_CASE().

◆ getIINormalVectors() [3/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
Be careful, normals are reoriented with respect to Trivial normals. If you wish a more robust orientation, use getCTrivialNormalVectors.
It is better to have surfels in a specific order, as given for instance by a depth-first traversal (see getSurfelRange)

Definition at line 886 of file ShortcutsGeometry.h.

892 {
893 auto K = getKSpace( params );
894 return getIINormalVectors( *dshape, K, surfels, params );
895 }

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

◆ getIIPrincipalCurvaturesAndDirections() [1/3]

template<typename TKSpace >
template<typename TPointPredicate >
static CurvatureTensorQuantities DGtal::ShortcutsGeometry< TKSpace >::getIIPrincipalCurvaturesAndDirections ( 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 principal curvatures and directions using 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 principal curvatures and directions, 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 getSurfelRange)

Definition at line 1300 of file ShortcutsGeometry.h.

1306 {
1307 typedef functors::IIPrincipalCurvaturesAndDirectionsFunctor<Space> IICurvFunctor;
1308 typedef IntegralInvariantCovarianceEstimator<KSpace, TPointPredicate, IICurvFunctor> IICurvEstimator;
1309
1310 CurvatureTensorQuantities mc_estimations;
1311 int verbose = params[ "verbose" ].as<int>();
1312 Scalar h = params[ "gridstep" ].as<Scalar>();
1313 Scalar r = params[ "r-radius" ].as<Scalar>();
1314 Scalar alpha = params[ "alpha" ].as<Scalar>();
1315 if ( alpha != 1.0 ) r *= pow( h, alpha-1.0 );
1316 if ( verbose > 0 )
1317 {
1318 trace.info() << "- II principal curvatures and directions alpha=" << alpha << std::endl;
1319 trace.info() << "- II principal curvatures and directions r=" << (r*h) << " (continuous) "
1320 << r << " (discrete)" << std::endl;
1321 }
1322 IICurvFunctor functor;
1323 functor.init( h, r*h );
1324 IICurvEstimator ii_estimator( functor );
1325 ii_estimator.attach( K, shape );
1326 ii_estimator.setParams( r );
1327 ii_estimator.init( h, surfels.begin(), surfels.end() );
1328 ii_estimator.eval( surfels.begin(), surfels.end(),
1329 std::back_inserter( mc_estimations ) );
1330 return mc_estimations;
1331 }
std::vector< CurvatureTensorQuantity > CurvatureTensorQuantities

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

◆ getIIPrincipalCurvaturesAndDirections() [2/3]

template<typename TKSpace >
static CurvatureTensorQuantities DGtal::ShortcutsGeometry< TKSpace >::getIIPrincipalCurvaturesAndDirections ( 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 principal curvatures and directions using an 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 getSurfelRange)

Definition at line 1228 of file ShortcutsGeometry.h.

1233 {
1234 auto K = getKSpace( bimage, params );
1235 return getIIPrincipalCurvaturesAndDirections( *bimage, K, surfels, params );
1236 }
static CurvatureTensorQuantities getIIPrincipalCurvaturesAndDirections(CountedPtr< BinaryImage > bimage, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace())

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

Referenced by DGtal::ShortcutsGeometry< TKSpace >::getIIPrincipalCurvaturesAndDirections(), DGtal::ShortcutsGeometry< TKSpace >::getIIPrincipalCurvaturesAndDirections(), and TEST_CASE().

◆ getIIPrincipalCurvaturesAndDirections() [3/3]

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

Given a digital shape dshape, a sequence of surfels, and some parameters vm, returns the principal curvatures and directions using an 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 adding some noise.
  • closed [ 1]: specifies if the Khalimsky space is closed (!=0) or not (==0)
Returns
the vector containing the estimated principal curvatures and directions, 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 getSurfelRange)

Definition at line 1265 of file ShortcutsGeometry.h.

1271 {
1272 auto K = getKSpace( params );
1273 return getIIPrincipalCurvaturesAndDirections( *dshape, K, surfels, params );
1274 }

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

◆ getKSpace() [1/6]

template<typename TKSpace >
static KSpace DGtal::Shortcuts< TKSpace >::getKSpace ( const Point & low,
const Point & up,
Parameters params = parametersKSpace() )
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 332 of file Shortcuts.h.

334 {
335 int closed = params[ "closed" ].as<int>();
336 KSpace K;
337 if ( ! K.init( low, up, closed ) )
338 trace.error() << "[Shortcuts::getKSpace]"
339 << " Error building Khalimsky space K=" << K << std::endl;
340 return K;
341 }
std::ostream & error()

Referenced by DGtal::ShortcutsGeometry< TKSpace >::getIIGaussianCurvatures(), DGtal::ShortcutsGeometry< TKSpace >::getIIGaussianCurvatures(), DGtal::ShortcutsGeometry< TKSpace >::getIIMeanCurvatures(), DGtal::ShortcutsGeometry< TKSpace >::getIIMeanCurvatures(), DGtal::ShortcutsGeometry< TKSpace >::getIINormalVectors(), DGtal::ShortcutsGeometry< TKSpace >::getIINormalVectors(), DGtal::ShortcutsGeometry< TKSpace >::getIIPrincipalCurvaturesAndDirections(), and DGtal::ShortcutsGeometry< TKSpace >::getIIPrincipalCurvaturesAndDirections().

◆ getKSpace() [2/6]

template<typename TKSpace >
template<typename TDigitalSurfaceContainer >
static KSpace DGtal::Shortcuts< TKSpace >::getKSpace ( CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > surface)
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 396 of file Shortcuts.h.

398 {
399 return surface->container().space();
400 }

◆ getKSpace() [3/6]

template<typename TKSpace >
template<typename TDigitalSurfaceContainer >
static KSpace DGtal::Shortcuts< TKSpace >::getKSpace ( CountedPtr< ::DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer > > surface)
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 407 of file Shortcuts.h.

409 {
410 return surface->container().space();
411 }

◆ getKSpace() [4/6]

template<typename TKSpace >
static KSpace DGtal::Shortcuts< TKSpace >::getKSpace ( CountedPtr< BinaryImage > bimage,
Parameters params = parametersKSpace() )
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 354 of file Shortcuts.h.

356 {
357 int closed = params[ "closed" ].as<int>();
358 KSpace K;
359 if ( ! K.init( bimage->domain().lowerBound(),
360 bimage->domain().upperBound(),
361 closed ) )
362 trace.error() << "[Shortcuts::getKSpace]"
363 << " Error building Khalimsky space K=" << K << std::endl;
364 return K;
365 }

◆ getKSpace() [5/6]

template<typename TKSpace >
static KSpace DGtal::Shortcuts< TKSpace >::getKSpace ( CountedPtr< GrayScaleImage > gimage,
Parameters params = parametersKSpace() )
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 378 of file Shortcuts.h.

380 {
381 int closed = params[ "closed" ].as<int>();
382 KSpace K;
383 if ( ! K.init( gimage->domain().lowerBound(),
384 gimage->domain().upperBound(),
385 closed ) )
386 trace.error() << "[Shortcuts::getKSpace]"
387 << " Error building Khalimsky space K=" << K << std::endl;
388 return K;
389 }

◆ getKSpace() [6/6]

template<typename TKSpace >
static KSpace DGtal::Shortcuts< TKSpace >::getKSpace ( Parameters params = parametersKSpace() | parametersDigitizedImplicitShape3D())
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 486 of file Shortcuts.h.

488 {
489 Scalar min_x = params[ "minAABB" ].as<Scalar>();
490 Scalar max_x = params[ "maxAABB" ].as<Scalar>();
491 Scalar h = params[ "gridstep" ].as<Scalar>();
492 Scalar offset = params[ "offset" ].as<Scalar>();
493 bool closed = params[ "closed" ].as<int>();
494 RealPoint p1( min_x - offset * h, min_x - offset * h, min_x - offset * h );
495 RealPoint p2( max_x + offset * h, max_x + offset * h, max_x + offset * h );
496 CountedPtr<DigitizedImplicitShape3D> dshape( new DigitizedImplicitShape3D() );
497 dshape->init( p1, p2, h );
498 Domain domain = dshape->getDomain();
499 KSpace K;
500 if ( ! K.init( domain.lowerBound(), domain.upperBound(), closed ) )
501 trace.error() << "[Shortcuts::getKSpace]"
502 << " Error building Khalimsky space K=" << K << std::endl
503 << "Note: if you use decimal values, check your locale for decimal point '.' or ','."
504 << std::endl;
505 return K;
506 }
const Point & lowerBound() const
const Point & upperBound() const
GaussDigitizer< Space, ImplicitShape3D > DigitizedImplicitShape3D
defines the digitization of an implicit shape.
Domain domain
HyperRectDomain< Space > Domain
PointVector< 3, double > RealPoint

◆ 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 355 of file ShortcutsGeometry.h.

360 {
361 Scalars n_true_estimations;
362 TrueMeanCurvatureEstimator true_estimator;
363 int maxIter = params[ "projectionMaxIter" ].as<int>();
364 double accuracy = params[ "projectionAccuracy" ].as<double>();
365 double gamma = params[ "projectionGamma" ].as<double>();
366 Scalar gridstep = params[ "gridstep" ].as<Scalar>();
367 true_estimator.attach( *shape );
368 true_estimator.setParams( K, MeanCurvatureFunctor(), maxIter, accuracy, gamma );
369 true_estimator.init( gridstep, surfels.begin(), surfels.end() );
370 true_estimator.eval( surfels.begin(), surfels.end(),
371 std::back_inserter( n_true_estimations ) );
372 return n_true_estimations;
373 }
sgf::ShapeMeanCurvatureFunctor< ImplicitShape3D > MeanCurvatureFunctor
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, MeanCurvatureFunctor > TrueMeanCurvatureEstimator

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().

Referenced by main().

◆ 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 316 of file ShortcutsGeometry.h.

321 {
322 RealVectors n_true_estimations;
323 TrueNormalEstimator true_estimator;
324 int maxIter = params[ "projectionMaxIter" ].as<int>();
325 double accuracy = params[ "projectionAccuracy" ].as<double>();
326 double gamma = params[ "projectionGamma" ].as<double>();
327 Scalar gridstep = params[ "gridstep" ].as<Scalar>();
328 true_estimator.attach( *shape );
329 true_estimator.setParams( K, NormalFunctor(), maxIter, accuracy, gamma );
330 true_estimator.init( gridstep, surfels.begin(), surfels.end() );
331 true_estimator.eval( surfels.begin(), surfels.end(),
332 std::back_inserter( n_true_estimations ) );
333 return n_true_estimations;
334 }
sgf::ShapeNormalVectorFunctor< ImplicitShape3D > NormalFunctor
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, NormalFunctor > TrueNormalEstimator

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().

Referenced by main(), and main().

◆ 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 248 of file ShortcutsGeometry.h.

253 {
254 RealVectors n_true_estimations;
255 TruePositionEstimator true_estimator;
256 int maxIter = params[ "projectionMaxIter" ].as<int>();
257 double accuracy = params[ "projectionAccuracy" ].as<double>();
258 double gamma = params[ "projectionGamma" ].as<double>();
259 Scalar gridstep = params[ "gridstep" ].as<Scalar>();
260 true_estimator.attach( *shape );
261 true_estimator.setParams( K, PositionFunctor(), maxIter, accuracy, gamma );
262 true_estimator.init( gridstep, surfels.begin(), surfels.end() );
263 true_estimator.eval( surfels.begin(), surfels.end(),
264 std::back_inserter( n_true_estimations ) );
265 return n_true_estimations;
266 }
sgf::ShapePositionFunctor< ImplicitShape3D > PositionFunctor
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, PositionFunctor > TruePositionEstimator

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().

Referenced by main().

◆ 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 282 of file ShortcutsGeometry.h.

286 {
287 RealPoints proj_points( points.size() );
288 int maxIter = params[ "projectionMaxIter" ].as<int>();
289 double accuracy = params[ "projectionAccuracy" ].as<double>();
290 double gamma = params[ "projectionGamma" ].as<double>();
291 for ( unsigned int i = 0; i < points.size(); ++i )
292 proj_points[ i ] = shape->nearestPoint( points[ i ], accuracy,
293 maxIter, gamma );
294 return proj_points;
295 }
std::vector< RealPoint > RealPoints

◆ getPrincipalCurvaturesAndDirections()

template<typename TKSpace >
static CurvatureTensorQuantities DGtal::ShortcutsGeometry< TKSpace >::getPrincipalCurvaturesAndDirections ( 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 principal curvatures and principal directions as a tuple (k1, k2, d1, d2) at the specified surfels, in the same order.

Note
that the second principal direction 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 principal curvatures and principal directions as a tuple (k1, k2, d1, d2), in the same order as surfels.

Definition at line 605 of file ShortcutsGeometry.h.

610 {
611 CurvatureTensorQuantities n_true_estimations;
613 int maxIter = params[ "projectionMaxIter" ].as<int>();
614 double accuracy = params[ "projectionAccuracy" ].as<double>();
615 double gamma = params[ "projectionGamma" ].as<double>();
616 Scalar gridstep = params[ "gridstep" ].as<Scalar>();
617 true_estimator.attach( *shape );
618 true_estimator.setParams( K, PrincipalCurvaturesAndDirectionsFunctor(),
619 maxIter, accuracy, gamma );
620 true_estimator.init( gridstep, surfels.begin(), surfels.end() );
621 true_estimator.eval( surfels.begin(), surfels.end(),
622 std::back_inserter( n_true_estimations ) );
623 return n_true_estimations;
624 }
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, PrincipalCurvaturesAndDirectionsFunctor > TruePrincipalCurvaturesAndDirectionsEstimator
sgf::ShapePrincipalCurvaturesAndDirectionsFunctor< ImplicitShape3D > PrincipalCurvaturesAndDirectionsFunctor

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().

◆ 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 1697 of file ShortcutsGeometry.h.

1699 {
1700 Scalars result( v1.size() );
1701 std::transform( v2.cbegin(), v2.cend(), v1.cbegin(), result.begin(),
1702 [] ( Scalar val1, Scalar val2 )
1703 { return fabs( val1 - val2 ); } );
1704 return result;
1705 }

Referenced by main().

◆ 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 1730 of file ShortcutsGeometry.h.

1732 {
1733 Scalar sum = 0;
1734 for ( unsigned int i = 0; i < v1.size(); i++ )
1735 sum += fabs( v1[ i ] - v2[ i ] );
1736 return sum / v1.size();
1737 }

Referenced by main().

◆ 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 1714 of file ShortcutsGeometry.h.

1716 {
1717 Scalar sum = 0;
1718 for ( unsigned int i = 0; i < v1.size(); i++ )
1719 sum += ( v1[ i ] - v2[ i ] ) * ( v1[ i ] - v2[ i ] );
1720 return sqrt( sum / v1.size() );
1721 }

Referenced by main().

◆ 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 1746 of file ShortcutsGeometry.h.

1748 {
1749 Scalar loo = 0;
1750 for ( unsigned int i = 0; i < v1.size(); i++ )
1751 loo = std::max( loo, fabs( v1[ i ] - v2[ i ] ) );
1752 return loo;
1753 }

Referenced by main().

◆ getSecondPrincipalCurvatures()

template<typename TKSpace >
static Scalars DGtal::ShortcutsGeometry< TKSpace >::getSecondPrincipalCurvatures ( 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 second (greatest) principal curvatures at the specified surfels, in the same order.

Note
that the second principal 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 second principal curvatures, in the same order as surfels.

Definition at line 478 of file ShortcutsGeometry.h.

483 {
484 Scalars n_true_estimations;
486 int maxIter = params[ "projectionMaxIter" ].as<int>();
487 double accuracy = params[ "projectionAccuracy" ].as<double>();
488 double gamma = params[ "projectionGamma" ].as<double>();
489 Scalar gridstep = params[ "gridstep" ].as<Scalar>();
490 true_estimator.attach( *shape );
491 true_estimator.setParams( K, SecondPrincipalCurvatureFunctor(),
492 maxIter, accuracy, gamma );
493 true_estimator.init( gridstep, surfels.begin(), surfels.end() );
494 true_estimator.eval( surfels.begin(), surfels.end(),
495 std::back_inserter( n_true_estimations ) );
496 return n_true_estimations;
497 }
sgf::ShapeSecondPrincipalCurvatureFunctor< ImplicitShape3D > SecondPrincipalCurvatureFunctor
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, SecondPrincipalCurvatureFunctor > TrueSecondPrincipalCurvatureEstimator

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().

Referenced by main().

◆ getSecondPrincipalDirections()

template<typename TKSpace >
static RealVectors DGtal::ShortcutsGeometry< TKSpace >::getSecondPrincipalDirections ( 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 second principal directions (corresponding to the greatest principal curvature) at the specified surfels, in the same order.

Note
that the second principal direction 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 second principal directions, in the same order as surfels.

Definition at line 562 of file ShortcutsGeometry.h.

567 {
568 RealVectors n_true_estimations;
570 int maxIter = params[ "projectionMaxIter" ].as<int>();
571 double accuracy = params[ "projectionAccuracy" ].as<double>();
572 double gamma = params[ "projectionGamma" ].as<double>();
573 Scalar gridstep = params[ "gridstep" ].as<Scalar>();
574 true_estimator.attach( *shape );
575 true_estimator.setParams( K, SecondPrincipalDirectionFunctor(),
576 maxIter, accuracy, gamma );
577 true_estimator.init( gridstep, surfels.begin(), surfels.end() );
578 true_estimator.eval( surfels.begin(), surfels.end(),
579 std::back_inserter( n_true_estimations ) );
580 return n_true_estimations;
581 }
sgf::ShapeSecondPrincipalDirectionFunctor< ImplicitShape3D > SecondPrincipalDirectionFunctor
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, SecondPrincipalDirectionFunctor > TrueSecondPrincipalDirectionEstimator

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().

Referenced by main().

◆ 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 1654 of file ShortcutsGeometry.h.

1655 {
1656 ScalarStatistic stat;
1657 stat.addValues( v.begin(), v.end() );
1658 stat.terminate();
1659 return stat;
1660 }
::DGtal::Statistic< Scalar > ScalarStatistic

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

Referenced by main().

◆ 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 664 of file ShortcutsGeometry.h.

666 {
667 std::vector< RealVector > result;
668 for ( auto s : surfels )
669 {
670 Dimension k = K.sOrthDir( s );
671 bool direct = K.sDirect( s, k );
672 RealVector t = RealVector::zero;
673 t[ k ] = direct ? -1.0 : 1.0;
674 result.push_back( t );
675 }
676 return result;
677 }
static Self zero
Static const for zero PointVector.
DGtal::uint32_t Dimension
Definition Common.h:136

References K, 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 752 of file ShortcutsGeometry.h.

756 {
757 typedef ExactPredicateLpSeparableMetric<Space,2> Metric;
758 typedef typename TAnyDigitalSurface::DigitalSurfaceContainer SurfaceContainer;
759 RealVectors n_estimations;
760 int verbose = params[ "verbose" ].as<int>();
761 std::string kernel = params[ "kernel" ].as<std::string>();
762 Scalar h = params[ "gridstep" ].as<Scalar>();
763 Scalar R = params[ "R-radius" ].as<Scalar>();
764 Scalar r = params[ "r-radius" ].as<Scalar>();
765 Scalar t = params[ "t-ring" ].as<Scalar>();
766 Scalar alpha = params[ "alpha" ].as<Scalar>();
767 int embedding = params[ "embedding" ].as<int>();
768 // Adjust parameters according to gridstep if specified.
769 if ( alpha != 1.0 ) R *= pow( h, alpha-1.0 );
770 if ( alpha != 1.0 ) r *= pow( h, alpha-1.0 );
771 Surfel2PointEmbedding embType = embedding == 0 ? Pointels :
772 embedding == 1 ? InnerSpel : OuterSpel;
773 if ( verbose > 0 )
774 {
775 trace.info() << "- VCM normal kernel=" << kernel << " emb=" << embedding
776 << " alpha=" << alpha << std::endl;
777 trace.info() << "- VCM normal r=" << (r*h) << " (continuous) "
778 << r << " (discrete)" << std::endl;
779 trace.info() << "- VCM normal R=" << (R*h) << " (continuous) "
780 << R << " (discrete)" << std::endl;
781 trace.info() << "- VCM normal t=" << t << " (discrete)" << std::endl;
782 }
783 if ( kernel == "hat" )
784 {
785 typedef functors::HatPointFunction<Point,Scalar> KernelFunction;
786 typedef VoronoiCovarianceMeasureOnDigitalSurface
787 < SurfaceContainer, Metric, KernelFunction > VCMOnSurface;
788 typedef functors::VCMNormalVectorFunctor<VCMOnSurface> NormalVFunctor;
789 typedef VCMDigitalSurfaceLocalEstimator
790 < SurfaceContainer, Metric, KernelFunction, NormalVFunctor> VCMNormalEstimator;
791 KernelFunction chi_r( 1.0, r );
792 VCMNormalEstimator estimator;
793 estimator.attach( *surface );
794 estimator.setParams( embType, R, r, chi_r, t, Metric(), verbose > 0 );
795 estimator.init( h, surfels.begin(), surfels.end() );
796 estimator.eval( surfels.begin(), surfels.end(),
797 std::back_inserter( n_estimations ) );
798 }
799 else if ( kernel == "ball" )
800 {
801 typedef functors::BallConstantPointFunction<Point,Scalar> KernelFunction;
802 typedef VoronoiCovarianceMeasureOnDigitalSurface
803 < SurfaceContainer, Metric, KernelFunction > VCMOnSurface;
804 typedef functors::VCMNormalVectorFunctor<VCMOnSurface> NormalVFunctor;
805 typedef VCMDigitalSurfaceLocalEstimator
806 < SurfaceContainer, Metric, KernelFunction, NormalVFunctor> VCMNormalEstimator;
807 KernelFunction chi_r( 1.0, r );
808 VCMNormalEstimator estimator;
809 estimator.attach( *surface );
810 estimator.setParams( embType, R, r, chi_r, t, Metric(), verbose > 0 );
811 estimator.init( h, surfels.begin(), surfels.end() );
812 estimator.eval( surfels.begin(), surfels.end(),
813 std::back_inserter( n_estimations ) );
814 }
815 else
816 {
817 trace.warning() << "[ShortcutsGeometry::getVCMNormalVectors] Unknown kernel: "
818 << kernel << std::endl;
819 }
820 return n_estimations;
821 }
std::ostream & warning()
Surfel2PointEmbedding
Possible embeddings for surfel as point(s)

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

Referenced by main().

◆ 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 1669 of file ShortcutsGeometry.h.

1671 {
1672 Scalars v( v1.size() );
1673 if ( v1.size() == v2.size() )
1674 {
1675 auto outIt = v.begin();
1676 for ( auto it1 = v1.cbegin(), it2 = v2.cbegin(), itE1 = v1.cend();
1677 it1 != itE1; ++it1, ++it2 )
1678 {
1679 Scalar angle_error = acos( (*it1).dot( *it2 ) );
1680 *outIt++ = angle_error;
1681 }
1682 }
1683 else
1684 {
1685 trace.warning() << "[ShortcutsGeometry::getVectorsAngleDeviation]"
1686 << " v1.size()=" << v1.size() << " should be equal to "
1687 << " v2.size()=" << v2.size() << std::endl;
1688 }
1689 return v;
1690 }

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 1641 of file ShortcutsGeometry.h.

1643 {
1644 std::transform( ref_v.cbegin(), ref_v.cend(), v.cbegin(), v.begin(),
1645 [] ( RealVector rw, RealVector w )
1646 { return rw.dot( w ) >= 0.0 ? w : -w; } );
1647 }

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

◆ parametersATApproximation()

template<typename TKSpace >
static Parameters DGtal::ShortcutsGeometry< TKSpace >::parametersATApproximation ( )
inlinestatic
Returns
the parameters and their default values which are used to compute Ambrosio-Tortorelli piecewise-smooth approximation of a function.
  • at-enabled [ 1 ]: 1 if AT is enabled (WITH_EIGEN), 0 otherwise.
  • at-alpha [ 0.1 ]: parameter alpha in AT (data fit)
  • at-lambda [ 0.025 ]: parameter lambda in AT (1/length of discontinuities)
  • at-epsilon [ 0.5 ]: (last value of) parameter epsilon in AT (width of discontinuities)
  • at-epsilon-start[ 2.0 ]: first value for parameter epsilon in Gamma-convergence optimization (sequence of AT optimization with decreasing epsilon)
  • at-epsilon-ratio[ 2.0 ]: ratio between two consecutive epsilon value in Gamma-convergence optimization (sequence of AT optimization with decreasing epsilon)
  • at-max-iter [ 10 ]: maximum number of alternate minization in AT optimization
  • at-diff-v-max [ 0.0001]: stopping criterion that measures the loo-norm of the evolution of v between two iterations
  • at-v-policy ["Maximum"]: the policy when outputing feature vector v onto cells: "Average"|"Minimum"|"Maximum"
Note
Requires Eigen linear algebra backend. Use cmake -DWITH_EIGEN=true ..

Definition at line 1353 of file ShortcutsGeometry.h.

1354 {
1355#if defined(WITH_EIGEN)
1356 return Parameters
1357 ( "at-enabled", 1 )
1358 ( "at-alpha", 0.1 )
1359 ( "at-lambda", 0.025 )
1360 ( "at-epsilon", 0.25 )
1361 ( "at-epsilon-start", 2.0 )
1362 ( "at-epsilon-ratio", 2.0 )
1363 ( "at-max-iter", 10 )
1364 ( "at-diff-v-max", 0.0001 )
1365 ( "at-v-policy", "Maximum" );
1366#else // defined(WITH_EIGEN)
1367 return Parameters( "at-enabled", 0 );
1368#endif// defined(WITH_EIGEN)
1369 }

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

◆ 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 461 of file Shortcuts.h.

462 {
463 return Parameters
464 ( "minAABB", -10.0 )
465 ( "maxAABB", 10.0 )
466 ( "gridstep", 1.0 )
467 ( "offset", 5.0 );
468 }

◆ 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 642 of file ShortcutsGeometry.h.

643 {
644 return Parameters
645 ( "verbose", 1 )
646 ( "t-ring", 3.0 )
647 ( "kernel", "hat" )
648 ( "R-radius", 10.0 )
649 ( "r-radius", 3.0 )
650 ( "alpha", 0.33 )
651 ( "surfelEmbedding", 0 );
652 }

Referenced by DGtal::ShortcutsGeometry< TKSpace >::defaultParameters(), main(), precompute(), and TEST_CASE().

◆ 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 311 of file Shortcuts.h.

312 {
313 return Parameters
314 ( "closed", 1 )
315 ( "gridsizex", 1.0 )
316 ( "gridsizey", 1.0 )
317 ( "gridsizez", 1.0 );
318 }

◆ 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 220 of file ShortcutsGeometry.h.

221 {
222 return Parameters
223 ( "projectionMaxIter", 20 )
224 ( "projectionAccuracy", 0.0001 )
225 ( "projectionGamma", 0.5 )
226 ( "gridstep", 1.0 );
227 }

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


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