DGtal 2.2.0
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< Space > Domain
 An (hyper-)rectangular domain.
typedef unsigned char GrayScale
 The type for 8-bits gray-scale elements.
typedef MPolynomial< Space::dimension, Scalar > ScalarPolynomial
 defines a multi-variate polynomial : RealPoint -> Scalar
typedef ImplicitPolynomial3Shape< Space > ImplicitShape3D
typedef GaussDigitizer< Space, ImplicitShape3D > DigitizedImplicitShape3D
 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, GrayScale > GrayScaleImage
 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, BinaryImage > LightSurfaceContainer
typedef ::DGtal::DigitalSurface< LightSurfaceContainer > LightDigitalSurface
 defines a connected digital surface over a binary image.
typedef SetOfSurfels< KSpace, SurfelSet > ExplicitSurfaceContainer
 defines a heavy container that represents any digital surface.
typedef ::DGtal::DigitalSurface< ExplicitSurfaceContainer > DigitalSurface
 defines an arbitrary digital surface over a binary image.
typedef IndexedDigitalSurface< ExplicitSurfaceContainer > IdxDigitalSurface
 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< IdxSurfel > IdxSurfelSet
typedef std::vector< Surfel > SurfelRange
typedef std::vector< Cell > CellRange
typedef std::vector< IdxSurfel > IdxSurfelRange
typedef std::vector< Scalar > Scalars
typedef std::vector< RealVector > RealVectors
typedef std::vector< RealPoint > RealPoints
typedef ::DGtal::Statistic< Scalar > ScalarStatistic
typedef sgf::ShapePositionFunctor< ImplicitShape3D > PositionFunctor
typedef sgf::ShapeNormalVectorFunctor< ImplicitShape3D > NormalFunctor
typedef sgf::ShapeMeanCurvatureFunctor< ImplicitShape3D > MeanCurvatureFunctor
typedef sgf::ShapeGaussianCurvatureFunctor< ImplicitShape3D > GaussianCurvatureFunctor
typedef sgf::ShapeFirstPrincipalCurvatureFunctor< ImplicitShape3D > FirstPrincipalCurvatureFunctor
typedef sgf::ShapeSecondPrincipalCurvatureFunctor< ImplicitShape3D > SecondPrincipalCurvatureFunctor
typedef sgf::ShapeFirstPrincipalDirectionFunctor< ImplicitShape3D > FirstPrincipalDirectionFunctor
typedef sgf::ShapeSecondPrincipalDirectionFunctor< ImplicitShape3D > SecondPrincipalDirectionFunctor
typedef sgf::ShapePrincipalCurvaturesAndDirectionsFunctor< ImplicitShape3D > PrincipalCurvaturesAndDirectionsFunctor
typedef functors::IIPrincipalCurvaturesAndDirectionsFunctor< Space >::Quantity CurvatureTensorQuantity
typedef std::vector< CurvatureTensorQuantity > CurvatureTensorQuantities
typedef CorrectedNormalCurrentComputer< RealPoint, RealVector > CNCComputer
typedef TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, PositionFunctor > TruePositionEstimator
typedef TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, NormalFunctor > TrueNormalEstimator
typedef TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, MeanCurvatureFunctor > TrueMeanCurvatureEstimator
typedef TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, GaussianCurvatureFunctor > TrueGaussianCurvatureEstimator
typedef TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, FirstPrincipalCurvatureFunctor > TrueFirstPrincipalCurvatureEstimator
typedef TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, SecondPrincipalCurvatureFunctor > TrueSecondPrincipalCurvatureEstimator
typedef TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, FirstPrincipalDirectionFunctor > TrueFirstPrincipalDirectionEstimator
typedef TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, SecondPrincipalDirectionFunctor > TrueSecondPrincipalDirectionEstimator
typedef TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, PrincipalCurvaturesAndDirectionsFunctor > TruePrincipalCurvaturesAndDirectionsEstimator
typedef ::DGtal::Mesh< RealPoint > Mesh
typedef ::DGtal::TriangulatedSurface< RealPoint > TriangulatedSurface
typedef ::DGtal::PolygonalSurface< RealPoint > PolygonalSurface
typedef std::map< Surfel, IdxSurfel > Surfel2Index
typedef std::map< Cell, IdxVertex > Cell2Index
typedef DigitalSetByAssociativeContainer< Domain, std::unordered_set< typename Domain::Point > > DigitalSet
typedef functors::NotPointPredicate< DigitalSet > VoronoiPointPredicate
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< Space > Domain
 An (hyper-)rectangular domain.
typedef unsigned char GrayScale
 The type for 8-bits gray-scale elements.
typedef MPolynomial< Space::dimension, Scalar > ScalarPolynomial
 defines a multi-variate polynomial : RealPoint -> Scalar
typedef ImplicitPolynomial3Shape< Space > ImplicitShape3D
typedef GaussDigitizer< Space, ImplicitShape3D > DigitizedImplicitShape3D
 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, GrayScale > GrayScaleImage
 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, BinaryImage > LightSurfaceContainer
typedef ::DGtal::DigitalSurface< LightSurfaceContainer > LightDigitalSurface
 defines a connected digital surface over a binary image.
typedef SetOfSurfels< KSpace, SurfelSet > ExplicitSurfaceContainer
 defines a heavy container that represents any digital surface.
typedef ::DGtal::DigitalSurface< ExplicitSurfaceContainer > DigitalSurface
 defines an arbitrary digital surface over a binary image.
typedef IndexedDigitalSurface< ExplicitSurfaceContainer > IdxDigitalSurface
 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< IdxSurfel > IdxSurfelSet
typedef std::vector< SCell > SCellRange
typedef std::vector< Cell > CellRange
typedef CellRange PointelRange
typedef SCellRange SurfelRange
typedef std::vector< IdxSurfel > IdxSurfelRange
typedef std::vector< Scalar > Scalars
typedef std::vector< RealVector > RealVectors
typedef std::vector< RealPoint > RealPoints
typedef IdxVertex Idx
typedef std::vector< IdxVertex > IdxRange
typedef ::DGtal::Mesh< RealPoint > Mesh
typedef ::DGtal::TriangulatedSurface< RealPoint > TriangulatedSurface
typedef ::DGtal::PolygonalSurface< RealPoint > PolygonalSurface
typedef ::DGtal::SurfaceMesh< RealPoint, RealPoint > SurfaceMesh
typedef std::map< Surfel, IdxSurfel > Surfel2Index
typedef std::map< Cell, IdxVertex > Cell2Index
typedef ::DGtal::Color Color
typedef std::vector< Color > Colors
typedef GradientColorMap< Scalar > ColorMap
typedef TickedColorMap< Scalar, ColorMap > ZeroTickedColorMap

Public Member Functions

Standard services
 ShortcutsGeometry ()=delete
 ~ShortcutsGeometry ()=delete
 ShortcutsGeometry (const ShortcutsGeometry &other)=delete
 ShortcutsGeometry (ShortcutsGeometry &&other)=delete
ShortcutsGeometry & operator= (const ShortcutsGeometry &other)=delete
ShortcutsGeometry & operator= (ShortcutsGeometry &&other)=delete
Public Member Functions inherited from DGtal::Shortcuts< TKSpace >
 Shortcuts ()=delete
 ~Shortcuts ()=delete
 Shortcuts (const Shortcuts &other)=delete
 Shortcuts (Shortcuts &&other)=delete
