DGtal 2.0.0
Loading...
Searching...
No Matches
DGtal::functors::IntervalForegroundPredicate< Image > Class Template Reference

Aim: Define a simple Foreground predicate thresholding image values between two constant values (the first one being excluded). More...

#include <DGtal/images/IntervalForegroundPredicate.h>

Public Types

typedef Image::Value Value
typedef Image::Point Point

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CConstImage< Image >))
 IntervalForegroundPredicate (ConstAlias< Image > aImage, const Value minVal, const Value maxVal)
bool operator() (const typename Image::Point &aPoint) const
bool operator() (const typename Image::ConstRange::ConstIterator &it) const

Protected Member Functions

 IntervalForegroundPredicate ()

Private Attributes

const ImagemyImage
Value myMaxVal
Value myMinVal

Detailed Description

template<typename Image>
class DGtal::functors::IntervalForegroundPredicate< Image >

Aim: Define a simple Foreground predicate thresholding image values between two constant values (the first one being excluded).

Description of template class 'IntervalForegroundPredicate'

This class is a model of concepts::CPointPredicate.

Template Parameters
Imagean model of CImageContainer concept.
Examples
geometry/surfaces/dvcm-3d.cpp.

Definition at line 64 of file IntervalForegroundPredicate.h.

Member Typedef Documentation

◆ Point

◆ Value

Constructor & Destructor Documentation

◆ IntervalForegroundPredicate() [1/2]

template<typename Image>
DGtal::functors::IntervalForegroundPredicate< Image >::IntervalForegroundPredicate ( ConstAlias< Image > aImage,
const Value minVal,
const Value maxVal )
inline

Constructor. This functor can be used to threshold image values in the interval ]minVal,maxVal].

Parameters
aImagethe image.
minValthe minimum value (first value excluded).
maxValthe maximum value (last value considered).

Definition at line 80 of file IntervalForegroundPredicate.h.

References myImage, myMaxVal, and myMinVal.

◆ IntervalForegroundPredicate() [2/2]

template<typename Image>
DGtal::functors::IntervalForegroundPredicate< Image >::IntervalForegroundPredicate ( )
protected

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT()

template<typename Image>
DGtal::functors::IntervalForegroundPredicate< Image >::BOOST_CONCEPT_ASSERT ( (concepts::CConstImage< Image >) )

◆ operator()() [1/2]

template<typename Image>
bool DGtal::functors::IntervalForegroundPredicate< Image >::operator() ( const typename Image::ConstRange::ConstIterator & it) const
inline
Returns
True if the point belongs to the value interval.

Definition at line 96 of file IntervalForegroundPredicate.h.

97 {
98 return ((*it) > myMinVal) && ((*it) <= myMaxVal);
99 }

References myMaxVal, and myMinVal.

◆ operator()() [2/2]

template<typename Image>
bool DGtal::functors::IntervalForegroundPredicate< Image >::operator() ( const typename Image::Point & aPoint) const
inline
Returns
True if the point belongs to the value interval.

Definition at line 88 of file IntervalForegroundPredicate.h.

89 {
90 return ((*myImage)(aPoint) > myMinVal) && ((*myImage)(aPoint) <= myMaxVal);
91 }

References aPoint, myImage, myMaxVal, and myMinVal.

Field Documentation

◆ myImage

template<typename Image>
const Image* DGtal::functors::IntervalForegroundPredicate< Image >::myImage
private

Definition at line 103 of file IntervalForegroundPredicate.h.

Referenced by IntervalForegroundPredicate(), and operator()().

◆ myMaxVal

template<typename Image>
Value DGtal::functors::IntervalForegroundPredicate< Image >::myMaxVal
private

◆ myMinVal

template<typename Image>
Value DGtal::functors::IntervalForegroundPredicate< Image >::myMinVal
private

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