DGtal  1.3.beta
Public Types | Public Member Functions | Private Attributes
DGtal::functors::IIPrincipalDirectionsFunctor< TSpace, TMatrix > Class Template Reference

Aim: A functor Matrix -> std::pair<RealVector,RealVector> that returns the first and the second principal curvature directions by diagonalizing the given covariance matrix. This functor is valid starting from 3D space. Note that by second we mean the direction with second greatest curvature in absolute value. More...

#include <DGtal/geometry/surfaces/estimation/IIGeometricFunctors.h>

Public Types

typedef IIPrincipalDirectionsFunctor< TSpace > Self
 
typedef TSpace Space
 
typedef Space::RealVector RealVector
 
typedef RealVector::Component Component
 
typedef TMatrix Matrix
 
typedef Matrix Argument
 
typedef std::pair< RealVector, RealVectorQuantity
 
typedef Quantity Value
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CMatrix< Matrix >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CSpace< TSpace >))
 
 BOOST_STATIC_ASSERT ((Space::dimension >=3))
 
 IIPrincipalDirectionsFunctor ()
 Default constructor. More...
 
 IIPrincipalDirectionsFunctor (const Self &)
 Copy constructor. Nothing to do. More...
 
Selfoperator= (const Self &)
 
Value operator() (const Argument &arg) const
 
void init (Component, Component)
 

Private Attributes

Matrix eigenVectors
 A data member only used for temporary calculations. More...
 
RealVector eigenValues
 A data member only used for temporary calculations. More...
 

Detailed Description

template<typename TSpace, typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
class DGtal::functors::IIPrincipalDirectionsFunctor< TSpace, TMatrix >

Aim: A functor Matrix -> std::pair<RealVector,RealVector> that returns the first and the second principal curvature directions by diagonalizing the given covariance matrix. This functor is valid starting from 3D space. Note that by second we mean the direction with second greatest curvature in absolute value.

Description of template class 'IIPrincipalDirectionsFunctor'

Template Parameters
TSpacea model of CSpace, for instance SpaceND.
TMatrixa model of CMatrix, for instance SimpleMatrix.
See also
IntegralInvariantCovarianceEstimator

Definition at line 376 of file IIGeometricFunctors.h.

Member Typedef Documentation

◆ Argument

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
typedef Matrix DGtal::functors::IIPrincipalDirectionsFunctor< TSpace, TMatrix >::Argument

Definition at line 385 of file IIGeometricFunctors.h.

◆ Component

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
typedef RealVector::Component DGtal::functors::IIPrincipalDirectionsFunctor< TSpace, TMatrix >::Component

Definition at line 383 of file IIGeometricFunctors.h.

◆ Matrix

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
typedef TMatrix DGtal::functors::IIPrincipalDirectionsFunctor< TSpace, TMatrix >::Matrix

Definition at line 384 of file IIGeometricFunctors.h.

◆ Quantity

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
typedef std::pair<RealVector,RealVector> DGtal::functors::IIPrincipalDirectionsFunctor< TSpace, TMatrix >::Quantity

Definition at line 386 of file IIGeometricFunctors.h.

◆ RealVector

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
typedef Space::RealVector DGtal::functors::IIPrincipalDirectionsFunctor< TSpace, TMatrix >::RealVector

Definition at line 382 of file IIGeometricFunctors.h.

◆ Self

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
typedef IIPrincipalDirectionsFunctor<TSpace> DGtal::functors::IIPrincipalDirectionsFunctor< TSpace, TMatrix >::Self

Definition at line 380 of file IIGeometricFunctors.h.

◆ Space

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
typedef TSpace DGtal::functors::IIPrincipalDirectionsFunctor< TSpace, TMatrix >::Space

Definition at line 381 of file IIGeometricFunctors.h.

◆ Value

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
typedef Quantity DGtal::functors::IIPrincipalDirectionsFunctor< TSpace, TMatrix >::Value

Definition at line 387 of file IIGeometricFunctors.h.

Constructor & Destructor Documentation

◆ IIPrincipalDirectionsFunctor() [1/2]

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
DGtal::functors::IIPrincipalDirectionsFunctor< TSpace, TMatrix >::IIPrincipalDirectionsFunctor ( )
inline

Default constructor.

Definition at line 394 of file IIGeometricFunctors.h.

394 {}

◆ IIPrincipalDirectionsFunctor() [2/2]

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
DGtal::functors::IIPrincipalDirectionsFunctor< TSpace, TMatrix >::IIPrincipalDirectionsFunctor ( const Self )
inline

