DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
SetFromImage.h
1
16
17
#pragma once
18
30
31
#if defined(SetFromImage_RECURSES)
32
#error Recursive header files inclusion detected in SetFromImage.h
33
#else
// defined(SetFromImage_RECURSES)
35
#define SetFromImage_RECURSES
36
37
#if !defined SetFromImage_h
39
#define SetFromImage_h
40
42
// Inclusions
43
#include <iostream>
44
#include "DGtal/base/Common.h"
45
#include "DGtal/images/CImage.h"
46
#include "DGtal/kernel/sets/CDigitalSet.h"
47
#include "DGtal/images/IntervalForegroundPredicate.h"
49
50
namespace
DGtal
51
{
52
54
// template class SetFromImage
62
template
<
typename
TSet>
63
struct
SetFromImage
64
{
65
typedef
TSet
Set
;
66
67
BOOST_CONCEPT_ASSERT
((
concepts::CDigitalSet<Set>
));
68
79
template
<
typename
Image,
typename
ForegroundPredicate>
80
static
81
void
append
(
Set
&aSet,
82
const
ForegroundPredicate &isForeground,
83
typename
Image::Domain::ConstIterator
itBegin,
84
typename
Image::Domain::ConstIterator
itEnd);
85
100
template
<
typename
Image>
101
static
102
void
append
(
Set
&aSet,
const
Image
&aImage,
103
const
typename
Image::Value
minVal,
104
const
typename
Image::Value
maxVal,
105
typename
Image::Domain::ConstIterator
itBegin,
106
typename
Image::Domain::ConstIterator
itEnd)
107
{
108
functors::IntervalForegroundPredicate<Image>
isForeground(aImage,minVal,maxVal);
109
110
append
(aSet, isForeground,itBegin,itEnd);
111
}
112
123
template
<
typename
Image,
typename
ForegroundPredicate>
124
static
125
void
append
(
Set
&aSet,
const
Image
&aImage,
const
ForegroundPredicate &isForeground)
126
{
127
typename
Image::Domain
domain
=aImage.
domain
();
128
129
append<Image,ForegroundPredicate>
(aSet,isForeground,
domain
.begin(),
domain
.end());
130
}
131
144
template
<
typename
Image>
145
static
146
void
append
(
Set
&aSet,
const
Image
&aImage,
147
const
typename
Image::Value
minVal,
148
const
typename
Image::Value
maxVal)
149
{
150
functors::IntervalForegroundPredicate<Image>
isForeground(aImage,minVal,maxVal);
151
append
(aSet,aImage,isForeground);
152
}
153
154
};
155
}
// namespace DGtal
156
157
159
// Includes inline functions.
160
#include "DGtal/images/imagesSetsUtils/SetFromImage.ih"
161
162
// //
164
165
#endif
// !defined SetFromImage_h
166
167
#undef SetFromImage_RECURSES
168
#endif
// else defined(SetFromImage_RECURSES)
DGtal::ImageContainerBySTLVector< Domain, Value >::ConstIterator
std::vector< Value >::const_iterator ConstIterator
Definition
ImageContainerBySTLVector.h:265
DGtal::ImageContainerBySTLVector< Domain, Value >::Domain
Domain Domain
Definition
ImageContainerBySTLVector.h:137
DGtal::ImageContainerBySTLVector< Domain, Value >::Value
Value Value
Definition
ImageContainerBySTLVector.h:153
DGtal::Image
Aim: implements association between points lying in a digital domain and values.
Definition
Image.h:70
DGtal::Image::domain
const Domain & domain() const
Definition
Image.h:192
DGtal::functors::IntervalForegroundPredicate
Aim: Define a simple Foreground predicate thresholding image values between two constant values (the ...
Definition
IntervalForegroundPredicate.h:65
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::SetFromImage
Aim: Define utilities to convert a digital set into an image.
Definition
SetFromImage.h:64
DGtal::SetFromImage::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CDigitalSet< Set >))
DGtal::SetFromImage::append
static void append(Set &aSet, const Image &aImage, const typename Image::Value minVal, const typename Image::Value maxVal)
Definition
SetFromImage.h:146
DGtal::SetFromImage::append
static void append(Set &aSet, const ForegroundPredicate &isForeground, typename Image::Domain::ConstIterator itBegin, typename Image::Domain::ConstIterator itEnd)
DGtal::SetFromImage::append
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)
Definition
SetFromImage.h:102
DGtal::SetFromImage::Set
TSet Set
Definition
SetFromImage.h:65
DGtal::SetFromImage::append
static void append(Set &aSet, const Image &aImage, const ForegroundPredicate &isForeground)
Definition
SetFromImage.h:125
DGtal::concepts::CDigitalSet
Aim: Represents a set of points within the given domain. This set of points is modifiable by the user...
Definition
CDigitalSet.h:141
domain
Domain domain
Definition
testProjection.cpp:88
src
DGtal
images
imagesSetsUtils
SetFromImage.h
Generated on
for DGtal by
1.18.0