DGtal
0.6.devel
Main Page
Related Pages
Modules
Namespaces
Data Structures
Examples
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
src
DGtal
images
ImageContainerByITKImage.h
1
17
#pragma once
18
31
#if defined(ImageContainerByITKImage_RECURSES)
32
#error Recursive header files inclusion detected in ImageContainerByITKImage.h
33
#else // defined(ImageContainerByITKImage_RECURSES)
34
35
#define ImageContainerByITKImage_RECURSES
36
37
#if !defined ImageContainerByITKImage_h
38
39
#define ImageContainerByITKImage_h
40
42
// Inclusions
43
#include "DGtal/base/Common.h"
44
#include "DGtal/base/CLabel.h"
45
#include "DGtal/kernel/domains/CDomain.h"
46
47
#include <itkImage.h>
48
#include <itkImageRegionConstIterator.h>
49
#include <itkImageRegionIterator.h>
50
#include <iostream>
51
53
54
namespace
DGtal
55
{
56
namespace
experimental
57
{
58
60
// template class ImageContainerByITKImage
70
template
<
typename
TDomain,
typename
TValue>
71
class
ImageContainerByITKImage
72
{
73
// ----------------------- Standard services ------------------------------
74
public
:
75
76
BOOST_CONCEPT_ASSERT
((
CLabel<TValue>
));
77
BOOST_CONCEPT_ASSERT
((
CDomain<TDomain>
));
78
79
typedef
TValue
Value
;
80
typedef
TDomain
Domain
;
81
82
// static constants
83
static
const
typename
Domain::Dimension
dimension
=
Domain::dimension
;
84
85
typedef
typename
Domain::Point
Point
;
86
typedef
typename
Domain::Vector
Vector
;
87
typedef
typename
Domain::Dimension
Dimension
;
88
typedef
typename
Domain::Integer
Integer
;
89
typedef
typename
Domain::Size
Size
;
90
typedef
Point
Vertex
;
91
92
typedef
typename
itk::Image< TValue, dimension>
ITKImage
;
93
typedef
typename
ITKImage::Pointer
ITKImagePointer
;
94
typedef
typename
itk::ImageRegionConstIterator< ITKImage >
ConstIterator
;
95
typedef
typename
itk::ImageRegionIterator< ITKImage >
Iterator
;
96
98
104
ImageContainerByITKImage
(
const
Point
&aPointA,
105
const
Point
&aPointB );
106
113
ImageContainerByITKImage
(
const
Point
&aPointA,
114
const
Point
&aPointB,
115
ITKImagePointer
&aRef);
116
120
~ImageContainerByITKImage
();
121
122
// ----------------------- Interface --------------------------------------
123
public
:
124
125
132
Value
operator()
(
const
Point
&aPoint)
const
;
133
140
Value
operator()
(
const
ConstIterator
&it)
const
;
141
148
Value
operator()
(
const
Iterator
&it)
const
;
149
150
157
void
setValue
(
const
Point
&aPoint,
const
Value
&aValue);
158
165
void
setValue
(
Iterator
&it,
const
Value
&V);
166
167
// ------------------------- methods ------------------------------
168
169
173
Domain
domain
()
const
174
{
175
return
Domain
(
myLowerBound
,
myUpperBound
);
176
}
177
182
Point
extent
()
const
183
{
184
return
myUpperBound
-
myLowerBound
;
185
}
186
187
191
ITKImagePointer
getImagePointer
()
const
192
{
193
return
myITKImagePointer
;
194
}
195
196
// ------------------------- stream ------------------------------
197
202
void
selfDisplay
( std::ostream & out )
const
;
203
208
bool
isValid
()
const
;
209
210
// ------------------------- Iterators ------------------------------
215
ConstIterator
begin
()
const
216
{
217
return
myConstItBegin
;
218
}
219
224
Iterator
begin
()
225
{
226
return
myItBegin
;
227
}
228
233
ConstIterator
begin
(
const
Point
&aPoint )
const
;
234
239
const
ConstIterator
end
()
const
240
{
241
return
myConstItEnd
;
242
}
243
248
Iterator
end
()
249
{
250
return
myItEnd
;
251
}
252
258
ConstIterator
end
(
const
Point
&aPoint)
const
;
259
260
// ------------------------- Private Datas --------------------------------
261
private
:
262
263
// ------------------------- Hidden services ------------------------------
264
protected
:
265
270
ImageContainerByITKImage
();
271
272
private
:
273
279
ImageContainerByITKImage
(
const
ImageContainerByITKImage
& other );
280
287
ImageContainerByITKImage
&
operator=
(
const
ImageContainerByITKImage
& other );
288
289
// ------------------------- Internals ------------------------------------
290
private
:
291
292
Point
myLowerBound
;
293
Point
myUpperBound
;
294
ITKImagePointer
myITKImagePointer
;
295
typename
ITKImage::RegionType
myRegion
;
296
ConstIterator
myConstItBegin
;
297
Iterator
myItBegin
;
298
ConstIterator
myConstItEnd
;
299
Iterator
myItEnd
;
300
301
};
// end of class ImageContainerByITKImage
302
303
}
304
311
template
<
typename
T,
typename
TV>
312
std::ostream&
313
operator<< ( std::ostream & out, const experimental::ImageContainerByITKImage<T, TV> & object );
314
315
}
317
// Includes inline functions.
318
#include "DGtal/images/ImageContainerByITKImage.ih"
319
320
//
322
323
#endif // !defined ImageContainerByITKImage_h
324
325
#undef ImageContainerByITKImage_RECURSES
326
#endif // else defined(ImageContainerByITKImage_RECURSES)
Generated on Wed Dec 19 2012 19:10:26 for DGtal by
1.8.1.1