DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Static Public Member Functions
DGtal::SetFromImage< TSet > Struct Template Reference

#include <SetFromImage.h>

Public Types

typedef TSet Set

Static Public Member Functions

template<typename Image , typename ForegroundPredicate >
static void append (Set &aSet, const ForegroundPredicate &isForeground, typename Image::Domain::ConstIterator itBegin, typename Image::Domain::ConstIterator itEnd)
template<typename Image >
static void append (Set &aSet, const Image &aImage, const typename Image::Value minVal, const typename Image::Value maxVal, typename Image::Domain::ConstIterator itBegin, typename Image::Domain::ConstIterator itEnd)
template<typename Image , typename ForegroundPredicate >
static void append (Set &aSet, const Image &aImage, const ForegroundPredicate &isForeground)
template<typename Image >
static void append (Set &aSet, const Image &aImage, const typename Image::Value minVal, const typename Image::Value maxVal)

Detailed Description

template<typename TSet>
struct DGtal::SetFromImage< TSet >

Aim: Define utilities to convert a digital set into an image.

Description of template class 'SetFromImage'

Template Parameters:
TImagean model of CImageContainer concept.
Examples:
geometry/surfaces/greedy-plane-segmentation-ex2.cpp, geometry/surfaces/greedy-plane-segmentation.cpp, io/digitalSetFromVol.cpp, io/display3DToOFF.cpp, topology/3dBorderExtractionImg.cpp, topology/ctopo-2-3d.cpp, topology/ctopo-2.cpp, topology/volScanBoundary.cpp, topology/volToOFF.cpp, and topology/volTrackBoundary.cpp.

Definition at line 63 of file SetFromImage.h.


Member Typedef Documentation

template<typename TSet>
typedef TSet DGtal::SetFromImage< TSet >::Set

Definition at line 65 of file SetFromImage.h.


Member Function Documentation

template<typename Set >
template<typename Image , typename ForegroundPredicate >
void DGtal::SetFromImage< Set >::append ( Set aSet,
const ForegroundPredicate &  isForeground,
typename Image::Domain::ConstIterator  itBegin,
typename Image::Domain::ConstIterator  itEnd 
)
inlinestatic

Append a Set to an existing image. Only points in the Set contained in the image domain are considered.

Precondition:
the ForegroundPredicate instance must have been created on the image aImage.
Parameters:
aSetthe set (maybe empty) to which points are added.
isForegroundinstance of ForegroundPredicate to decide
itBeginstarting point in the input image Domain.
itEndending point in the input image domain. which points to copy.

Definition at line 45 of file SetFromImage.ih.

Referenced by DGtal::SetFromImage< TSet >::append().

{
//BOOST_CONCEPT_ASSERT(( CImage<Image> ));
for( ; itBegin != itEnd; ++itBegin)
if (isForeground(*itBegin))
aSet.insert( *itBegin);
}
template<typename TSet>
template<typename Image >
static void DGtal::SetFromImage< TSet >::append ( Set aSet,
const Image aImage,
const typename Image::Value  minVal,
const typename Image::Value  maxVal,
typename Image::Domain::ConstIterator  itBegin,
typename Image::Domain::ConstIterator  itEnd 
)
inlinestatic

Append an Image value set to an existing Set (maybe empty). This method will construct a default ForegroundPredicate instance as a simple thresholding (SimpleForegroundPredicate) of values in ]minVal,maxVal].

Parameters:
aSetthe set (maybe empty) to which points are added.
minValminimum value of the thresholding
maxValmaximum value of the thresholding
itBeginstarting point in the input image Domain.
itEndending point in the input image domain.

Definition at line 104 of file SetFromImage.h.

References DGtal::SetFromImage< TSet >::append().

{
IntervalForegroundPredicate<Image> isForeground(aImage,minVal,maxVal);
append(aSet, isForeground,itBegin,itEnd);
}
template<typename TSet>
template<typename Image , typename ForegroundPredicate >
static void DGtal::SetFromImage< TSet >::append ( Set aSet,
const Image aImage,
const ForegroundPredicate &  isForeground 
)
inlinestatic

Append a Set to an existing image. Only points in the Set contained in the image domain are considered.

Precondition:
the ForegroundPredicate instance must have been created on the image aImage.
Parameters:
aSetthe set (maybe empty) to which points are added.
aImageimage to convert to a Set.
isForegroundinstance of ForegroundPredicate to decide which points to copy.

Definition at line 127 of file SetFromImage.h.

References DGtal::Image< TImageContainer >::domain().

{
typename Image::Domain domain=aImage.domain();
append<Image,ForegroundPredicate>(aSet,isForeground,domain.begin(),domain.end());
}
template<typename TSet>
template<typename Image >
static void DGtal::SetFromImage< TSet >::append ( Set aSet,
const Image aImage,
const typename Image::Value  minVal,
const typename Image::Value  maxVal 
)
inlinestatic

Append a Set to an existing image. Only points in the Set contained in the image domain are considered. This method will construct a default ForegroundPredicate instance as a simple thresholding (SimpleForegroundPredicate) of values in ]minVal,maxVal].

Parameters:
aSetthe set (maybe empty) to which points are added.
aImageimage to convert to a Set.
minValminimum value of the thresholding
maxValmaximum value of the thresholding

Definition at line 149 of file SetFromImage.h.

References DGtal::SetFromImage< TSet >::append().

{
IntervalForegroundPredicate<Image> isForeground(aImage,minVal,maxVal);
append(aSet,aImage,isForeground);
}

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