Shortcuts & operator= (const Shortcuts &other)=delete
Shortcuts & operator= (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 getCNCMeanCurvatures (CountedPtr< typename Base::SurfaceMesh > mesh, const typename Base::SurfaceMesh::Faces faces, const Parameters &params=parametersShapeGeometry())
static Scalars getCNCMeanCurvatures (CountedPtr< typename Base::SurfaceMesh > mesh, const Parameters &params=parametersShapeGeometry())
template<typename T>
static Scalars getCNCMeanCurvatures (T &digitalObject, const Parameters &params=parametersShapeGeometry())
static Scalars getGaussianCurvatures (CountedPtr< ImplicitShape3D > shape, const KSpace &K, const SurfelRange &surfels, const Parameters &params=parametersShapeGeometry())
static Scalars getCNCGaussianCurvatures (CountedPtr< typename Base::SurfaceMesh > mesh, const typename Base::SurfaceMesh::Faces &faces, const Parameters &params=parametersShapeGeometry())
static Scalars getCNCGaussianCurvatures (CountedPtr< typename Base::SurfaceMesh > mesh, const Parameters &params=parametersShapeGeometry())
template<typename T>
static Scalars getCNCGaussianCurvatures (T &digitalObject, 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())
static std::tuple< Scalars, Scalars, RealVectors, RealVectors > getCNCPrincipalCurvaturesAndDirections (CountedPtr< typename Base::SurfaceMesh > mesh, const typename Base::SurfaceMesh::Faces &faces, const Parameters &params=parametersShapeGeometry())
static std::tuple< Scalars, Scalars, RealVectors, RealVectors > getCNCPrincipalCurvaturesAndDirections (CountedPtr< typename Base::SurfaceMesh > mesh, const Parameters &params=parametersShapeGeometry())
template<typename T>
static std::tuple< Scalars, Scalars, RealVectors, RealVectors > getCNCPrincipalCurvaturesAndDirections (T &digitalObject, 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)
VoronoiMap services
static Parameters parametersVoronoiMap ()
template<uint32_t p, typename PointRange>
static VoronoiMap< Space, VoronoiPointPredicate, ExactPredicateLpSeparableMetric< Space, p > > getVoronoiMap (Domain domain, const PointRange &sites, const Parameters &params=parametersVoronoiMap())
 Computes the VoronoiMap on a domain, where sites are given through a range.
template<uint32_t p, typename PointRange>
static VoronoiMap< Space, VoronoiPointPredicate, ExactPredicateLpSeparableMetric< Space, p > > getVoronoiMap (CountedPtr< Domain > domain, const PointRange &sites, const Parameters &params=parametersVoronoiMap())
 Computes the VoronoiMap on a domain, where sites are given through a range.
template<uint32_t p, typename PointRange>
static DistanceTransformation< Space, VoronoiPointPredicate, ExactPredicateLpSeparableMetric< Space, p > > getDistanceTransformation (Domain domain, const PointRange &sites, const Parameters &params=parametersVoronoiMap())
 Computes the Distance Transformation on a domain, where sites are given through a range.
template<uint32_t p, typename PointRangeSites, typename PointRange>
static std::vector< Vector > getDirectionToClosestSite (const PointRange &points, const PointRangeSites &sites, const Parameters &params=parametersVoronoiMap())
 Computes the vector to the closest site from a range of points.
template<uint32_t p, typename PointRangeSites, typename PointRange>
static std::vector< typename ExactPredicateLpSeparableMetric< Space, p >::Value > getDistanceToClosestSite (const PointRange &points, const PointRangeSites &sites, const Parameters &params=parametersVoronoiMap())
 Computes the distances to the closest site from a range of points.
template<uint32_t p, typename PointRangeSites, typename PointRange>
static std::vector< typename ExactPredicateLpSeparableMetric< Space, p >::Value > getRawDistanceToClosestSite (const PointRange &points, const PointRangeSites &sites, const Parameters &params=parametersVoronoiMap())
 Computes the raw distances to the closest site from a range of points.
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< ImplicitShape3D > makeImplicitShape3D (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 KSpace & refKSpace (CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > surface)
template<typename TDigitalSurfaceContainer>
static const KSpace & refKSpace (CountedPtr< ::DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer > > surface)
static CanonicCellEmbedder< KSpace > getCellEmbedder (const KSpace &K)
static CanonicSCellEmbedder< KSpace > getSCellEmbedder (const KSpace &K)
static Parameters parametersDigitizedImplicitShape3D ()
static KSpace getKSpace (Parameters params=parametersKSpace()|parametersDigitizedImplicitShape3D())
static CountedPtr< DigitizedImplicitShape3D > makeDigitizedImplicitShape3D (CountedPtr< ImplicitShape3D > shape, Parameters params=parametersDigitizedImplicitShape3D())
static Parameters parametersBinaryImage ()
static CountedPtr< BinaryImage > makeBinaryImage (Domain shapeDomain)
static CountedPtr< BinaryImage > makeBinaryImage (CountedPtr< DigitizedImplicitShape3D > shape_digitization, Parameters params=parametersBinaryImage())
static CountedPtr< BinaryImage > makeBinaryImage (CountedPtr< DigitizedImplicitShape3D > shape_digitization, Domain shapeDomain, Parameters params=parametersBinaryImage())
static CountedPtr< BinaryImage > makeBinaryImage (CountedPtr< BinaryImage > bimage, Parameters params=parametersBinaryImage())
static CountedPtr< BinaryImage > makeBinaryImage (std::string input, Parameters params=parametersBinaryImage())
template<typename T, typename __U = std::enable_if_t<std::is_arithmetic_v<T>>>
static CountedPtr< BinaryImage > makeBinaryImage (const std::vector< T > &values, const Domain &d)
template<typename T, template< class... > class C1, template< class... > class C2, template< class... > class C3>
static CountedPtr< BinaryImage > makeBinaryImage (const C1< C2< C3< T > > > &values, std::optional< Domain > override_domain=std::nullopt)
template<typename T, std::enable_if_t<!is_double_nested_container< T >::value, int > = 0>
static CountedPtr< BinaryImage > makeBinaryImage (const std::vector< T > &positions, std::optional< Domain > override_domain=std::nullopt)
static CountedPtr< BinaryImage > makeBinaryImage (CountedPtr< GrayScaleImage > gray_scale_image, Parameters params=parametersBinaryImage())
static bool saveBinaryImage (CountedPtr< BinaryImage > bimage, std::string output)
static Parameters parametersGrayScaleImage ()
static CountedPtr< GrayScaleImage > makeGrayScaleImage (Domain aDomain)
static CountedPtr< GrayScaleImage > makeGrayScaleImage (std::string input)
static CountedPtr< GrayScaleImage > makeGrayScaleImage (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< GrayScaleImage > makeGrayScaleImage (CountedPtr< FloatImage > fimage, Parameters params=parametersGrayScaleImage())
static CountedPtr< GrayScaleImage > makeGrayScaleImage (CountedPtr< DoubleImage > fimage, Parameters params=parametersGrayScaleImage())
template<typename T, typename __U = std::enable_if_t<std::is_arithmetic_v<T>>>
static CountedPtr< GrayScaleImage > makeGrayScaleImage (const std::vector< T > &values, const Domain &d)
template<typename T, template< class... > class C1, template< class... > class C2, template< class... > class C3>
static CountedPtr< GrayScaleImage > makeGrayScaleImage (const C1< C2< C3< T > > > &values, std::optional< Domain > override_domain=std::nullopt)
template<typename T, typename U, std::enable_if_t<!is_double_nested_container< T >::value, int > = 0>
static CountedPtr< GrayScaleImage > makeGrayScaleImage (const std::vector< T > &positions, const std::vector< U > &values, std::optional< Domain > override_domain=std::nullopt)
static CountedPtr< FloatImage > makeFloatImage (Domain aDomain)
static CountedPtr< FloatImage > makeFloatImage (std::string input)
static CountedPtr< FloatImage > makeFloatImage (CountedPtr< ImplicitShape3D > shape, Parameters params=parametersDigitizedImplicitShape3D())
static CountedPtr< DoubleImage > makeDoubleImage (Domain aDomain)
static CountedPtr< DoubleImage > makeDoubleImage (std::string input)
static CountedPtr< DoubleImage > makeDoubleImage (CountedPtr< ImplicitShape3D > shape, Parameters params=parametersDigitizedImplicitShape3D())
static Parameters parametersDigitalSurface ()
template<typename TDigitalSurfaceContainer>
static CanonicCellEmbedder< KSpace > getCellEmbedder (CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > surface)
template<typename TDigitalSurfaceContainer>
static CanonicSCellEmbedder< KSpace > getSCellEmbedder (CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > surface)
template<typename TDigitalSurfaceContainer>
static CanonicCellEmbedder< KSpace > getCellEmbedder (CountedPtr< ::DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer > > surface)
template<typename TDigitalSurfaceContainer>
static CanonicSCellEmbedder< KSpace > getSCellEmbedder (CountedPtr< ::DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer > > surface)
static CountedPtr< LightDigitalSurface > makeLightDigitalSurface (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< DigitalSurface > makeDigitalSurface (CountedPtr< TPointPredicate > bimage, const KSpace &K, const Parameters &params=parametersDigitalSurface())
static CountedPtr< DigitalSurface > makeDigitalSurface (CountedPtr< IdxDigitalSurface > idx_surface, const Parameters &params=parametersDigitalSurface())
static CountedPtr< IdxDigitalSurface > makeIdxDigitalSurface (CountedPtr< BinaryImage > bimage, const KSpace &K, const Parameters &params=parametersDigitalSurface())
template<typename TSurfelRange>
static CountedPtr< IdxDigitalSurface > makeIdxDigitalSurface (const TSurfelRange &surfels, ConstAlias< KSpace > K, const Parameters &params=parametersDigitalSurface())
template<typename TDigitalSurfaceContainer>
static CountedPtr< IdxDigitalSurface > makeIdxDigitalSurface (CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > surface, const Parameters &params=parametersDigitalSurface())
static CountedPtr< IdxDigitalSurface > makeIdxDigitalSurface (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< TriangulatedSurface > makeTriangulatedSurface (CountedPtr< Mesh > aMesh)
static CountedPtr< Mesh > makeMesh (CountedPtr< TriangulatedSurface > triSurf, const Color &aColor=Color::White)
static CountedPtr< Mesh > makeMesh (CountedPtr< PolygonalSurface > polySurf, const Color &aColor=Color::White)
template<typename TContainer>
static CountedPtr< TriangulatedSurface > makeTriangulatedSurface (Surfel2Index &s2i, CountedPtr< ::DGtal::DigitalSurface< TContainer > > aSurface)
template<typename TContainer>
static CountedPtr< TriangulatedSurface > makeTriangulatedSurface (CountedPtr< ::DGtal::DigitalSurface< TContainer > > aSurface)
static CountedPtr< TriangulatedSurface > makeTriangulatedSurface (CountedPtr< PolygonalSurface > polySurf, const Parameters &params=parametersMesh())
static CountedPtr< PolygonalSurface > makePolygonalSurface (CountedPtr< Mesh > aMesh)
static CountedPtr< PolygonalSurface > makePolygonalSurface (CountedPtr< GrayScaleImage > gray_scale_image, const Parameters &params=parametersKSpace()|parametersBinaryImage()|parametersDigitalSurface())
static CountedPtr< TriangulatedSurface > makeTriangulatedSurface (CountedPtr< GrayScaleImage > gray_scale_image, const Parameters &params=parametersKSpace()|parametersBinaryImage()|parametersDigitalSurface())
template<typename TContainer>
static CountedPtr< PolygonalSurface > makeDualPolygonalSurface (Surfel2Index &s2i, CountedPtr< ::DGtal::DigitalSurface< TContainer > > aSurface)
template<typename TContainer>
static CountedPtr< PolygonalSurface > makeDualPolygonalSurface (CountedPtr< ::DGtal::DigitalSurface< TContainer > > aSurface)
template<typename TContainer>
static CountedPtr< PolygonalSurface > makeDualPolygonalSurface (CountedPtr< ::DGtal::IndexedDigitalSurface< TContainer > > aSurface)
template<typename TContainer>
static CountedPtr< PolygonalSurface > makePrimalPolygonalSurface (Cell2Index &c2i, CountedPtr< ::DGtal::DigitalSurface< TContainer > > aSurface)
template<typename TContainer>
static CountedPtr< PolygonalSurface > makePrimalPolygonalSurface (CountedPtr< ::DGtal::DigitalSurface< TContainer > > aSurface)
template<typename TContainer>
static CountedPtr< PolygonalSurface > makePrimalPolygonalSurface (CountedPtr< ::DGtal::IndexedDigitalSurface< TContainer > > aSurface)
template<typename TContainer>
static CountedPtr< SurfaceMesh > makePrimalSurfaceMesh (Cell2Index &c2i, CountedPtr< ::DGtal::DigitalSurface< TContainer > > aSurface)
template<typename TContainer>
static CountedPtr< SurfaceMesh > makePrimalSurfaceMesh (CountedPtr< ::DGtal::DigitalSurface< TContainer > > aSurface)
template<typename TContainer>
static CountedPtr< SurfaceMesh > makePrimalSurfaceMesh (CountedPtr< ::DGtal::IndexedDigitalSurface< TContainer > > aSurface)
static CountedPtr< SurfaceMesh > makeSurfaceMesh (const std::string &path)
template<typename TPoint, typename TVector>
static bool saveOBJ (CountedPtr< ::DGtal::SurfaceMesh< TPoint, TVector > > surf, const std::string &objfile)
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, typename TVector>
static bool saveOBJ (CountedPtr< ::DGtal::SurfaceMesh< TPoint, TVector > > surf, 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 >))

Static Private Member Functions

template<typename TEstimator, typename TFunctor, typename TPointPredicate>
static std::vector< typename TEstimator::Quantity > getIICurvatureEstimation (const char *description, const TPointPredicate &shape, const KSpace &K, const SurfelRange &surfels, const Parameters &params)
static Domain::Dimension getIIParallelSplitAxis (const Parameters &params)

Detailed Description

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

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

Description of template class 'ShortcutsGeometry'

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

Definition at line 82 of file ShortcutsGeometry.h.

Member Typedef Documentation

◆ Arc

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

Definition at line 150 of file ShortcutsGeometry.h.

◆ ArcRange

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

Definition at line 152 of file ShortcutsGeometry.h.

◆ Base

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

Definition at line 86 of file ShortcutsGeometry.h.

◆ BinaryImage

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

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

Definition at line 126 of file ShortcutsGeometry.h.

◆ Cell

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

Definition at line 147 of file ShortcutsGeometry.h.

◆ Cell2Index

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

Definition at line 205 of file ShortcutsGeometry.h.

◆ CellRange

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

Definition at line 159 of file ShortcutsGeometry.h.

◆ CNCComputer

template<typename TKSpace>
typedef CorrectedNormalCurrentComputer<RealPoint, RealVector> DGtal::ShortcutsGeometry< TKSpace >::CNCComputer

Definition at line 180 of file ShortcutsGeometry.h.

◆ CurvatureTensorQuantities

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

Definition at line 178 of file ShortcutsGeometry.h.

◆ CurvatureTensorQuantity

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

Definition at line 177 of file ShortcutsGeometry.h.

◆ DigitalSet

template<typename TKSpace>
typedef DigitalSetByAssociativeContainer<Domain, std::unordered_set<typename Domain::Point> > DGtal::ShortcutsGeometry< TKSpace >::DigitalSet

Definition at line 207 of file ShortcutsGeometry.h.

◆ DigitalSurface

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

defines an arbitrary digital surface over a binary image.

Definition at line 143 of file ShortcutsGeometry.h.

◆ DigitizedImplicitShape3D

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

defines the digitization of an implicit shape.

Definition at line 124 of file ShortcutsGeometry.h.

◆ Domain

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

An (hyper-)rectangular domain.

Definition at line 112 of file ShortcutsGeometry.h.

◆ DoubleImage

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

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

Definition at line 132 of file ShortcutsGeometry.h.

◆ ExplicitSurfaceContainer

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

defines a heavy container that represents any digital surface.

Definition at line 141 of file ShortcutsGeometry.h.

◆ Face

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

Definition at line 151 of file ShortcutsGeometry.h.

◆ FirstPrincipalCurvatureFunctor

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

Definition at line 171 of file ShortcutsGeometry.h.

◆ FirstPrincipalDirectionFunctor

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

Definition at line 173 of file ShortcutsGeometry.h.

◆ FloatImage

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

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

Definition at line 130 of file ShortcutsGeometry.h.

◆ GaussianCurvatureFunctor

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

Definition at line 170 of file ShortcutsGeometry.h.

◆ GrayScale

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

The type for 8-bits gray-scale elements.

Definition at line 114 of file ShortcutsGeometry.h.

◆ GrayScaleImage

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

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

Definition at line 128 of file ShortcutsGeometry.h.

◆ IdxArc

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

Definition at line 155 of file ShortcutsGeometry.h.

◆ IdxArcRange

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

Definition at line 156 of file ShortcutsGeometry.h.

◆ IdxDigitalSurface

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

defines a connected or not indexed digital surface.

Definition at line 145 of file ShortcutsGeometry.h.

◆ IdxSurfel

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

Definition at line 153 of file ShortcutsGeometry.h.

◆ IdxSurfelRange

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

Definition at line 160 of file ShortcutsGeometry.h.

◆ IdxSurfelSet

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

Definition at line 157 of file ShortcutsGeometry.h.

◆ IdxVertex

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

Definition at line 154 of file ShortcutsGeometry.h.

◆ ImplicitShape3D

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

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

Definition at line 122 of file ShortcutsGeometry.h.

◆ Integer

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

Integer numbers.

Definition at line 100 of file ShortcutsGeometry.h.

◆ KSpace

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

Digital cellular space.

Definition at line 96 of file ShortcutsGeometry.h.

◆ LightDigitalSurface

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

defines a connected digital surface over a binary image.

Definition at line 139 of file ShortcutsGeometry.h.

◆ LightSurfaceContainer

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

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

Definition at line 137 of file ShortcutsGeometry.h.

◆ MeanCurvatureFunctor

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

Definition at line 169 of file ShortcutsGeometry.h.

◆ Mesh

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

Definition at line 201 of file ShortcutsGeometry.h.

◆ NormalFunctor

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

Definition at line 168 of file ShortcutsGeometry.h.

◆ Point

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

Point with integer coordinates.

Definition at line 102 of file ShortcutsGeometry.h.

◆ PolygonalSurface

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

Definition at line 203 of file ShortcutsGeometry.h.

◆ PositionFunctor

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

Definition at line 167 of file ShortcutsGeometry.h.

◆ PrincipalCurvaturesAndDirectionsFunctor

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

Definition at line 175 of file ShortcutsGeometry.h.

◆ RealPoint

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

Point with floating-point coordinates.

Definition at line 108 of file ShortcutsGeometry.h.

◆ RealPoints

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

Definition at line 163 of file ShortcutsGeometry.h.

◆ RealVector

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

Vector with floating-point coordinates.

Definition at line 106 of file ShortcutsGeometry.h.

◆ RealVectors

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

Definition at line 162 of file ShortcutsGeometry.h.

◆ Scalar

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

Floating-point numbers.

Definition at line 110 of file ShortcutsGeometry.h.

◆ ScalarPolynomial

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

defines a multi-variate polynomial : RealPoint -> Scalar

Definition at line 119 of file ShortcutsGeometry.h.

◆ Scalars

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

Definition at line 161 of file ShortcutsGeometry.h.

◆ ScalarStatistic

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

Definition at line 165 of file ShortcutsGeometry.h.

◆ SCell

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

Definition at line 148 of file ShortcutsGeometry.h.

◆ SecondPrincipalCurvatureFunctor

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

Definition at line 172 of file ShortcutsGeometry.h.

◆ SecondPrincipalDirectionFunctor

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

Definition at line 174 of file ShortcutsGeometry.h.

◆ Self

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

Definition at line 87 of file ShortcutsGeometry.h.

◆ Space

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

Digital space.

Definition at line 98 of file ShortcutsGeometry.h.

◆ Surfel

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

Definition at line 146 of file ShortcutsGeometry.h.

◆ Surfel2Index

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

Definition at line 204 of file ShortcutsGeometry.h.

◆ SurfelRange

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

Definition at line 158 of file ShortcutsGeometry.h.

◆ SurfelSet

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

defines a set of surfels

Definition at line 134 of file ShortcutsGeometry.h.

◆ TriangulatedSurface

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

Definition at line 202 of file ShortcutsGeometry.h.

◆ TrueFirstPrincipalCurvatureEstimator

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

Definition at line 191 of file ShortcutsGeometry.h.

◆ TrueFirstPrincipalDirectionEstimator

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

Definition at line 195 of file ShortcutsGeometry.h.

◆ TrueGaussianCurvatureEstimator

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

Definition at line 189 of file ShortcutsGeometry.h.

◆ TrueMeanCurvatureEstimator

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

Definition at line 187 of file ShortcutsGeometry.h.

◆ TrueNormalEstimator

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

Definition at line 185 of file ShortcutsGeometry.h.

◆ TruePositionEstimator

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

Definition at line 183 of file ShortcutsGeometry.h.

◆ TruePrincipalCurvaturesAndDirectionsEstimator

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

Definition at line 199 of file ShortcutsGeometry.h.

◆ TrueSecondPrincipalCurvatureEstimator

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

Definition at line 193 of file ShortcutsGeometry.h.

◆ TrueSecondPrincipalDirectionEstimator

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

Definition at line 197 of file ShortcutsGeometry.h.

◆ Vector

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

Vector with integer coordinates.

Definition at line 104 of file ShortcutsGeometry.h.

◆ Vertex

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

Definition at line 149 of file ShortcutsGeometry.h.

◆ VoronoiPointPredicate

template<typename TKSpace>
typedef functors::NotPointPredicate<DigitalSet> DGtal::ShortcutsGeometry< TKSpace >::VoronoiPointPredicate

Definition at line 208 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>
Parameters DGtal::ShortcutsGeometry< TKSpace >::defaultParameters ( )
inlinestatic
Returns
the parameters used in ShortcutsGeometry.

Definition at line 219 of file ShortcutsGeometry.h.

220 {
225 }
static Parameters parametersGeometryEstimation()
static Parameters parametersShapeGeometry()
static Parameters parametersATApproximation()
static Parameters parametersVoronoiMap()

◆ getATScalarFieldApproximation() [1/2]

template<typename TKSpace>
template<typename TAnyDigitalSurface>
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 minimization 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.

Definition at line 1902 of file ShortcutsGeometry.h.

1907 {
1908 (void)surface; //param not used FIXME: JOL
1909
1910 int verbose = params[ "verbose" ].as<int>();
1911 Scalar alpha_at = params[ "at-alpha" ].as<Scalar>();
1912 Scalar lambda_at = params[ "at-lambda" ].as<Scalar>();
1913 Scalar epsilon1 = params[ "at-epsilon-start" ].as<Scalar>();
1914 Scalar epsilon2 = params[ "at-epsilon" ].as<Scalar>();
1915 Scalar epsilonr = params[ "at-epsilon-ratio" ].as<Scalar>();
1916 int max_iter = params[ "at-max-iter" ].as<int>();
1917 Scalar diff_v_max= params[ "at-diff-v-max" ].as<Scalar>();
1919 const auto calculus = CalculusFactory::createFromNSCells<2>( surfels.cbegin(), surfels.cend() );
1921 at_solver.initInputScalarFieldU2( input, surfels.cbegin(), surfels.cend() );
1922 at_solver.setUp( alpha_at, lambda_at );
1923 at_solver.solveGammaConvergence( epsilon1, epsilon2, epsilonr, false, diff_v_max, max_iter );
1924 auto output = input;
1925 at_solver.getOutputScalarFieldU2( output, surfels.cbegin(), surfels.cend() );
1926 return output;
1927 }
Aim: This class is used to simplify shape and surface creation. With it, you can create new shapes an...
RealVector::Component Scalar
Floating-point numbers.

◆ getATScalarFieldApproximation() [2/2]

template<typename TKSpace>
template<typename TAnyDigitalSurface, typename CellRangeConstIterator>
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 minimization 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 outputting 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.

Definition at line 1967 of file ShortcutsGeometry.h.

1975 {
1976 (void)surface; //param not used FIXME: JOL
1977
1978 int verbose = params[ "verbose" ].as<int>();
1979 Scalar alpha_at = params[ "at-alpha" ].as<Scalar>();
1980 Scalar lambda_at = params[ "at-lambda" ].as<Scalar>();
1981 Scalar epsilon1 = params[ "at-epsilon-start" ].as<Scalar>();
1982 Scalar epsilon2 = params[ "at-epsilon" ].as<Scalar>();
1983 Scalar epsilonr = params[ "at-epsilon-ratio" ].as<Scalar>();
1984 int max_iter = params[ "at-max-iter" ].as<int>();
1985 Scalar diff_v_max= params[ "at-diff-v-max" ].as<Scalar>();
1986 std::string policy = params[ "at-v-policy" ].as<std::string>();
1988 const auto calculus = CalculusFactory::createFromNSCells<2>( surfels.cbegin(), surfels.cend() );
1990 at_solver.initInputScalarFieldU2( input, surfels.cbegin(), surfels.cend() );
1991 at_solver.setUp( alpha_at, lambda_at );
1992 at_solver.solveGammaConvergence( epsilon1, epsilon2, epsilonr, false, diff_v_max, max_iter );
1993 auto output = input;
1994 at_solver.getOutputScalarFieldU2( output, surfels.cbegin(), surfels.cend() );
1995 auto p = ( policy == "Average" ) ? at_solver.Average
1996 : ( policy == "Minimum" ) ? at_solver.Minimum
1998 at_solver.getOutputScalarFieldV0( features, itB, itE, p );
1999 return output;
2000 }

◆ getATVectorFieldApproximation() [1/2]

template<typename TKSpace>
template<typename TAnyDigitalSurface, typename VectorFieldInput>
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 minimization 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.

Definition at line 1779 of file ShortcutsGeometry.h.

1784 {
1785 (void)surface; //param not used. FIXME: JOL
1786
1787 int verbose = params[ "verbose" ].as<int>();
1788 Scalar alpha_at = params[ "at-alpha" ].as<Scalar>();
1789 Scalar lambda_at = params[ "at-lambda" ].as<Scalar>();
1790 Scalar epsilon1 = params[ "at-epsilon-start" ].as<Scalar>();
1791 Scalar epsilon2 = params[ "at-epsilon" ].as<Scalar>();
1792 Scalar epsilonr = params[ "at-epsilon-ratio" ].as<Scalar>();
1793 int max_iter = params[ "at-max-iter" ].as<int>();
1794 Scalar diff_v_max= params[ "at-diff-v-max" ].as<Scalar>();
1796 const auto calculus = CalculusFactory::createFromNSCells<2>( surfels.cbegin(), surfels.cend() );
1798 at_solver.initInputVectorFieldU2( input, surfels.cbegin(), surfels.cend() );
1799 at_solver.setUp( alpha_at, lambda_at );
1800 at_solver.solveGammaConvergence( epsilon1, epsilon2, epsilonr, false, diff_v_max, max_iter );
1801 auto output = input;
1802 at_solver.getOutputVectorFieldU2( output, surfels.cbegin(), surfels.cend() );
1803 return output;
1804 }

◆ getATVectorFieldApproximation() [2/2]

template<typename TKSpace>
template<typename TAnyDigitalSurface, typename VectorFieldInput, typename CellRangeConstIterator>
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 minimization 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 outputting 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.

Definition at line 1841 of file ShortcutsGeometry.h.

1849 {
1850 (void)surface; //param not used FIXME: JOL
1851
1852 int verbose = params[ "verbose" ].as<int>();
1853 Scalar alpha_at = params[ "at-alpha" ].as<Scalar>();
1854 Scalar lambda_at = params[ "at-lambda" ].as<Scalar>();
1855 Scalar epsilon1 = params[ "at-epsilon-start" ].as<Scalar>();
1856 Scalar epsilon2 = params[ "at-epsilon" ].as<Scalar>();
1857 Scalar epsilonr = params[ "at-epsilon-ratio" ].as<Scalar>();
1858 int max_iter = params[ "at-max-iter" ].as<int>();
1859 Scalar diff_v_max= params[ "at-diff-v-max" ].as<Scalar>();
1860 std::string policy = params[ "at-v-policy" ].as<std::string>();
1862 const auto calculus = CalculusFactory::createFromNSCells<2>( surfels.cbegin(), surfels.cend() );
1864 at_solver.initInputVectorFieldU2( input, surfels.cbegin(), surfels.cend() );
1865 at_solver.setUp( alpha_at, lambda_at );
1866 at_solver.solveGammaConvergence( epsilon1, epsilon2, epsilonr, false, diff_v_max, max_iter );
1867 auto output = input;
1868 at_solver.getOutputVectorFieldU2( output, surfels.cbegin(), surfels.cend() );
1869 auto p = ( policy == "Average" ) ? at_solver.Average
1870 : ( policy == "Minimum" ) ? at_solver.Minimum
1872 at_solver.getOutputScalarFieldV0( features, itB, itE, p );
1873 return output;
1874 }

◆ getCNCGaussianCurvatures() [1/3]

template<typename TKSpace>
Scalars DGtal::ShortcutsGeometry< TKSpace >::getCNCGaussianCurvatures ( CountedPtr< typename Base::SurfaceMesh > mesh,
const Parameters & params = parametersShapeGeometry() )
inlinestatic

Given a SurfaceMesh, compute gaussian curvature at each face using CorrectedNormalCurrent method.

This overloads compute curvature for each face of the mesh.

Warning
In this code, only triangles with barycenters strictly inside the sphere are considered.
Parameters
meshThe surface mesh
params
  • unit_u: Whether the computed normals should be normalized or not
  • 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, CNC)."
  • gridstep [ 1.0]: the digitization gridstep (often denoted by h).
Returns
The curvatures for each face of the mesh, in then the order given by the mesh

Definition at line 591 of file ShortcutsGeometry.h.

594 {
596 std::iota(allFaces.begin(), allFaces.end(), 0);
597
599 }
static Scalars getCNCGaussianCurvatures(CountedPtr< typename Base::SurfaceMesh > mesh, const typename Base::SurfaceMesh::Faces &faces, const Parameters &params=parametersShapeGeometry())

◆ getCNCGaussianCurvatures() [2/3]

template<typename TKSpace>
Scalars DGtal::ShortcutsGeometry< TKSpace >::getCNCGaussianCurvatures ( CountedPtr< typename Base::SurfaceMesh > mesh,
const typename Base::SurfaceMesh::Faces & faces,
const Parameters & params = parametersShapeGeometry() )
inlinestatic

Given a SurfaceMesh, compute gaussian curvature at each face using CorrectedNormalCurrent method.

Warning
In this code, only triangles with barycenters strictly inside the sphere are considered.
Parameters
meshThe surface mesh
facesThe faces to compute curvature at
params
  • unit_u: Whether the computed normals should be normalized or not
  • 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, CNC)."
  • gridstep [ 1.0]: the digitization gridstep (often denoted by h).
Returns
The curvatures for each face of the mesh, in the same order faces

Definition at line 544 of file ShortcutsGeometry.h.

548 {
549 bool unit_u = params["unit_u"].as<int>();
550 double radius = params["r-radius"].as<double>();
551 double alpha = params["alpha"].as<double>();
552 double h = params["gridstep"].as<double>();
553 if ( alpha != 1.0 ) radius *= pow( h, alpha-1.0 );
554
556
557 const auto& mu0 = computer.computeMu0();
558 const auto& mu2 = computer.computeMu2();
559
560 Scalars curvatures(faces.size());
561 for (size_t i = 0; i < faces.size(); ++i)
562 {
563 const auto center = mesh->faceCentroid(faces[i]);
564 const auto area = mu0.measure(center, radius, faces[i]);
565 const auto lmu2 = mu2.measure(center, radius, faces[i]);
567 }
568
569 return curvatures;
570 }
CorrectedNormalCurrentComputer< RealPoint, RealVector > CNCComputer
std::vector< Scalar > Scalars

◆ getCNCGaussianCurvatures() [3/3]

template<typename TKSpace>
template<typename T>
Scalars DGtal::ShortcutsGeometry< TKSpace >::getCNCGaussianCurvatures ( T & digitalObject,
const Parameters & params = parametersShapeGeometry() )
inlinestatic

Given a SurfaceMesh, compute mean curvature at each face using CorrectedNormalCurrent method.

Warning
In this code, only triangles with barycenters strictly inside the sphere are considered.
Template Parameters
TAny digital object convertible to surface mesh via Shortcuts::makePrimalSurfaceMesh
Parameters
digitalObjectA digital object
params
  • unit_u: Whether the computed normals should be normalized or not
  • 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, CNC)."
  • gridstep [ 1.0]: the digitization gridstep (often denoted by h).
Returns
The curvatures for each face of the triangulated surface object

Definition at line 620 of file ShortcutsGeometry.h.

622 {
625 }
static CountedPtr< SurfaceMesh > makePrimalSurfaceMesh(Cell2Index &c2i, CountedPtr< ::DGtal::DigitalSurface< TContainer > > aSurface)
Definition Shortcuts.h:2633

◆ getCNCMeanCurvatures() [1/3]

template<typename TKSpace>
Scalars DGtal::ShortcutsGeometry< TKSpace >::getCNCMeanCurvatures ( CountedPtr< typename Base::SurfaceMesh > mesh,
const Parameters & params = parametersShapeGeometry() )
inlinestatic

Given a SurfaceMesh, compute mean curvature at each face using CorrectedNormalCurrent method.

This overloads compute curvature for each face of the mesh.

Warning
In this code, only triangles with barycenters strictly inside the sphere are considered.
Parameters
meshThe surface mesh
params
  • unit_u: Whether the computed normals should be normalized or not
  • 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, CNC)."
  • gridstep [ 1.0]: the digitization gridstep (often denoted by h).
