DGtal  0.9.4beta
Public Types | Public Member Functions | Protected Member Functions | Static Protected Attributes | Private Member Functions | Private Attributes
DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 > Class Template Reference

#include <DGtal/geometry/surfaces/DigitalSurfaceConvolver.h>

Collaboration diagram for DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >:
[legend]

Public Types

typedef TFunctor Functor
 
typedef TKSpace KSpace
 
typedef TKernelFunctor KernelFunctor
 
typedef TDigitalKernel DigitalKernel
 
typedef Z2i::Domain Domain
 
typedef double Quantity
 
typedef PointVector< 2, QuantityVectorQuantity
 
typedef SimpleMatrix< Quantity, 2, 2 > MatrixQuantity
 
typedef SimpleMatrix< double, 2, 2 > CovarianceMatrix
 
typedef KSpace::SCell Spel
 
typedef KSpace::Point Point
 
typedef KSpace::Space::RealPoint RealPoint
 
typedef Z2i::DigitalSet::ConstIterator KernelConstIterator
 
typedef std::pair< KernelConstIterator, KernelConstIteratorPairIterators
 
typedef CanonicSCellEmbedder< KSpaceEmbedder
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CCellFunctor< Functor >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CCellFunctor< KernelFunctor >))
 
 DigitalSurfaceConvolver (ConstAlias< Functor > f, ConstAlias< KernelFunctor > g, ConstAlias< KSpace > space)
 
 DigitalSurfaceConvolver (const DigitalSurfaceConvolver &other)
 
 ~DigitalSurfaceConvolver ()
 
void init (const Point &pOrigin, ConstAlias< PairIterators > fullKernel, ConstAlias< std::vector< PairIterators > > masks)
 
void init (const Point &pOrigin, ConstAlias< DigitalKernel > fullKernel, ConstAlias< std::vector< PairIterators > > masks)
 
template<typename SurfelIterator >
Quantity eval (const SurfelIterator &it) const
 
template<typename SurfelIterator , typename EvalFunctor >
EvalFunctor::Value eval (const SurfelIterator &it, EvalFunctor functor) const
 
template<typename SurfelIterator , typename OutputIterator >
void eval (const SurfelIterator &itbegin, const SurfelIterator &itend, OutputIterator &result) const
 
template<typename SurfelIterator , typename OutputIterator , typename EvalFunctor >
void eval (const SurfelIterator &itbegin, const SurfelIterator &itend, OutputIterator &result, EvalFunctor functor) const
 
template<typename SurfelIterator >
CovarianceMatrix evalCovarianceMatrix (const SurfelIterator &it) const
 
template<typename SurfelIterator , typename EvalFunctor >
EvalFunctor::Value evalCovarianceMatrix (const SurfelIterator &it, EvalFunctor functor) const
 
template<typename SurfelIterator , typename OutputIterator >
void evalCovarianceMatrix (const SurfelIterator &itbegin, const SurfelIterator &itend, OutputIterator &result) const
 
template<typename SurfelIterator , typename OutputIterator , typename EvalFunctor >
void evalCovarianceMatrix (const SurfelIterator &itbegin, const SurfelIterator &itend, OutputIterator &result, EvalFunctor functor) const
 
bool isValid () const
 

Protected Member Functions

void computeCovarianceMatrix (const Quantity *aMomentMatrix, CovarianceMatrix &aCovarianceMatrix) const
 
void fillMoments (Quantity *aMomentMatrix, const Spel &aSpel, double direction) const
 
template<typename SurfelIterator >
bool core_eval (const SurfelIterator &it, Quantity &innerSum, Quantity &outerSum, bool useLastResults=false, Spel &lastInnerSpel=defaultInnerSpel, Spel &lastOuterSpel=defaultOuterSpel, Quantity &lastInnerSum=defaultInnerSum, Quantity &lastOuterSum=defaultOuterSum) const
 
template<typename SurfelIterator >
bool core_evalCovarianceMatrix (const SurfelIterator &it, CovarianceMatrix &innerMatrix, CovarianceMatrix &outerMatrix, bool useLastResults=false, Spel &lastInnerSpel=defaultInnerSpel, Spel &lastOuterSpel=defaultOuterSpel, Quantity *lastInnerMoments=defaultInnerMoments, Quantity *lastOuterMoments=defaultOuterMoments) const
 
 DigitalSurfaceConvolver ()
 

