31#if defined(NeighborhoodConvexityAnalyzer_RECURSES)
32#error Recursive header files inclusion detected in NeighborhoodConvexityAnalyzer.h
35#define NeighborhoodConvexityAnalyzer_RECURSES
37#if !defined NeighborhoodConvexityAnalyzer_h
39#define NeighborhoodConvexityAnalyzer_h
48#include <unordered_set>
49#include "DGtal/base/Common.h"
50#include "DGtal/base/Clone.h"
51#include "DGtal/base/ConstExpressions.h"
52#include "DGtal/base/TimeStampMemoizer.h"
53#include "DGtal/kernel/CPointPredicate.h"
54#include "DGtal/kernel/CBoundedNumber.h"
55#include "DGtal/kernel/domains/HyperRectDomain.h"
56#include "DGtal/topology/CCellularGridSpaceND.h"
57#include "DGtal/topology/KhalimskySpaceND.h"
58#include "DGtal/geometry/volumes/DigitalConvexity.h"
93 template <
typename TKSpace,
int K >
155 trace.info() <<
"Size=" <<
size() <<
" middle=" <<
middle << std::endl;
167 Size memoizer_size = 0 )
173 trace.info() <<
"Size=" <<
size() <<
" middle=" <<
middle << std::endl;
221 template <
typename Po
intPredicate >
290 int mask = with_center
300 bool memoized = p.second;
307 std::vector< Point > localX;
319 std::vector< Point > localX;
357 int mask = with_center
367 bool memoized = p.second;
374 std::vector< Point > localCompX;
376 ok =
myDigConv.isFullyConvex( localCompX );
387 std::vector< Point > localCompX;
389 ok =
myDigConv.isFullyConvex( localCompX );
426 int mask = with_center
433 std::vector< Point > localX;
449 int mask = with_center
456 std::vector< Point > localCompX;
474 bool complement,
bool with_center )
479 if ( ! with_center ) current.reset(
middle );
480 else current.set(
middle );
484 if ( with_center ) current.set(
middle );
493 void getLocalX( std::vector< Point >& localX,
bool with_center )
const;
499 void getLocalCompX( std::vector< Point >& localCompX,
bool with_center )
const;
560 (
bool compX,
bool with_center )
const;
570 (
bool compX,
bool with_center )
const;
580 (
Configuration cfg, std::vector< BasicConfiguration > & result )
const;
603#include "NeighborhoodConvexityAnalyzer.ih"
610#undef NeighborhoodConvexityAnalyzer_RECURSES
Aim: This class encapsulates its parameter class to indicate that the given parameter is required to ...
Aim: A helper class to build polytopes from digital sets and to check digital k-convexity and full co...
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
PointVector< dim, Integer > Point
SpaceND< dim, Integer > Space
PointVector< dim, Integer > Vector
static const constexpr Dimension dimension
KhalimskyCell< dim, Integer > Cell
bool isComplementaryFullyConvex(bool with_center)
Computation
Enum types indicating the possible type of local computations.
@ Convexity_CompX_with_center
@ FullConvexity_X_without_center
@ Convexity_X_with_center
@ FullConvexity_CompX_with_center
@ FullConvexity_X_with_center
@ FullConvexity_CompX_without_center
@ Convexity_X_without_center
@ Convexity_CompX_without_center
static const Size neigh_size
NeighborhoodConvexityAnalyzer(Clone< KSpace > aKSpace, Size memoizer_size=0)
BOOST_CONCEPT_ASSERT((concepts::CCellularGridSpaceND< TKSpace >))
static Configuration makeConfiguration(Configuration current, bool complement, bool with_center)
std::bitset< 512 > myBasicFullConvexityTable
NeighborhoodConvexityAnalyzer(Point lo, Point hi, Size memoizer_size=0)
void computeBasicFullConvexityTable()
std::vector< Point > PointRange
std::bitset< functions::const_pow(2 *K+1, dimension) > Configuration
bool is0Convex(bool with_center)
bool isFullyConvex(bool with_center)
const KSpace & space() const
static const Dimension dimension
const Domain & domain() const
bool is0ConvexCollapsible()
void setCenter(Point c, const PointPredicate &X)
~NeighborhoodConvexityAnalyzer()=default
bool isFullyConvexCollapsible()
bool checkBasicConfigurations0Convexity(bool compX, bool with_center) const
HyperRectDomain< Space > Domain
DigitalConvexity< KSpace > myDigConv
bool checkBasicConfigurationsFullConvexity(bool compX, bool with_center) const
void getLocalCompX(std::vector< Point > &localCompX, bool with_center) const
Configuration configuration() const
NeighborhoodConvexityAnalyzer()=default
TimeStampMemoizer< Configuration, bool > myMemoizer
static const bool false_positive
std::bitset< 512 > myBasic0ConvexityTable
void getLocalX(std::vector< Point > &localX, bool with_center) const
bool isComplementary0Convex(bool with_center)
Self & operator=(const Self &other)=default
bool isCenterInX() const
Tells if the current center belongs to the shape X.
std::bitset< 9 > BasicConfiguration
NeighborhoodConvexityAnalyzer< TKSpace, K > Self
void computeBasicConfigurations(Configuration cfg, std::vector< BasicConfiguration > &result) const
std::vector< BasicConfiguration > myBasicCfgX
BasicConfiguration computeCentralBasicConfiguration(Configuration cfg, Dimension i, Dimension j) const
NeighborhoodConvexityAnalyzer(const Self &other)=default
constexpr T const_pow(T b, unsigned int e)
constexpr T const_middle(T K, unsigned int e)
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::uint32_t Dimension
Aim: This concept describes a cellular grid space in nD. In these spaces obtained by cartesian produc...