Returns
The curvatures for each face of mesh, in the the order given by the mesh

Definition at line 450 of file ShortcutsGeometry.h.

453 {
455 std::iota(allFaces.begin(), allFaces.end(), 0);
456
458 }
static Scalars getCNCMeanCurvatures(CountedPtr< typename Base::SurfaceMesh > mesh, const typename Base::SurfaceMesh::Faces faces, const Parameters &params=parametersShapeGeometry())

◆ getCNCMeanCurvatures() [2/3]

template<typename TKSpace>
Scalars DGtal::ShortcutsGeometry< TKSpace >::getCNCMeanCurvatures ( CountedPtr< typename Base::SurfaceMesh > mesh,
const typename Base::SurfaceMesh::Faces faces,
const Parameters & params = parametersShapeGeometry() )
inlinestatic

Given a SurfaceMesh, compute mean curvature at each face using CorrectedNormalCurrent method.

Warning
In this code, only triangles with barycenters strictly inside the sphere are considered.
Parameters
meshThe surface mesh
facesThe faces to compute curvature at
params
  • unit_u: Whether the computed normals should be normalized or not
  • 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, CNC)."
  • gridstep [ 1.0]: the digitization gridstep (often denoted by h).
Returns
The curvatures for each face of the mesh, in the same order faces

