Orfeo Toolbox
3.16
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
OTB
Utilities
ITK
Code
Review
itkLabelObjectAccessors.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: Insight Segmentation & Registration Toolkit
4
Module: $RCSfile: itkLabelObjectAccessors.h,v $
5
Language: C++
6
Date: $Date: 2009-08-12 12:57:42 $
7
Version: $Revision: 1.6 $
8
9
Copyright (c) Insight Software Consortium. All rights reserved.
10
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11
12
This software is distributed WITHOUT ANY WARRANTY; without even
13
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14
PURPOSE. See the above copyright notices for more information.
15
16
=========================================================================*/
17
#ifndef __itkLabelObjectAccessors_h
18
#define __itkLabelObjectAccessors_h
19
20
21
namespace
itk
22
{
23
24
25
namespace
Functor
26
{
27
28
template
<
class
TLabelObject >
29
class
ITK_EXPORT
LabelLabelObjectAccessor
30
{
31
public
:
32
typedef
TLabelObject
LabelObjectType
;
33
typedef
typename
LabelObjectType::LabelType
AttributeValueType
;
34
35
inline
AttributeValueType
operator()(
const
LabelObjectType
* labelObject )
const
36
{
37
return
labelObject->GetLabel();
38
}
39
};
40
41
template
<
class
TLabelObject >
42
class
ITK_EXPORT
NumberOfLinesLabelObjectAccessor
43
{
44
public
:
45
typedef
TLabelObject
LabelObjectType
;
46
typedef
int
AttributeValueType
;
47
48
inline
AttributeValueType
operator()(
const
LabelObjectType
* labelObject )
const
49
{
50
return
labelObject->GetNumberOfLines();
51
}
52
};
53
54
template
<
class
TLabelObject,
class
TAttributeAccessor >
55
class
LabelObjectComparator
56
{
57
public
:
58
typedef
TLabelObject
LabelObjectType
;
59
typedef
TAttributeAccessor
AttributeAccessorType
;
60
bool
operator()
(
const
LabelObjectType
* a,
const
LabelObjectType
* b )
const
61
{
62
return
m_Accessor
( a ) >
m_Accessor
( b );
63
}
64
LabelObjectComparator
() {}
65
LabelObjectComparator
(
LabelObjectComparator
const
& from)
66
{
67
m_Accessor
= from.
m_Accessor
;
68
}
69
private
:
70
AttributeAccessorType
m_Accessor
;
71
};
72
73
template
<
class
TLabelObject,
class
TAttributeAccessor >
74
class
LabelObjectReverseComparator
75
{
76
public
:
77
typedef
TLabelObject
LabelObjectType
;
78
typedef
TAttributeAccessor
AttributeAccessorType
;
79
bool
operator()
(
const
LabelObjectType
* a,
const
LabelObjectType
* b )
const
80
{
81
return
m_Accessor
( a ) <
m_Accessor
( b );
82
}
83
84
LabelObjectReverseComparator
() {}
85
LabelObjectReverseComparator
(
LabelObjectReverseComparator
const
& from)
86
{
87
m_Accessor
= from.
m_Accessor
;
88
}
89
private
:
90
AttributeAccessorType
m_Accessor
;
91
};
92
93
}
94
95
96
}
// end namespace itk
97
98
#endif
Generated at Sat Feb 2 2013 23:49:36 for
Orfeo Toolbox
with
doxygen 1.8.1.1