Copy constructor. Nothing to do.

Definition at line 396 of file IIGeometricFunctors.h.

396 {}

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT() [1/2]

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
DGtal::functors::IIPrincipalDirectionsFunctor< TSpace, TMatrix >::BOOST_CONCEPT_ASSERT ( (concepts::CMatrix< Matrix >)  )

◆ BOOST_CONCEPT_ASSERT() [2/2]

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
DGtal::functors::IIPrincipalDirectionsFunctor< TSpace, TMatrix >::BOOST_CONCEPT_ASSERT ( (concepts::CSpace< TSpace >)  )

◆ BOOST_STATIC_ASSERT()

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
DGtal::functors::IIPrincipalDirectionsFunctor< TSpace, TMatrix >::BOOST_STATIC_ASSERT ( (Space::dimension >=3)  )

◆ init()

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
void DGtal::functors::IIPrincipalDirectionsFunctor< TSpace, TMatrix >::init ( Component  ,
Component   
)
inline

Initializes the functor with the gridstep and the ball Euclidean radius. Not used for this estimator.

Definition at line 431 of file IIGeometricFunctors.h.

431 {}

◆ operator()()

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
Value DGtal::functors::IIPrincipalDirectionsFunctor< TSpace, TMatrix >::operator() ( const Argument arg) const
inline

Apply operator.

Parameters
argany symmetric positive matrix (covariance matrix
Returns
the first and the second principal curvature direction in a std::pair for the II covariance matrix, which is the eigenvector associated with the highest eigenvalues.

Definition at line 408 of file IIGeometricFunctors.h.

409  {
412 
413  ASSERT ( !std::isnan(eigenValues[0]) ); // NaN
414 #ifdef DEBUG
415  for( Dimension i_dim = 1; i_dim < Space::dimension; ++i_dim )
416  {
417  ASSERT ( std::abs(eigenValues[i_dim - 1]) <= std::abs(eigenValues[i_dim]) );
418  }
419 #endif
420 
421  return Value(
422  eigenVectors.column( Space::dimension - 1 ),
423  eigenVectors.column( Space::dimension - 2 )
424  );
425  }

References DGtal::SpaceND< dim, TInteger >::dimension, DGtal::functors::IIPrincipalDirectionsFunctor< TSpace, TMatrix >::eigenValues, DGtal::functors::IIPrincipalDirectionsFunctor< TSpace, TMatrix >::eigenVectors, and DGtal::EigenDecomposition< TN, TComponent, TMatrix >::getEigenDecomposition().

◆ operator=()

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
Self& DGtal::functors::IIPrincipalDirectionsFunctor< TSpace, TMatrix >::operator= ( const Self )
inline

Assignment. Nothing to do.

Returns
itself

Definition at line 399 of file IIGeometricFunctors.h.

399 { return *this; }

Field Documentation

◆ eigenValues

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
RealVector DGtal::functors::IIPrincipalDirectionsFunctor< TSpace, TMatrix >::eigenValues
mutableprivate

A data member only used for temporary calculations.

Definition at line 437 of file IIGeometricFunctors.h.

Referenced by DGtal::functors::IIPrincipalDirectionsFunctor< TSpace, TMatrix >::operator()().

◆ eigenVectors

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
Matrix DGtal::functors::IIPrincipalDirectionsFunctor< TSpace, TMatrix >::eigenVectors
mutableprivate

A data member only used for temporary calculations.

Definition at line 435 of file IIGeometricFunctors.h.

Referenced by DGtal::functors::IIPrincipalDirectionsFunctor< TSpace, TMatrix >::operator()().


The documentation for this class was generated from the following file:
DGtal::functors::IIPrincipalDirectionsFunctor::eigenValues
RealVector eigenValues
A data member only used for temporary calculations.
Definition: IIGeometricFunctors.h:437
DGtal::EigenDecomposition::getEigenDecomposition
static void getEigenDecomposition(const Matrix &matrix, Matrix &eigenVectors, Vector &eigenValues)
Compute both eigen vectors and eigen values from an input matrix.
DGtal::Dimension
DGtal::uint32_t Dimension
Definition: Common.h:137
DGtal::functors::IIPrincipalDirectionsFunctor::Value
Quantity Value
Definition: IIGeometricFunctors.h:387
DGtal::functors::IIPrincipalDirectionsFunctor::eigenVectors
Matrix eigenVectors
A data member only used for temporary calculations.
Definition: IIGeometricFunctors.h:435
DGtal::SpaceND::dimension
static const Dimension dimension
static constants to store the dimension.
Definition: SpaceND.h:132