Definition at line 403 of file ShortcutsGeometry.h.

407 {
408 bool unit_u = params["unit_u"].as<int>();
409 double radius = params["r-radius"].as<double>();
410 double alpha = params["alpha"].as<double>();
411 double h = params["gridstep"].as<double>();
412 if ( alpha != 1.0 ) radius *= pow( h, alpha-1.0 );
413
415
416 const auto& mu0 = computer.computeMu0();
417 const auto& mu1 = computer.computeMu1();
418
419 Scalars curvatures(faces.size());
420 for (size_t i = 0; i < faces.size(); ++i)
421 {
422 const auto center = mesh->faceCentroid(faces[i]);
423 const auto area = mu0.measure(center, radius, faces[i]);
424 const auto lmu1 = mu1.measure(center, radius, faces[i]);
426 }
427
428 return curvatures;
429 }

◆ getCNCMeanCurvatures() [3/3]

template<typename TKSpace>
template<typename T>
Scalars DGtal::ShortcutsGeometry< TKSpace >::getCNCMeanCurvatures ( T & digitalObject,
const Parameters & params = parametersShapeGeometry() )
inlinestatic

Given a SurfaceMesh, compute mean curvature at each face using CorrectedNormalCurrent method.

Warning
In this code, only triangles with barycenters strictly inside the sphere are considered.
Template Parameters
Anydigital object convertible to surface mesh via Shortcuts::makePrimalSurfaceMesh
Parameters
digitalObjectA digital object
params
  • unit_u: Whether the computed normals should be normalized or not
  • 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, CNC)."
  • gridstep [ 1.0]: the digitization gridstep (often denoted by h).
Returns
The curvatures for each face of the triangulated surface object

Definition at line 479 of file ShortcutsGeometry.h.

◆ getCNCPrincipalCurvaturesAndDirections() [1/3]

template<typename TKSpace>
std::tuple< Scalars, Scalars, RealVectors, RealVectors > DGtal::ShortcutsGeometry< TKSpace >::getCNCPrincipalCurvaturesAndDirections ( CountedPtr< typename Base::SurfaceMesh > mesh,
const Parameters & params = parametersShapeGeometry() )
inlinestatic

Given a SurfaceMesh, compute principal curvature at each face using CorrectedNormalCurrent method.

This overloads compute curvature for each face of the mesh.

Note
If no normals are provided for the faces, the normals will be computed (and set) using vertex normals if they exist and positions otherwise.
Warning
In this code, only triangles with barycenters strictly inside the sphere are considered.
Parameters
[in,out]meshThe surface mesh. The mesh will be modified if no face normals are provided.
[in]params
  • unit_u: Whether the computed normals should be normalized or not
  • 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, CNC)."
  • gridstep [ 1.0]: the digitization gridstep (often denoted by h).
