Orfeo Toolbox  3.16
itkLabelObjectUtils.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkLabelObject.h,v $
5  Language: C++
6  Date: $Date: 2005/01/21 20:13:31 $
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 __itkLabelObjectUtils_h
18 #define __itkLabelObjectUtils_h
19 
20 #include <deque>
21 #include <itkLightObject.h>
22 #include "itkLabelMap.h"
23 #include "itkLabelObjectLine.h"
24 
25 namespace itk
26 {
27 
28 
29 namespace Functor {
30 
31 template< class TLabelObject >
32 class ITK_EXPORT LabelLabelObjectAccessor
33 {
34 public:
35  typedef TLabelObject LabelObjectType;
36  typedef typename LabelObjectType::LabelType AttributeValueType;
37 
38  inline const AttributeValueType operator()( const LabelObjectType * labelObject )
39  {
40  return labelObject->GetLabel();
41  }
42 };
43 
44 template< class TLabelObject >
45 class ITK_EXPORT NumberOfLinesLabelObjectAccessor
46 {
47 public:
48  typedef TLabelObject LabelObjectType;
49  typedef int AttributeValueType;
50 
51  inline const AttributeValueType operator()( const LabelObjectType * labelObject )
52  {
53  return labelObject->GetNumberOfLines();
54  }
55 };
56 
57 template< class TLabelObject, class TAttributeAccessor >
58 class LabelObjectComparator
59 {
60 public:
61  typedef TLabelObject LabelObjectType;
62  typedef TAttributeAccessor AttributeAccessorType;
63  bool operator()( const LabelObjectType * a, const LabelObjectType * b )
64  {
65  return accessor( a ) > accessor( b );
66  }
67 private:
69 };
70 
71 template< class TLabelObject, class TAttributeAccessor >
73 {
74 public:
75  typedef TLabelObject LabelObjectType;
76  typedef TAttributeAccessor AttributeAccessorType;
77  bool operator()( const LabelObjectType * a, const LabelObjectType * b )
78  {
79  return accessor( a ) < accessor( b );
80  }
81 private:
83 };
84 
85 }
86 
87 } // end namespace itk
88 
89 #endif

Generated at Sat Feb 2 2013 23:49:36 for Orfeo Toolbox with doxygen 1.8.1.1