DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Private Attributes
DGtal::BoundaryPredicate< TKSpace, TImage > Class Template Reference

#include <BoundaryPredicate.h>

Public Types

typedef TKSpace KSpace
typedef TImage Image
typedef KSpace::Surfel Surfel
typedef KSpace::Point Point
typedef KSpace::SCell SCell
typedef Image::Value Value

Public Member Functions

 BOOST_STATIC_ASSERT ((ConceptUtils::SameType< typename KSpace::Point, typename Image::Point >::value))
 ~BoundaryPredicate ()
 BoundaryPredicate (const KSpace &aSpace, const Image &anImage, const Value &l1)
 BoundaryPredicate (const BoundaryPredicate &other)
BoundaryPredicateoperator= (const BoundaryPredicate &other)
bool operator() (const Surfel &s) const
void selfDisplay (std::ostream &out) const
bool isValid () const

Private Attributes

const KSpacemyPtrSpace
const ImagemyPtrImage
Value myLabel1

Detailed Description

template<typename TKSpace, typename TImage>
class DGtal::BoundaryPredicate< TKSpace, TImage >

Aim: The predicate on surfels that represents the frontier between a region and its complementary in an image. It can be used with ExplicitDigitalSurface or LightExplicitDigitalSurface so as to define a digital surface. Such surfaces may of course be open.

Description of class 'BoundaryPredicate'

Template Parameters:
KSpaceany model of cellular space
TImageany model of Image
Examples:
topology/frontierAndBoundary.cpp.

Definition at line 65 of file BoundaryPredicate.h.


Member Typedef Documentation

template<typename TKSpace, typename TImage>
typedef TImage DGtal::BoundaryPredicate< TKSpace, TImage >::Image

Definition at line 70 of file BoundaryPredicate.h.

template<typename TKSpace, typename TImage>
typedef TKSpace DGtal::BoundaryPredicate< TKSpace, TImage >::KSpace

Definition at line 69 of file BoundaryPredicate.h.

template<typename TKSpace, typename TImage>
typedef KSpace::Point DGtal::BoundaryPredicate< TKSpace, TImage >::Point

Definition at line 72 of file BoundaryPredicate.h.

template<typename TKSpace, typename TImage>
typedef KSpace::SCell DGtal::BoundaryPredicate< TKSpace, TImage >::SCell

Definition at line 73 of file BoundaryPredicate.h.

template<typename TKSpace, typename TImage>
typedef KSpace::Surfel DGtal::BoundaryPredicate< TKSpace, TImage >::Surfel

Definition at line 71 of file BoundaryPredicate.h.

template<typename TKSpace, typename TImage>
typedef Image::Value DGtal::BoundaryPredicate< TKSpace, TImage >::Value

Definition at line 74 of file BoundaryPredicate.h.


Constructor & Destructor Documentation

template<typename TKSpace , typename TImage >
DGtal::BoundaryPredicate< TKSpace, TImage >::~BoundaryPredicate ( )
inline

Destructor.

Definition at line 45 of file BoundaryPredicate.ih.

{}
template<typename TKSpace , typename TImage >
DGtal::BoundaryPredicate< TKSpace, TImage >::BoundaryPredicate ( const KSpace aSpace,
const Image anImage,
const Value l1 
)
inline

Constructor. The frontier will be defined only with the image domain. The space must be large enough to contain the boundary.

Parameters:
aSpacea cellular grid space (referenced).
anImageany image (referenced).
l1a label in the image that defines the inner region.

Definition at line 51 of file BoundaryPredicate.ih.

: myPtrSpace( &aSpace ), myPtrImage( &anImage ),
myLabel1( l1 )
{}
template<typename TKSpace , typename TImage >
DGtal::BoundaryPredicate< TKSpace, TImage >::BoundaryPredicate ( const BoundaryPredicate< TKSpace, TImage > &  other)
inline

Copy constructor.

Parameters:
otherthe object to clone.

Definition at line 60 of file BoundaryPredicate.ih.

: myPtrSpace( other.myPtrSpace ), myPtrImage( other.myPtrImage ),
myLabel1( other.myLabel1 )
{}

Member Function Documentation

template<typename TKSpace, typename TImage>
DGtal::BoundaryPredicate< TKSpace, TImage >::BOOST_STATIC_ASSERT ( (ConceptUtils::SameType< typename KSpace::Point, typename Image::Point >::value)  )
template<typename TKSpace , typename TImage >
bool DGtal::BoundaryPredicate< TKSpace, TImage >::isValid ( ) const
inline

Checks the validity/consistency of the object.

Returns:
'true' if the object is valid, 'false' otherwise.

Definition at line 109 of file BoundaryPredicate.ih.

{
return true;
}
template<typename TKSpace , typename TImage >
bool DGtal::BoundaryPredicate< TKSpace, TImage >::operator() ( const Surfel s) const
inline

Predicate operator.

Parameters:
sany surfel
Returns:
'true' iff s has its inner voxel that has label myLabel1 in image myImage and its outer voxel that has a label different from myLabel1.

Definition at line 84 of file BoundaryPredicate.ih.

{
Dimension orthDir = myPtrSpace->sOrthDir( s );
bool orthDirect = myPtrSpace->sDirect( s, orthDir );
SCell int_spel = myPtrSpace->sIncident( s, orthDir, orthDirect );
Point int_p = myPtrSpace->sCoords( int_spel );
Point out_p = int_p;
out_p[ orthDir ] += orthDirect ? -1 : 1;
return ( (*myPtrImage)( int_p ) == myLabel1 )
&& ( (*myPtrImage)( out_p ) != myLabel1 );
}
template<typename TKSpace , typename TImage >
DGtal::BoundaryPredicate< TKSpace, TImage > & DGtal::BoundaryPredicate< TKSpace, TImage >::operator= ( const BoundaryPredicate< TKSpace, TImage > &  other)
inline

Assignment. Required by CSurfelPredicate.

Parameters:
otherthe object to clone.
Returns:
a reference to this object.

Definition at line 69 of file BoundaryPredicate.ih.

References DGtal::BoundaryPredicate< TKSpace, TImage >::myLabel1, DGtal::BoundaryPredicate< TKSpace, TImage >::myPtrImage, and DGtal::BoundaryPredicate< TKSpace, TImage >::myPtrSpace.

{
if ( this != &other )
{
myPtrSpace = other.myPtrSpace;
myPtrImage = other.myPtrImage;
myLabel1 = other.myLabel1;
}
return *this;
}
template<typename TKSpace , typename TImage >
void DGtal::BoundaryPredicate< TKSpace, TImage >::selfDisplay ( std::ostream &  out) const
inline

Writes/Displays the object on an output stream.

Parameters:
outthe output stream where the object is written.

Definition at line 100 of file BoundaryPredicate.ih.

{
out << "[BoundaryPredicate]";
}

Field Documentation

template<typename TKSpace, typename TImage>
Value DGtal::BoundaryPredicate< TKSpace, TImage >::myLabel1
private

the label of the inner region that defines the boundary.

Definition at line 147 of file BoundaryPredicate.h.

Referenced by DGtal::BoundaryPredicate< TKSpace, TImage >::operator=().

template<typename TKSpace, typename TImage>
const Image* DGtal::BoundaryPredicate< TKSpace, TImage >::myPtrImage
private
template<typename TKSpace, typename TImage>
const KSpace* DGtal::BoundaryPredicate< TKSpace, TImage >::myPtrSpace
private

the cellular space where lies the image.

Definition at line 143 of file BoundaryPredicate.h.

Referenced by DGtal::BoundaryPredicate< TKSpace, TImage >::operator=().


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