Returns
The principal curvatures for each face of the mesh, in the same order as mesh faces. The result is a 4-element tuples: [first curvatures, second curvatures, first directions, second directions].

Definition at line 929 of file ShortcutsGeometry.h.

932 {
934 std::iota(allFaces.begin(), allFaces.end(), 0);
935
937 }
static std::tuple< Scalars, Scalars, RealVectors, RealVectors > getCNCPrincipalCurvaturesAndDirections(CountedPtr< typename Base::SurfaceMesh > mesh, const typename Base::SurfaceMesh::Faces &faces, const Parameters &params=parametersShapeGeometry())

◆ getCNCPrincipalCurvaturesAndDirections() [2/3]

template<typename TKSpace>
std::tuple< Scalars, Scalars, RealVectors, RealVectors > DGtal::ShortcutsGeometry< TKSpace >::getCNCPrincipalCurvaturesAndDirections ( CountedPtr< typename Base::SurfaceMesh > mesh,
const typename Base::SurfaceMesh::Faces & faces,
const Parameters & params = parametersShapeGeometry() )
inlinestatic

Given a SurfaceMesh, compute principal curvature at each face using CorrectedNormalCurrent method.

Note
If no normals are provided for the faces, the normals will be computed (and set) using vertex normals if they exist and positions otherwise.
Warning
In this code, only triangles with barycenters strictly inside the sphere are considered.
Parameters
[in,out]meshThe surface mesh. The mesh will be modified if no face normals are provided.
[in]facesThe faces to compute curvature at
[in]params
  • unit_u: Whether the computed normals should be normalized or not
  • 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, CNC)."
  • gridstep [ 1.0]: the digitization gridstep (often denoted by h).
Returns
The principal curvatures for each face of the mesh, in the same order as faces. The result is a 4-element tuples: [first curvatures, second curvatures, first directions, second directions].

Definition at line 861 of file ShortcutsGeometry.h.

865 {
866 bool unit_u = params["unit_u"].as<int>();
867 double radius = params["r-radius"].as<double>();
868 double alpha = params["alpha"].as<double>();
869 double h = params["gridstep"].as<double>();
870 if ( alpha != 1.0 ) radius *= pow( h, alpha-1.0 );
871
873
874 const auto& mu0 = computer.computeMu0();
875 const auto& muxy = computer.computeMuXY();
876
877 if (mesh->faceNormals().size() == 0)
878 {
879 // Try to use vertex normals if any
880 if (mesh->vertexNormals().size() == 0)
881 mesh->computeFaceNormalsFromPositions();
882 else
883 mesh->computeFaceNormalsFromVertexNormals();
884 }
885
886 const auto& normals = mesh->faceNormals();
887
888 Scalars k1(faces.size()), k2(faces.size());
889 RealVectors d1(faces.size()), d2(faces.size());
890
891 for (size_t i = 0; i < faces.size(); ++i)
892 {
893 const auto center = mesh->faceCentroid(faces[i]);
894 const auto area = mu0 .measure(center, radius, faces[i]);
895 const auto lmuxy = muxy.measure(center, radius, faces[i]);
896 std::tie(k1[i], k2[i], d1[i], d2[i]) =
898 }
899
900 return std::make_tuple(k1, k2, d1, d2);
901 }
std::vector< RealVector > RealVectors
static std::tuple< Scalar, Scalar, RealVector, RealVector > principalCurvatures(Scalar mu0, RealTensor muXY, const RealVector &N)

◆ getCNCPrincipalCurvaturesAndDirections() [3/3]

template<typename TKSpace>
template<typename T>
std::tuple< Scalars, Scalars, RealVectors, RealVectors > DGtal::ShortcutsGeometry< TKSpace >::getCNCPrincipalCurvaturesAndDirections ( T & digitalObject,
const Parameters & params = parametersShapeGeometry() )
inlinestatic

Given a SurfaceMesh, compute principal curvature at each face using CorrectedNormalCurrent method.

Warning
In this code, only triangles with barycenters strictly inside the sphere are considered.
Template Parameters
TAny digital object convertible to surface mesh via Shortcuts::makePrimalSurfaceMesh
Parameters
digitalObjectA digital object
params
  • unit_u: Whether the computed normals should be normalized or not
  • 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, CNC)."
  • gridstep [ 1.0]: the digitization gridstep (often denoted by h).
Returns
The curvatures for each face of the triangulated surface object

Definition at line 960 of file ShortcutsGeometry.h.

◆ getCTrivialNormalVectors()

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