Static Protected Attributes

static const int nbMoments
 
static Spel defaultInnerSpel
 
static Spel defaultOuterSpel
 
static Quantity defaultInnerMoments [6]
 
static Quantity defaultOuterMoments [6]
 
static Quantity defaultInnerSum
 
static Quantity defaultOuterSum
 

Private Member Functions

DigitalSurfaceConvolveroperator= (const DigitalSurfaceConvolver &other)
 

Private Attributes

const Dimension dimension
 
const FunctormyFFunctor
 
const KernelFunctormyGFunctor
 
const KSpacemyKSpace
 
Embedder myEmbedder
 
bool isInitFullMasks
 
bool isInitKernelAndMasks
 
const std::vector< PairIterators > * myMasks
 
const DigitalKernelmyKernel
 
const PairIteratorsmyKernelMask
 
Spel myKernelSpelOrigin
 

Detailed Description

template<typename TFunctor, typename TKernelFunctor, typename TKSpace, typename TDigitalKernel>
class DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >

Definition at line 435 of file DigitalSurfaceConvolver.h.

Member Typedef Documentation

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
typedef SimpleMatrix< double, 2, 2 > DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::CovarianceMatrix

Definition at line 451 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
typedef TDigitalKernel DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::DigitalKernel

Definition at line 444 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
typedef Z2i::Domain DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::Domain

Definition at line 446 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
typedef CanonicSCellEmbedder< KSpace > DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::Embedder

Definition at line 459 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
typedef TFunctor DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::Functor

Definition at line 441 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
typedef Z2i::DigitalSet::ConstIterator DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::KernelConstIterator

Definition at line 456 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
typedef TKernelFunctor DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::KernelFunctor

Definition at line 443 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
typedef TKSpace DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::KSpace

Definition at line 442 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
typedef SimpleMatrix< Quantity, 2, 2 > DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::MatrixQuantity

Definition at line 450 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
typedef std::pair< KernelConstIterator, KernelConstIterator > DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::PairIterators

Definition at line 458 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
typedef KSpace::Point DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::Point

Definition at line 454 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
typedef double DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::Quantity

Definition at line 448 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
typedef KSpace::Space::RealPoint DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::RealPoint

Definition at line 455 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
typedef KSpace::SCell DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::Spel

Definition at line 453 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
typedef PointVector< 2, Quantity > DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::VectorQuantity

Definition at line 449 of file DigitalSurfaceConvolver.h.

Constructor & Destructor Documentation

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::DigitalSurfaceConvolver ( ConstAlias< Functor f,
ConstAlias< KernelFunctor g,
ConstAlias< KSpace space 
)

Constructor.

Parameters
[in]fa functor f(x).
[in]ga functor g(x).
[in]spacespace in which the shape is defined.
template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::DigitalSurfaceConvolver ( const DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 > &  other)

Copy constructor.

Parameters
otherthe object to clone.
template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::~DigitalSurfaceConvolver ( )
inline

Destructor.

Definition at line 486 of file DigitalSurfaceConvolver.h.

486 {}
template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::DigitalSurfaceConvolver ( )
protected

Constructor. Forbidden by default (protected to avoid g++ warnings).

Member Function Documentation

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::BOOST_CONCEPT_ASSERT ( (concepts::CCellFunctor< Functor >)  )
template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::BOOST_CONCEPT_ASSERT ( (concepts::CCellFunctor< KernelFunctor >)  )
template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
void DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::computeCovarianceMatrix ( const Quantity aMomentMatrix,
CovarianceMatrix aCovarianceMatrix 
) const
protected

computeCovarianceMatrix compute the covariance matrix from matrix of moments.

Parameters
[in]aMomentMatrixa matrix of digital moments [ sum(1) sum(y) sum (x) sum(x*y) sum(y*y) sum(x*x) ]
[out]aCovarianceMatrixthe result covariance matrix
template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
template<typename SurfelIterator >
bool DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::core_eval ( const SurfelIterator &  it,
Quantity innerSum,
Quantity outerSum,
bool  useLastResults = false,
Spel lastInnerSpel = defaultInnerSpel,
Spel lastOuterSpel = defaultOuterSpel,
Quantity lastInnerSum = defaultInnerSum,
Quantity lastOuterSum = defaultOuterSum 
) const
protected

core_eval method used ( in intern by eval() ) to compute the Quantity on a given surfel (*it)

Parameters
[in]it(iterator of a) surfel of the shape where the convolution is computed.
[out]innerSumthe result Quantity when centering with the innerSpel.
[out]outerSumthe result Quantity when centering with the outerSpel.
[in]useLastResultsif we can use last results (optimisation with masks)
[in,out]lastInnerSpellast inner spel. Override at end of function with current inner spel (from surfel *it). Set empty if useLastResults is false.
[in,out]lastOuterSpellast outer spel. Override at end of function with current outer spel (from surfel *it). Set empty if useLastResults is false.
[in]lastInnerSumlast Quantity when centering with inner spel. Set empty if useLastResults is false.
[in]lastOuterSumlast Quantity when centering with outer spel. Set empty if useLastResults is false.
Template Parameters
SurfelIteratortype of iterator on surfel
template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
template<typename SurfelIterator >
bool DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::core_evalCovarianceMatrix ( const SurfelIterator &  it,
CovarianceMatrix innerMatrix,
CovarianceMatrix outerMatrix,
bool  useLastResults = false,
Spel lastInnerSpel = defaultInnerSpel,
Spel lastOuterSpel = defaultOuterSpel,
Quantity lastInnerMoments = defaultInnerMoments,
Quantity lastOuterMoments = defaultOuterMoments 
) const
protected

core_evalCovarianceMatrix method used ( in intern by evalCovarianceMatrix() ) to compute the covariance matrix on a given surfel (*it)

Parameters
[in]it(iterator of a) surfel of the shape where the convolution is computed.
[out]innerMatrixthe result covariance matrix when centering with the innerSpel.
[out]outerMatrixthe result covariance matrix when centering with the outerSpel.
[in]useLastResultsif we can use last results (optimisation with masks)
[in,out]lastInnerSpellast inner spel. Override at end of function with current inner spel (from surfel *it). Set empty if useLastResults is false.
[in,out]lastOuterSpellast outer spel. Override at end of function with current outer spel (from surfel *it). Set empty if useLastResults is false.
[in,out]lastInnerMomentslast inner moments when centering with inner spel. Override at end of function with current inner moments (from surfel *it). Set empty if useLastResults is false.
[in,out]lastOuterMomentslast inner moments when centering with inner spel. Override at end of function with current outer moments (from surfel *it). Set empty if useLastResults is false.
Template Parameters
SurfelIteratortype of iterator on surfel
template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
template<typename SurfelIterator >
Quantity DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::eval ( const SurfelIterator &  it) const

Convolve the kernel at a position it.

Parameters
[in]it(iterator of a) surfel of the shape where the convolution is computed.
Template Parameters
SurfelIteratortype of iterator of a surfel on the shape.
Returns
the estimated quantity at *it : (f*g)(t)
template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
template<typename SurfelIterator , typename EvalFunctor >
EvalFunctor::Value DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::eval ( const SurfelIterator &  it,
EvalFunctor  functor 
) const

Convolve the kernel at a position it and applies the functor functor on the result.

Parameters
[in]it(iterator of a) surfel of the shape where the convolution is computed.
[in]functorfunctor called with the result of the convolution.
Template Parameters
SurfelIteratortype of iterator of a surfel on the shape.
EvalFunctortype of functor on Quantity.
Returns
the return quantity of functor after giving in parameter the result of the convolution at *it
template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
template<typename SurfelIterator , typename OutputIterator >
void DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::eval ( const SurfelIterator &  itbegin,
const SurfelIterator &  itend,
OutputIterator &  result 
) const