1051 {
1052 int verbose = params[ "verbose" ].as<int>();
1053 Scalar t = params[ "t-ring" ].as<double>();
1055 typedef LpMetric<Space> Metric;
1061 if ( verbose > 0 )
1062 trace.info() << "- CTrivial normal t-ring=" << t << " (discrete)" << std::endl;
1063 const Functor fct( 1.0, t );
1064 const KSpace & K = surface->container().space();
1065 Metric aMetric( 2.0 );
1070 estimator.attach( *surface);
1071 estimator.setParams( aMetric, surfelFct, fct, t );
1072 estimator.init( 1.0, surfels.begin(), surfels.end());
1073 estimator.eval( surfels.begin(), surfels.end(),
1075 std::transform( n_estimations.cbegin(), n_estimations.cend(), n_estimations.begin(),
1076 [] ( RealVector v ) { return -v; } );
1077 return n_estimations;
1078 }
TKSpace KSpace
Digital cellular space.
Space::RealVector RealVector
Vector with floating-point coordinates.
LightDigitalSurface::Surfel Surfel

◆ getDirectionToClosestSite()

template<typename TKSpace>
template<uint32_t p, typename PointRangeSites, typename PointRange>
std::vector< Vector > DGtal::ShortcutsGeometry< TKSpace >::getDirectionToClosestSite ( const PointRange & points,
const PointRangeSites & sites,
const Parameters & params = parametersVoronoiMap() )
inlinestatic

Computes the vector to the closest site from a range of points.

Template Parameters
pThe exponent in the Lp metric
PointRangeThe range of point
PointRangeSitesThe range of sites
Parameters
pointsThe one to compute the closest site of
sitesThe list of sites
paramsParameters
Returns
A vector of direction to the closest in the same order as 'points'.

Definition at line 2278 of file ShortcutsGeometry.h.

2282 {
2285
2286 // Compute domain of points
2287 Point pmin = *points.begin();
2288 Point pmax = pmin;
2289
2290 size_t pCount = 0;
2291 for (auto it = points.begin(); it != points.end(); ++it)
2292 {
2293 pCount ++;
2294 for (size_t i = 0; i < Space::dimension; ++i)
2295 {
2296 pmin[i] = std::min(pmin[i], (*it)[i] - 1);
2297 pmax[i] = std::max(pmax[i], (*it)[i] + 1);
2298 }
2299 }
2300
2301 for (auto it = sites.begin(); it != sites.end(); ++it)
2302 {
2303 for (size_t i = 0; i < Space::dimension; ++i)
2304 {
2305 pmin[i] = std::min(pmin[i], (*it)[i] - 1);
2306 pmax[i] = std::max(pmax[i], (*it)[i] + 1);
2307 }
2308 }
2309
2311
2312 DigitalSet set(domain); set.insert(sites.begin(), sites.end());
2314 Metric metric;
2315
2316
2317 typename VoroMap::PeriodicitySpec specs = {false, false, false};
2318 if (params["toroidal-x"].as<int>()) specs[0] = true;
2319 if (params["toroidal-y"].as<int>()) specs[1] = true;
2320 if (params["toroidal-z"].as<int>()) specs[2] = true;
2321
2323
2325 size_t i = 0;
2326 for (auto it = points.begin(); it != points.end(); ++it)
2327 {
2328 directions[i++] = map(*it);
2329 }
2330 return directions;
2331 }
Space::Point Point
Point with integer coordinates.
DigitalSetByAssociativeContainer< Domain, std::unordered_set< typename Domain::Point > > DigitalSet
functors::NotPointPredicate< DigitalSet > VoronoiPointPredicate
HyperRectDomain< Space > Domain
An (hyper-)rectangular domain.

◆ getDistanceToClosestSite()

template<typename TKSpace>
template<uint32_t p, typename PointRangeSites, typename PointRange>
std::vector< typename ExactPredicateLpSeparableMetric< Space, p >::Value > DGtal::ShortcutsGeometry< TKSpace >::getDistanceToClosestSite ( const PointRange & points,
const PointRangeSites & sites,
const Parameters & params = parametersVoronoiMap() )
inlinestatic

Computes the distances to the closest site from a range of points.

Template Parameters
pThe exponent in the Lp metric
PointRangeThe range of point
PointRangeSitesThe range of sites
Parameters
pointsThe one to compute the closest site of
sitesThe list of sites
paramsParameters
Returns
A vector of distances to the closest in the same order as 'points'.

Definition at line 2348 of file ShortcutsGeometry.h.

2352 {
2355
2356 // Compute domain of points
2357 Point pmin = *points.begin();
2358 Point pmax = pmin;
2359
2360 size_t pCount = 0;
2361 for (auto it = points.begin(); it != points.end(); ++it)
2362 {
2363 pCount ++;
2364 for (size_t i = 0; i < Space::dimension; ++i)
2365 {
2366 pmin[i] = std::min(pmin[i], (*it)[i] - 1);
2367 pmax[i] = std::max(pmax[i], (*it)[i] + 1);
2368 }
2369 }
2370
2371 for (auto it = sites.begin(); it != sites.end(); ++it)
2372 {
2373 for (size_t i = 0; i < Space::dimension; ++i)
2374 {
2375 pmin[i] = std::min(pmin[i], (*it)[i] - 1);
2376 pmax[i] = std::max(pmax[i], (*it)[i] + 1);
2377 }
2378 }
2379
2381
2382 DigitalSet set(domain); set.insert(sites.begin(), sites.end());
2384 Metric metric;
2385
2386 typename DTMap::PeriodicitySpec specs = {false, false, false};
2387 if (params["toroidal-x"].as<int>()) specs[0] = true;
2388 if (params["toroidal-y"].as<int>()) specs[1] = true;
2389 if (params["toroidal-z"].as<int>()) specs[2] = true;
2390
2391 auto map = DTMap(domain, predicate, metric, specs);
2392
2394 size_t i = 0;
2395 for (auto it = points.begin(); it != points.end(); ++it)
2396 {
2397 directions[i++] = map(*it);
2398 }
2399 return directions;
2400 }

◆ getDistanceTransformation()

template<typename TKSpace>
template<uint32_t p, typename PointRange>
DistanceTransformation< Space, VoronoiPointPredicate, ExactPredicateLpSeparableMetric< Space, p > > DGtal::ShortcutsGeometry< TKSpace >::getDistanceTransformation ( Domain domain,
const PointRange & sites,
const Parameters & params = parametersVoronoiMap() )
inlinestatic

Computes the Distance Transformation on a domain, where sites are given through a range.

Note
This overload returns a distance transformation, ie. where operator() returns the distance to the closest site for the considered Lp metric.
Template Parameters
pThe exponent in the Lp metric
PointRangeAn iterable of points (std::vector, DGtal::DigitalSet*, ...)
Parameters
domainThe associated domain on which the VoronoiMap is computed
sitesThe list of sites
paramsthe parameters
Returns
The DistanceTransformation within a domain with prescribed sites

Definition at line 2241 of file ShortcutsGeometry.h.

2244 {
2247 DigitalSet set(domain); set.insert(sites.begin(), sites.end());
2249 Metric metric;
2250
2251 typename DTMap::PeriodicitySpec specs = {false, false, false};
2252 if (params["toroidal-x"].as<int>()) specs[0] = true;
2253 if (params["toroidal-y"].as<int>()) specs[1] = true;
2254 if (params["toroidal-z"].as<int>()) specs[2] = true;
2255
2256 // Do not return a pointer here for two reasons:
2257 // - The distance transform will not be passed anywhere else
2258 // - The operator() is less accessible with pointers.
2259 return DTMap(domain, predicate, metric, specs);
2260 }

◆ getFirstPrincipalCurvatures()

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

651 {
654 int maxIter = params[ "projectionMaxIter" ].as<int>();
655 double accuracy = params[ "projectionAccuracy" ].as<double>();
656 double gamma = params[ "projectionGamma" ].as<double>();
657 Scalar gridstep = params[ "gridstep" ].as<Scalar>();
658 true_estimator.attach( *shape );
661 true_estimator.init( gridstep, surfels.begin(), surfels.end() );
662 true_estimator.eval( surfels.begin(), surfels.end(),
664 return n_true_estimations;
665 }
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, FirstPrincipalCurvatureFunctor > TrueFirstPrincipalCurvatureEstimator
sgf::ShapeFirstPrincipalCurvatureFunctor< ImplicitShape3D > FirstPrincipalCurvatureFunctor

◆ getFirstPrincipalDirections()

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

735 {
738 int maxIter = params[ "projectionMaxIter" ].as<int>();
739 double accuracy = params[ "projectionAccuracy" ].as<double>();
740 double gamma = params[ "projectionGamma" ].as<double>();
741 Scalar gridstep = params[ "gridstep" ].as<Scalar>();
742 true_estimator.attach( *shape );
745 true_estimator.init( gridstep, surfels.begin(), surfels.end() );
746 true_estimator.eval( surfels.begin(), surfels.end(),
748 return n_true_estimations;
749 }
sgf::ShapeFirstPrincipalDirectionFunctor< ImplicitShape3D > FirstPrincipalDirectionFunctor
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, FirstPrincipalDirectionFunctor > TrueFirstPrincipalDirectionEstimator

◆ getGaussianCurvatures()

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

511 {
514 int maxIter = params[ "projectionMaxIter" ].as<int>();
515 double accuracy = params[ "projectionAccuracy" ].as<double>();
516 double gamma = params[ "projectionGamma" ].as<double>();
517 Scalar gridstep = params[ "gridstep" ].as<Scalar>();
518 true_estimator.attach( *shape );
520 true_estimator.init( gridstep, surfels.begin(), surfels.end() );
521 true_estimator.eval( surfels.begin(), surfels.end(),
523 return n_true_estimations;
524 }
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, GaussianCurvatureFunctor > TrueGaussianCurvatureEstimator
sgf::ShapeGaussianCurvatureFunctor< ImplicitShape3D > GaussianCurvatureFunctor

◆ getIICurvatureEstimation()

template<typename TKSpace>
template<typename TEstimator, typename TFunctor, typename TPointPredicate>
std::vector< typename TEstimator::Quantity > DGtal::ShortcutsGeometry< TKSpace >::getIICurvatureEstimation ( const char * description,
const TPointPredicate & shape,
const KSpace & K,
const SurfelRange & surfels,
const Parameters & params )
inlinestaticprivate

Definition at line 2531 of file ShortcutsGeometry.h.

2536 {
2539 int verbose = params[ "verbose" ].as<int>();
2540 int ii_thread_number = params[ "ii-thread-number" ].as<int>();
2542 Scalar h = params[ "gridstep" ].as<Scalar>();
2543 Scalar r = params[ "r-radius" ].as<Scalar>();
2544 Scalar alpha = params[ "alpha" ].as<Scalar>();
2545 if ( alpha != 1.0 ) r *= pow( h, alpha-1.0 );
2546 if ( verbose > 0 )
2547 {
2548 trace.info() << "- II " << description << " alpha=" << alpha << std::endl;
2549 trace.info() << "- II " << description << " r=" << (r*h) << " (continuous) "
2550 << r << " (discrete)" << std::endl;
2551 }
2553 functor.init( h, r*h );
2554#ifdef DGTAL_WITH_OPENMP
2555 if ( ii_thread_number != 1 )
2556 {
2557 if ( verbose > 0 )
2558 trace.info() << "- II " << description
2559 << " uses ParallelIIEstimator with thread request="
2560 << ii_thread_number << " and split axis="
2566 ii_estimator.attach( K, shape );
2567 ii_estimator.setParams( r );
2568 ii_estimator.init( h, surfels.begin(), surfels.end() );
2569 ii_estimator.eval( surfels.begin(), surfels.end(),
2571 return estimations;
2572 }
2573#else
2574 if ( ( ii_thread_number != 1 ) && ( verbose > 0 ) )
2575 trace.warning() << "- II " << description
2576 << " requested parallel execution but DGtal was built without OpenMP; "
2577 << "falling back to the sequential estimator."
2578 << std::endl;
2579#endif
2581 ii_estimator.attach( K, shape );
2582 ii_estimator.setParams( r );
2583 ii_estimator.init( h, surfels.begin(), surfels.end() );
2584 ii_estimator.eval( surfels.begin(), surfels.end(),
2586 return estimations;
2587 }
static Domain::Dimension getIIParallelSplitAxis(const Parameters &params)

◆ getIIGaussianCurvatures() [1/3]

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

1589 {
1594 ( "Gaussian curvature", shape, K, surfels, params );
1595 }
static std::vector< typename TEstimator::Quantity > getIICurvatureEstimation(const char *description, const TPointPredicate &shape, const KSpace &K, const SurfelRange &surfels, const Parameters &params)

◆ getIIGaussianCurvatures() [2/3]

template<typename TKSpace>
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)."
  • ii-thread-number[ 1]: number of threads for II curvature estimators; 1 keeps the sequential estimator, any other value requests the parallel estimator when OpenMP support is available.
  • ii-split-axis [ 0]: main axis used by AxisDomainSplitter for parallel II estimators.
  • 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 1506 of file ShortcutsGeometry.h.

1511 {
1512 auto K = getKSpace( bimage, params );
1514 }
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:329

◆ getIIGaussianCurvatures() [3/3]

template<typename TKSpace>
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)."
  • ii-thread-number[ 1]: number of threads for II curvature estimators; 1 keeps the sequential estimator, any other value requests the parallel estimator when OpenMP support is available.
  • ii-split-axis [ 0]: main axis used by AxisDomainSplitter for parallel II estimators.
  • 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 1548 of file ShortcutsGeometry.h.

1554 {
1555 auto K = getKSpace( params );
1557 }

◆ getIIMeanCurvatures() [1/3]

template<typename TKSpace>
template<typename TPointPredicate>
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)."
  • ii-thread-number[ 1]: number of threads for II curvature estimators; 1 keeps the sequential estimator, any other value requests the parallel estimator when OpenMP support is available.
  • ii-split-axis [ 0]: main axis used by AxisDomainSplitter for parallel II estimators.
  • 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 1467 of file ShortcutsGeometry.h.

◆ getIIMeanCurvatures() [2/3]

template<typename TKSpace>
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)."
  • ii-thread-number[ 1]: number of threads for II curvature estimators; 1 keeps the sequential estimator, any other value requests the parallel estimator when OpenMP support is available.
  • ii-split-axis [ 0]: main axis used by AxisDomainSplitter for parallel II estimators.
  • 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 1384 of file ShortcutsGeometry.h.

1389 {
1390 auto K = getKSpace( bimage, params );
1392 }
static Scalars getIIMeanCurvatures(CountedPtr< BinaryImage > bimage, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace())

◆ getIIMeanCurvatures() [3/3]

template<typename TKSpace>
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)."
  • ii-thread-number[ 1]: number of threads for II curvature estimators; 1 keeps the sequential estimator, any other value requests the parallel estimator when OpenMP support is available.
  • ii-split-axis [ 0]: main axis used by AxisDomainSplitter for parallel II estimators.
  • 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 1426 of file ShortcutsGeometry.h.

1432 {
1433 auto K = getKSpace( params );
1435 }

◆ getIINormalVectors() [1/3]

template<typename TKSpace>
template<typename TPointPredicate>
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)."
  • ii-thread-number[ 1]: number of threads for II estimators; 1 keeps the sequential estimator, any other value requests the parallel estimator when OpenMP support is available.
  • ii-split-axis [ 0]: main axis used by AxisDomainSplitter for parallel II estimators.
  • 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 1292 of file ShortcutsGeometry.h.

1298 {
1302
1304 int verbose = params[ "verbose" ].as<int>();
1305 int ii_thread_number = params[ "ii-thread-number" ].as<int>();
1307 Scalar h = params[ "gridstep" ].as<Scalar>();
1308 Scalar r = params[ "r-radius" ].as<Scalar>();
1309 Scalar alpha = params[ "alpha" ].as<Scalar>();
1310 if ( alpha != 1.0 ) r *= pow( h, alpha-1.0 );
1311 if ( verbose > 0 )
1312 {
1313 trace.info() << "- II normal alpha=" << alpha << std::endl;
1314 trace.info() << "- II normal r=" << (r*h) << " (continuous) "
1315 << r << " (discrete)" << std::endl;
1316 }
1318 functor.init( h, r*h );
1319 bool use_parallel = false;
1320#ifdef DGTAL_WITH_OPENMP
1321 if ( ii_thread_number != 1 )
1322 {
1323 use_parallel = true;
1324 if ( verbose > 0 )
1325 trace.info() << "- II normal uses ParallelIIEstimator with thread request="
1326 << ii_thread_number << " and split axis="
1332 ii_estimator.attach( K, shape );
1333 ii_estimator.setParams( r );
1334 ii_estimator.init( h, surfels.begin(), surfels.end() );
1335 ii_estimator.eval( surfels.begin(), surfels.end(),
1337 }
1338#else
1339 if ( ( ii_thread_number != 1 ) && ( verbose > 0 ) )
1340 trace.warning() << "- II normal requested parallel execution but DGtal was built without OpenMP; "
1341 << "falling back to the sequential estimator."
1342 << std::endl;
1343#endif
1344 if ( ! use_parallel )
1345 {
1347 ii_estimator.attach( K, shape );
1348 ii_estimator.setParams( r );
1349 ii_estimator.init( h, surfels.begin(), surfels.end() );
1350 ii_estimator.eval( surfels.begin(), surfels.end(),
1352 }
1355 return n_estimations;
1356 }
static RealVectors getTrivialNormalVectors(const KSpace &K, const SurfelRange &surfels)
static void orientVectors(RealVectors &v, const RealVectors &ref_v)

◆ getIINormalVectors() [2/3]

template<typename TKSpace>
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)."
  • ii-thread-number[ 1]: number of threads for II estimators; 1 keeps the sequential estimator, any other value requests the parallel estimator when OpenMP support is available.
  • ii-split-axis [ 0]: main axis used by AxisDomainSplitter for parallel II estimators.
  • 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 1203 of file ShortcutsGeometry.h.

1208 {
1209 auto K = getKSpace( bimage, params );
1211 }
static RealVectors getIINormalVectors(CountedPtr< BinaryImage > bimage, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace())

◆ getIINormalVectors() [3/3]

template<typename TKSpace>
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)."
  • ii-thread-number[ 1]: number of threads for II estimators; 1 keeps the sequential estimator, any other value requests the parallel estimator when OpenMP support is available.
  • ii-split-axis [ 0]: main axis used by AxisDomainSplitter for parallel II estimators.
  • 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 1249 of file ShortcutsGeometry.h.

1255 {
1256 auto K = getKSpace( params );
1258 }

◆ getIIParallelSplitAxis()

template<typename TKSpace>
Domain::Dimension DGtal::ShortcutsGeometry< TKSpace >::getIIParallelSplitAxis ( const Parameters & params)
inlinestaticprivate

Definition at line 2596 of file ShortcutsGeometry.h.

2597 {
2598 const auto requested_axis = params[ "ii-split-axis" ].as<int>();
2599 if ( requested_axis <= 0 ) return 0;
2600 if ( requested_axis >= static_cast<int>( Domain::dimension ) )
2601 return static_cast<typename Domain::Dimension>( Domain::dimension - 1 );
2602 return static_cast<typename Domain::Dimension>( requested_axis );
2603 }

◆ getIIPrincipalCurvaturesAndDirections() [1/3]

template<typename TKSpace>
template<typename TPointPredicate>
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)."
  • ii-thread-number[ 1]: number of threads for II curvature estimators; 1 keeps the sequential estimator, any other value requests the parallel estimator when OpenMP support is available.
  • ii-split-axis [ 0]: main axis used by AxisDomainSplitter for parallel II estimators.
  • 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 1707 of file ShortcutsGeometry.h.

◆ getIIPrincipalCurvaturesAndDirections() [2/3]

template<typename TKSpace>
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)."
  • ii-thread-number[ 1]: number of threads for II curvature estimators; 1 keeps the sequential estimator, any other value requests the parallel estimator when OpenMP support is available.
  • ii-split-axis [ 0]: main axis used by AxisDomainSplitter for parallel II estimators.
  • 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 1623 of file ShortcutsGeometry.h.

1628 {
1629 auto K = getKSpace( bimage, params );
1631 }
static CurvatureTensorQuantities getIIPrincipalCurvaturesAndDirections(CountedPtr< BinaryImage > bimage, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace())

◆ getIIPrincipalCurvaturesAndDirections() [3/3]

template<typename TKSpace>
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)."
  • ii-thread-number[ 1]: number of threads for II curvature estimators; 1 keeps the sequential estimator, any other value requests the parallel estimator when OpenMP support is available.
  • ii-split-axis [ 0]: main axis used by AxisDomainSplitter for parallel II estimators.
  • 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 1666 of file ShortcutsGeometry.h.

1672 {
1673 auto K = getKSpace( params );
1675 }

◆ getKSpace() [1/6]

template<typename TKSpace>
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 329 of file Shortcuts.h.

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

◆ getKSpace() [2/6]

template<typename TKSpace>
template<typename TDigitalSurfaceContainer>
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 393 of file Shortcuts.h.

395 {
396 return surface->container().space();
397 }

◆ getKSpace() [3/6]

template<typename TKSpace>
template<typename TDigitalSurfaceContainer>
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 404 of file Shortcuts.h.

406 {
407 return surface->container().space();
408 }

◆ getKSpace() [4/6]

template<typename TKSpace>
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 351 of file Shortcuts.h.

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

◆ getKSpace() [5/6]

template<typename TKSpace>
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 375 of file Shortcuts.h.

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

◆ getKSpace() [6/6]

template<typename TKSpace>
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 483 of file Shortcuts.h.

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

◆ getMeanCurvatures()

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