Convolve the kernel at all positions of the range [itBegin, itEnd[ and outputs results sequentially with result iterator.

Parameters
[in]itbegin(iterator of the) first surfel of the shape where the convolution is computed.
[in]itend(iterator of the) last (excluded) surfel of the shape where the convolution is computed.
[out]resultiterator of an array where estimates quantities are set ( the estimated quantity from *itbegin till *itend (excluded)).
Template Parameters
SurfelIteratortype of iterator of a surfel on the shape.
OutputIteratortype of iterator on an array when Quantity are stored.
template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
template<typename SurfelIterator , typename OutputIterator , typename EvalFunctor >
void DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::eval ( const SurfelIterator &  itbegin,
const SurfelIterator &  itend,
OutputIterator &  result,
EvalFunctor  functor 
) const

Convolve the kernel at all positions of the range [itBegin, itEnd[ and applies the functor functor on results outputed sequentially with result iterator.

Parameters
[in]itbegin(iterator of the) first surfel of the shape where the convolution is computed.
[in]itend(iterator of the) last (excluded) surfel of the shape where the convolution is computed.
[out]resultiterator of an array where estimates quantities are set ( the estimated quantity from *itbegin till *itend (excluded)).
[in]functorfunctor called with the result of the convolution.
Template Parameters
SurfelIteratortype of iterator of a surfel on the shape.
OutputIteratortype of iterator on an array when Quantity are stored.
EvalFunctortype of functor on Quantity.
template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
template<typename SurfelIterator >
CovarianceMatrix DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::evalCovarianceMatrix ( const SurfelIterator &  it) const

Convolve the kernel at a position it.

Parameters
[in]it(iterator of a) surfel of the shape where the covariance matrix is computed.
Template Parameters
SurfelIteratortype of iterator of a surfel on the shape.
Returns
the covariance matrix at *it
template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
template<typename SurfelIterator , typename EvalFunctor >
EvalFunctor::Value DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::evalCovarianceMatrix ( const SurfelIterator &  it,
EvalFunctor  functor 
) const

Convolve the kernel at a position it and applies the functor functor on the result.

Parameters
[in]it(iterator of a) surfel of the shape where the covariance matrix is computed.
[in]functorfunctor called with the result of the convolution.
Template Parameters
SurfelIteratortype of iterator of a surfel on the shape.
EvalFunctortype of functor on CovarianceMatrix.
Returns
the result of the functor with the covariance matrix.
template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
template<typename SurfelIterator , typename OutputIterator >
void DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::evalCovarianceMatrix ( const SurfelIterator &  itbegin,
const SurfelIterator &  itend,
OutputIterator &  result 
) const

Convolve the kernel at all positions of the range [itBegin, itEnd[ and outputs results sequentially with result iterator.

Parameters
[in]itbegin(iterator of the) first surfel of the shape where the covariance matrix is computed.
[in]itend(iterator of the) last (excluded) surfel of the shape where the covariance matrix is computed.
[out]resultiterator of an array where estimates covariance matrix are set ( the covariance matrix from *itbegin till *itend (excluded)).
Template Parameters
SurfelIteratortype of iterator of a surfel on the shape.
OutputIteratortype of iterator on an array when Quantity are stored.
template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
template<typename SurfelIterator , typename OutputIterator , typename EvalFunctor >
void DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::evalCovarianceMatrix ( const SurfelIterator &  itbegin,
const SurfelIterator &  itend,
OutputIterator &  result,
EvalFunctor  functor 
) const

Convolve the kernel at all positions of the range [itBegin, itEnd[ and applies the functor functor on results outputed sequentially with result iterator.

Parameters
[in]itbegin(iterator of the) first surfel of the shape where the covariance matrix is computed.
[in]itend(iterator of the) last (excluded) surfel of the shape where the covariance matrix is computed.
[out]resultiterator of an array where results of functor are set.
[in]functorfunctor called with the result of the convolution.
Template Parameters
SurfelIteratortype of iterator of a surfel on the shape.
OutputIteratortype of iterator on an array when Quantity are stored.
EvalFunctortype of functor on CovarianceMatrix.
template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
void DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::fillMoments ( Quantity aMomentMatrix,
const Spel aSpel,
double  direction 
) const
protected

fillMoments fill the matrix of moments with a given spel.

Parameters
[out]aMomentMatrixa matrix of digital moments [ sum(1) sum(y) sum (x) sum(x*y) sum(y*y) sum(x*x) ]
[in]aSpelcurrent spel
[in]directiontrue if we add the current spel, false if we remove it.
template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
void DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::init ( const Point pOrigin,
ConstAlias< PairIterators fullKernel,
ConstAlias< std::vector< PairIterators > >  masks 
)

Initialize the convolver using masks - allow to use the optimization with adjacent cells.

Stores the full kernel explicitly: choose this init if you have a lot of memory or if your kernel is small.

Parameters
[in]pOrigincenter (digital point) of the kernel support.
[in]fullKernelpair of iterators of the full kernel. first is the first iterator (of spel) of the kernel support, second is the last iterator (of spel, excluded).
[in]masksVector of iterators (of spel) of the first and last spel of each masks. They must be ordered using a trit ({0,1,2}) encoded array. trit 0 => shifting_coord = -1 trit 1 => shifting_coord = 0 trit 2 => shifting_coord = 1 Example in 3D : zyx x y z mask[0] : base3(0) = 000 => shifting = {-1,-1,-1} mask[5] : base3(5) = 012 => shifting = { 1, 0,-1}
template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
void DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::init ( const Point pOrigin,
ConstAlias< DigitalKernel fullKernel,
ConstAlias< std::vector< PairIterators > >  masks 
)

Intitialize the convolver using masks - allow to use the optimization with adjacent cells.

Stores the kernel implicitly: choose this init if you have not a lot of memory available or if your kernel size is big.

Parameters
[in]pOrigincenter (digital point) of the kernel support.
[in]fullKernelpointer of the digital (full) kernel.
[in]masksVector of iterators (of spel) of the first and last spel of each masks. They must be ordered using a trit ({0,1,2}) encoded array. trit 0 => shifting_coord = -1 trit 1 => shifting_coord = 0 trit 2 => shifting_coord = 1 Example in 3D : zyx x y z mask[0] : base3(0) = 000 => shifting = {-1,-1,-1} mask[5] : base3(5) = 012 => shifting = { 1, 0,-1}
template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
bool DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.
template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
DigitalSurfaceConvolver& DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::operator= ( const DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 > &  other)
private

Assignment.

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

Field Documentation

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
Quantity DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::defaultInnerMoments[6]
staticprotected

default array of Quantity, used as default parameter in core_evalCovarianceMatrix function

Definition at line 690 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
Spel DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::defaultInnerSpel
staticprotected

default Spel, used as default parameter in core_eval and core_evalCovarianceMatrix functions

Definition at line 688 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
Quantity DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::defaultInnerSum
staticprotected

default Quantity, used as default parameter in core_eval function

Definition at line 692 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
Quantity DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::defaultOuterMoments[6]
staticprotected

default array of Quantity, used as default parameter in core_evalCovarianceMatrix function

Definition at line 691 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
Spel DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::defaultOuterSpel
staticprotected

default Spel, used as default parameter in core_eval and core_evalCovarianceMatrix functions

Definition at line 689 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
Quantity DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::defaultOuterSum
staticprotected

default Quantity, used as default parameter in core_eval function

Definition at line 693 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
const Dimension DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::dimension
private

Current dimension (= 2)

Definition at line 749 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
bool DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::isInitFullMasks
private

If the user uses init with masks. See init() for more information.

Definition at line 760 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
bool DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::isInitKernelAndMasks
private

If the user uses init with masks and digital (full) kernel. See init() for more information.

Definition at line 762 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
Embedder DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::myEmbedder
private

Converter Digital point -> Euclidean point.

Definition at line 758 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
const Functor& DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::myFFunctor
private

Const ref of the shape functor.

Definition at line 751 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
const KernelFunctor& DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::myGFunctor
private

Const ref of the kernel functor.

Definition at line 753 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
const DigitalKernel* DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::myKernel
private

Two choice to iterate over the full kernel. See init() for more information.

Definition at line 766 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
const PairIterators* DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::myKernelMask
private

Two choice to iterate over the full kernel. See init() for more information.

Definition at line 767 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
Spel DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::myKernelSpelOrigin
private

Copy of the origin cell of the kernel.

Definition at line 769 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
const KSpace& DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::myKSpace
private

Const ref of the shape Kspace.

Definition at line 756 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
const std::vector< PairIterators >* DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::myMasks
private

Pointer of vector of iterators for kernel partial masks.

Definition at line 764 of file DigitalSurfaceConvolver.h.

template<typename TFunctor , typename TKernelFunctor , typename TKSpace , typename TDigitalKernel >
const int DGtal::DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >::nbMoments
staticprotected

the number of moments is dependent to the dimension. In 2D, they are 6 moments such that p+q <= 2. (see method fillMoments())

Definition at line 687 of file DigitalSurfaceConvolver.h.


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