373 {
376 int maxIter = params[ "projectionMaxIter" ].as<int>();
377 double accuracy = params[ "projectionAccuracy" ].as<double>();
378 double gamma = params[ "projectionGamma" ].as<double>();
379 Scalar gridstep = params[ "gridstep" ].as<Scalar>();
380 true_estimator.attach( *shape );
382 true_estimator.init( gridstep, surfels.begin(), surfels.end() );
383 true_estimator.eval( surfels.begin(), surfels.end(),
385 return n_true_estimations;
386 }
sgf::ShapeMeanCurvatureFunctor< ImplicitShape3D > MeanCurvatureFunctor
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, MeanCurvatureFunctor > TrueMeanCurvatureEstimator

◆ getNormalVectors()

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

334 {
337 int maxIter = params[ "projectionMaxIter" ].as<int>();
338 double accuracy = params[ "projectionAccuracy" ].as<double>();
339 double gamma = params[ "projectionGamma" ].as<double>();
340 Scalar gridstep = params[ "gridstep" ].as<Scalar>();
341 true_estimator.attach( *shape );
343 true_estimator.init( gridstep, surfels.begin(), surfels.end() );
344 true_estimator.eval( surfels.begin(), surfels.end(),
346 return n_true_estimations;
347 }
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, NormalFunctor > TrueNormalEstimator
sgf::ShapeNormalVectorFunctor< ImplicitShape3D > NormalFunctor

◆ getPositions() [1/2]

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

266 {
269 int maxIter = params[ "projectionMaxIter" ].as<int>();
270 double accuracy = params[ "projectionAccuracy" ].as<double>();
271 double gamma = params[ "projectionGamma" ].as<double>();
272 Scalar gridstep = params[ "gridstep" ].as<Scalar>();
273 true_estimator.attach( *shape );
275 true_estimator.init( gridstep, surfels.begin(), surfels.end() );
276 true_estimator.eval( surfels.begin(), surfels.end(),
278 return n_true_estimations;
279 }
sgf::ShapePositionFunctor< ImplicitShape3D > PositionFunctor
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, PositionFunctor > TruePositionEstimator

◆ getPositions() [2/2]

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

299 {
300 RealPoints proj_points( points.size() );
301 int maxIter = params[ "projectionMaxIter" ].as<int>();
302 double accuracy = params[ "projectionAccuracy" ].as<double>();
303 double gamma = params[ "projectionGamma" ].as<double>();
304 for ( unsigned int i = 0; i < points.size(); ++i )
305 proj_points[ i ] = shape->nearestPoint( points[ i ], accuracy,
306 maxIter, gamma );
307 return proj_points;
308 }
std::vector< RealPoint > RealPoints

◆ getPrincipalCurvaturesAndDirections()

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

820 {
823 int maxIter = params[ "projectionMaxIter" ].as<int>();
824 double accuracy = params[ "projectionAccuracy" ].as<double>();
825 double gamma = params[ "projectionGamma" ].as<double>();
826 Scalar gridstep = params[ "gridstep" ].as<Scalar>();
827 true_estimator.attach( *shape );
830 true_estimator.init( gridstep, surfels.begin(), surfels.end() );
831 true_estimator.eval( surfels.begin(), surfels.end(),
833 return n_true_estimations;
834 }
std::vector< CurvatureTensorQuantity > CurvatureTensorQuantities
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, PrincipalCurvaturesAndDirectionsFunctor > TruePrincipalCurvaturesAndDirectionsEstimator
sgf::ShapePrincipalCurvaturesAndDirectionsFunctor< ImplicitShape3D > PrincipalCurvaturesAndDirectionsFunctor

◆ getRawDistanceToClosestSite()

template<typename TKSpace>
template<uint32_t p, typename PointRangeSites, typename PointRange>
std::vector< typename ExactPredicateLpSeparableMetric< Space, p >::Value > DGtal::ShortcutsGeometry< TKSpace >::getRawDistanceToClosestSite ( const PointRange & points,
const PointRangeSites & sites,
const Parameters & params = parametersVoronoiMap() )
inlinestatic

Computes the raw distances to the closest site from a range of points.

 Raw distance means that we are computing an exact representation of the distance  (e.g. dropping the 1/p exponent for Lp metric).

Template Parameters
pThe exponent in the Lp metric
PointRangeThe range of point
PointRangeSitesThe range of sites
Parameters
pointsThe one to compute the closest site of
sitesThe list of sites
paramsParameters
Returns
A vector of raw distances (eg. squared values for L2 metric) to the closest in the same order as 'points'.

Definition at line 2420 of file ShortcutsGeometry.h.

2424 {
2427
2428 // Compute domain of points
2429 Point pmin = *points.begin();
2430 Point pmax = pmin;
2431
2432 size_t pCount = 0;
2433 for (auto it = points.begin(); it != points.end(); ++it)
2434 {
2435 pCount ++;
2436 for (size_t i = 0; i < Space::dimension; ++i)
2437 {
2438 pmin[i] = std::min(pmin[i], (*it)[i] - 1);
2439 pmax[i] = std::max(pmax[i], (*it)[i] + 1);
2440 }
2441 }
2442
2443 for (auto it = sites.begin(); it != sites.end(); ++it)
2444 {
2445 for (size_t i = 0; i < Space::dimension; ++i)
2446 {
2447 pmin[i] = std::min(pmin[i], (*it)[i] - 1);
2448 pmax[i] = std::max(pmax[i], (*it)[i] + 1);
2449 }
2450 }
2451
2453
2454 DigitalSet set(domain); set.insert(sites.begin(), sites.end());
2456 Metric metric;
2457
2458 typename DTMap::PeriodicitySpec specs = {false, false, false};
2459 if (params["toroidal-x"].as<int>()) specs[0] = true;
2460 if (params["toroidal-y"].as<int>()) specs[1] = true;
2461 if (params["toroidal-z"].as<int>()) specs[2] = true;
2462
2463 auto map = DTMap(domain, predicate, metric, specs);
2464
2466 size_t i = 0;
2467 for (auto it = points.begin(); it != points.end(); ++it)
2468 {
2469 directions[i++] = map(*it);
2470 }
2471 return directions;
2472 }

◆ getScalarsAbsoluteDifference()

template<typename TKSpace>
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 elements |v1[i]-v2[i]|.

Definition at line 2071 of file ShortcutsGeometry.h.

2073 {
2074 Scalars result( v1.size() );
2075 std::transform( v2.cbegin(), v2.cend(), v1.cbegin(), result.begin(),
2076 [] ( Scalar val1, Scalar val2 )
2077 { return fabs( val1 - val2 ); } );
2078 return result;
2079 }

◆ getScalarsNormL1()

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

2106 {
2107 Scalar sum = 0;
2108 for ( unsigned int i = 0; i < v1.size(); i++ )
2109 sum += fabs( v1[ i ] - v2[ i ] );
2110 return sum / v1.size();
2111 }

◆ getScalarsNormL2()

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

2090 {
2091 Scalar sum = 0;
2092 for ( unsigned int i = 0; i < v1.size(); i++ )
2093 sum += ( v1[ i ] - v2[ i ] ) * ( v1[ i ] - v2[ i ] );
2094 return sqrt( sum / v1.size() );
2095 }

◆ getScalarsNormLoo()

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

2122 {
2123 Scalar loo = 0;
2124 for ( unsigned int i = 0; i < v1.size(); i++ )
2125 loo = std::max( loo, fabs( v1[ i ] - v2[ i ] ) );
2126 return loo;
2127 }

◆ getSecondPrincipalCurvatures()

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

693 {
696 int maxIter = params[ "projectionMaxIter" ].as<int>();
697 double accuracy = params[ "projectionAccuracy" ].as<double>();
698 double gamma = params[ "projectionGamma" ].as<double>();
699 Scalar gridstep = params[ "gridstep" ].as<Scalar>();
700 true_estimator.attach( *shape );
703 true_estimator.init( gridstep, surfels.begin(), surfels.end() );
704 true_estimator.eval( surfels.begin(), surfels.end(),
706 return n_true_estimations;
707 }
sgf::ShapeSecondPrincipalCurvatureFunctor< ImplicitShape3D > SecondPrincipalCurvatureFunctor
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, SecondPrincipalCurvatureFunctor > TrueSecondPrincipalCurvatureEstimator

◆ getSecondPrincipalDirections()

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

777 {
780 int maxIter = params[ "projectionMaxIter" ].as<int>();
781 double accuracy = params[ "projectionAccuracy" ].as<double>();
782 double gamma = params[ "projectionGamma" ].as<double>();
783 Scalar gridstep = params[ "gridstep" ].as<Scalar>();
784 true_estimator.attach( *shape );
787 true_estimator.init( gridstep, surfels.begin(), surfels.end() );
788 true_estimator.eval( surfels.begin(), surfels.end(),
790 return n_true_estimations;
791 }
sgf::ShapeSecondPrincipalDirectionFunctor< ImplicitShape3D > SecondPrincipalDirectionFunctor
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, SecondPrincipalDirectionFunctor > TrueSecondPrincipalDirectionEstimator

◆ getStatistic()

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

2029 {
2031 stat.addValues( v.begin(), v.end() );
2032 stat.terminate();
2033 return stat;
2034 }
::DGtal::Statistic< Scalar > ScalarStatistic

◆ getTrivialNormalVectors()

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

1017 {
1019 for ( auto s : surfels )
1020 {
1021 Dimension k = K.sOrthDir( s );
1022 bool direct = K.sDirect( s, k );
1024 t[ k ] = direct ? -1.0 : 1.0;
1025 result.push_back( t );
1026 }
1027 return result;
1028 }

◆ getVCMNormalVectors()

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

1107 {
1111 int verbose = params[ "verbose" ].as<int>();
1112 std::string kernel = params[ "kernel" ].as<std::string>();
1113 Scalar h = params[ "gridstep" ].as<Scalar>();
1114 Scalar R = params[ "R-radius" ].as<Scalar>();
1115 Scalar r = params[ "r-radius" ].as<Scalar>();
1116 Scalar t = params[ "t-ring" ].as<Scalar>();
1117 Scalar alpha = params[ "alpha" ].as<Scalar>();
1118 int embedding = params[ "embedding" ].as<int>();
1119 // Adjust parameters according to gridstep if specified.
1120 if ( alpha != 1.0 ) R *= pow( h, alpha-1.0 );
1121 if ( alpha != 1.0 ) r *= pow( h, alpha-1.0 );
1123 embedding == 1 ? InnerSpel : OuterSpel;
1124 if ( verbose > 0 )
1125 {
1126 trace.info() << "- VCM normal kernel=" << kernel << " emb=" << embedding
1127 << " alpha=" << alpha << std::endl;
1128 trace.info() << "- VCM normal r=" << (r*h) << " (continuous) "
1129 << r << " (discrete)" << std::endl;
1130 trace.info() << "- VCM normal R=" << (R*h) << " (continuous) "
1131 << R << " (discrete)" << std::endl;
1132 trace.info() << "- VCM normal t=" << t << " (discrete)" << std::endl;
1133 }
1134 if ( kernel == "hat" )
1135 {
1142 KernelFunction chi_r( 1.0, r );
1144 estimator.attach( *surface );
1145 estimator.setParams( embType, R, r, chi_r, t, Metric(), verbose > 0 );
1146 estimator.init( h, surfels.begin(), surfels.end() );
1147 estimator.eval( surfels.begin(), surfels.end(),
1149 }
1150 else if ( kernel == "ball" )
1151 {
1158 KernelFunction chi_r( 1.0, r );
1160 estimator.attach( *surface );
1161 estimator.setParams( embType, R, r, chi_r, t, Metric(), verbose > 0 );
1162 estimator.init( h, surfels.begin(), surfels.end() );
1163 estimator.eval( surfels.begin(), surfels.end(),
1165 }
1166 else
1167 {
1168 trace.warning() << "[ShortcutsGeometry::getVCMNormalVectors] Unknown kernel: "
1169 << kernel << std::endl;
1170 }
1171 return n_estimations;
1172 }

◆ getVectorsAngleDeviation()

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

2045 {
2046 Scalars v( v1.size() );
2047 if ( v1.size() == v2.size() )
2048 {
2049 auto outIt = v.begin();
2050 for ( auto it1 = v1.cbegin(), it2 = v2.cbegin(), itE1 = v1.cend();
2051 it1 != itE1; ++it1, ++it2 )
2052 {
2053 Scalar angle_error = acos( (*it1).dot( *it2 ) );
2054 *outIt++ = angle_error;
2055 }
2056 }
2057 else
2058 {
2059 trace.warning() << "[ShortcutsGeometry::getVectorsAngleDeviation]"
2060 << " v1.size()=" << v1.size() << " should be equal to "
2061 << " v2.size()=" << v2.size() << std::endl;
2062 }
2063 return v;
2064 }

◆ getVoronoiMap() [1/2]

template<typename TKSpace>
template<uint32_t p, typename PointRange>
VoronoiMap< Space, VoronoiPointPredicate, ExactPredicateLpSeparableMetric< Space, p > > DGtal::ShortcutsGeometry< TKSpace >::getVoronoiMap ( CountedPtr< Domain > domain,
const PointRange & sites,
const Parameters & params = parametersVoronoiMap() )
inlinestatic

Computes the VoronoiMap on a domain, where sites are given through a range.

Template Parameters
pThe exponent in the Lp metric
PointRangeAn iterable of points (std::vector, DGtal::DigitalSet*, ...)
Parameters
domainThe associated domain on which the VoronoiMap is computed
sitesThe list of sites
paramsthe parameters
Returns
The VoronoiMap within a domain with prescribed sites

Definition at line 2202 of file ShortcutsGeometry.h.

2205 {
2208 DigitalSet set(*domain); set.insert(sites.begin(), sites.end());
2210 Metric metric;
2211
2212 typename VoroMap::PeriodicitySpec specs = {false, false, false};
2213 if (params["toroidal-x"].as<int>()) specs[0] = true;
2214 if (params["toroidal-y"].as<int>()) specs[1] = true;
2215 if (params["toroidal-z"].as<int>()) specs[2] = true;
2216
2217 // Do not return a pointer here for two reasons:
2218 // - The distance transform will not be passed anywhere else
2219 // - The operator() is less accessible with pointers.
2220 return VoroMap(*domain, predicate, metric, specs);
2221 }

◆ getVoronoiMap() [2/2]

template<typename TKSpace>
template<uint32_t p, typename PointRange>
VoronoiMap< Space, VoronoiPointPredicate, ExactPredicateLpSeparableMetric< Space, p > > DGtal::ShortcutsGeometry< TKSpace >::getVoronoiMap ( Domain domain,
const PointRange & sites,
const Parameters & params = parametersVoronoiMap() )
inlinestatic

Computes the VoronoiMap on a domain, where sites are given through a range.

Template Parameters
pThe exponent in the Lp metric
PointRangeAn iterable of points (std::vector, DGtal::DigitalSet*, ...)
Parameters
domainThe associated domain on which the VoronoiMap is computed
sitesThe list of sites
paramsthe parameters
Returns
The VoronoiMap within a domain with prescribed sites

Definition at line 2165 of file ShortcutsGeometry.h.

2168 {
2171 DigitalSet set(domain); set.insert(sites.begin(), sites.end());
2173 Metric metric;
2174
2175 typename VoroMap::PeriodicitySpec specs = {false, false, false};
2176 if (params["toroidal-x"].as<int>()) specs[0] = true;
2177 if (params["toroidal-y"].as<int>()) specs[1] = true;
2178 if (params["toroidal-z"].as<int>()) specs[2] = true;
2179
2180
2181 // Do not return a pointer here for two reasons:
2182 // - The distance transform will not be passed anywhere else
2183 // - The operator() is less accessible with pointers.
2184 return VoroMap(domain, predicate, metric, specs);
2185 }

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

2017 {
2018 std::transform( ref_v.cbegin(), ref_v.cend(), v.cbegin(), v.begin(),
2019 [] ( RealVector rw, RealVector w )
2020 { return rw.dot( w ) >= 0.0 ? w : -w; } );
2021 }

◆ parametersATApproximation()

template<typename TKSpace>
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, 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 minimization 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 outputting feature vector v onto cells: "Average"|"Minimum"|"Maximum"

Definition at line 1739 of file ShortcutsGeometry.h.

1740 {
1741 return Parameters
1742 ( "at-enabled", 1 )
1743 ( "at-alpha", 0.1 )
1744 ( "at-lambda", 0.025 )
1745 ( "at-epsilon", 0.25 )
1746 ( "at-epsilon-start", 2.0 )
1747 ( "at-epsilon-ratio", 2.0 )
1748 ( "at-max-iter", 10 )
1749 ( "at-diff-v-max", 0.0001 )
1750 ( "at-v-policy", "Maximum" );
1751 }
Parameters()=default
Default constructor.

◆ parametersDigitizedImplicitShape3D()

template<typename TKSpace>
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 458 of file Shortcuts.h.

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

◆ parametersGeometryEstimation()

template<typename TKSpace>
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)."
  • ii-thread-number[ 1]: number of threads for II estimators; 1 keeps the sequential estimator, any other value requests the parallel estimator when OpenMP support is available.
  • ii-split-axis [ 0]: main axis used by AxisDomainSplitter for parallel II estimators.
  • surfelEmbedding [ 0]: the surfel -> point embedding for VCM estimator: 0: Pointels, 1: InnerSpel, 2: OuterSpel.
  • unit_u [0]: Use unit normals for (CNC) curvature computations.

Definition at line 990 of file ShortcutsGeometry.h.

991 {
992 return Parameters
993 ( "verbose", 1 )
994 ( "t-ring", 3.0 )
995 ( "kernel", "hat" )
996 ( "R-radius", 10.0 )
997 ( "r-radius", 3.0 )
998 ( "alpha", 0.33 )
999 ( "ii-thread-number", 1 )
1000 ( "ii-split-axis", 0 )
1001 ( "surfelEmbedding", 0 )
1002 ( "unit_u" , 0 );
1003 }

◆ parametersKSpace()

template<typename TKSpace>
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 308 of file Shortcuts.h.

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

◆ parametersShapeGeometry()

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

234 {
235 return Parameters
236 ( "projectionMaxIter", 20 )
237 ( "projectionAccuracy", 0.0001 )
238 ( "projectionGamma", 0.5 )
239 ( "gridstep", 1.0 );
240 }

◆ parametersVoronoiMap()

template<typename TKSpace>
Parameters DGtal::ShortcutsGeometry< TKSpace >::parametersVoronoiMap ( )
inlinestatic
Returns
the parameters and their default values which are used in VoronoiMap and DistanceTransformation

Definition at line 2140 of file ShortcutsGeometry.h.

2140 {
2141 return Parameters
2142 // Toricity might be moved elsewhere as this is quite a general parameter
2143 ( "toroidal-x" , false )
2144 ( "toroidal-y" , false )
2145 ( "toroidal-z" , false );
2146 }

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