Orfeo Toolbox  3.16
itkNarrowBand.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkNarrowBand.h,v $
5  Language: C++
6  Date: $Date: 2009-06-19 19:47:57 $
7  Version: $Revision: 1.8 $
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 __itkNarrowBand_h
18 #define __itkNarrowBand_h
19 
20 #include "itkLightObject.h"
21 #include "itkObjectFactory.h"
22 #include <vector>
23 
24 namespace itk {
31 template <class TIndexType, class TDataType>
32 class BandNode
33 {
34 public:
35  TDataType m_Data;
36  TIndexType m_Index;
37  signed char m_NodeState;
38  BandNode() { m_NodeState = 0; }
39 };
40 
41 
43 template <class NodeType>
45 {
46 public:
48  typedef NarrowBand Self;
52 
54  itkNewMacro(Self);
55 
57  itkTypeMacro(NarrowBand, LightObject);
58 
59  typedef std::vector<NodeType> NodeContainerType;
60  typedef typename NodeContainerType::size_type SizeType;
61  typedef typename NodeContainerType::const_iterator ConstIterator;
62  typedef typename NodeContainerType::iterator Iterator;
63 
66  typedef struct RegionStruct
67  {
70  } RegionType;
71 
74 #if !defined(CABLE_CONFIGURATION)
75  std::vector<RegionType> SplitBand( unsigned int );
76 #endif
77 
78  Iterator Begin()
79  {
80  return m_NodeContainer.begin();
81  }
82  ConstIterator Begin() const
83  {
84  return m_NodeContainer.begin();
85  }
86  Iterator End()
87  {
88  return m_NodeContainer.end();
89  }
90  ConstIterator End() const
91  {
92  return m_NodeContainer.end();
93  }
94 
95  SizeType Size() const
96  {
97  return m_NodeContainer.size();
98  }
99  bool Empty() const
100  {
101  return m_NodeContainer.empty();
102  }
103 
105  void Clear()
106  {
107  m_NodeContainer.clear();
108  }
109  void Reserve( SizeType n)
110  {
111  m_NodeContainer.reserve( n );
112  }
113  void PushBack( const NodeType &n)
114  {
115  m_NodeContainer.push_back(n);
116  }
117  void PopBack()
118  {
119  m_NodeContainer.pop_back();
120  }
121  void Resize( SizeType n )
122  {
123  m_NodeContainer.resize(n);
124  }
125 
126  NodeType &operator[]( SizeType n )
127  {
128  return m_NodeContainer[n];
129  }
130  const NodeType& operator[](SizeType n) const
131  {
132  return m_NodeContainer[n];
133  }
134 
138  void SetTotalRadius(float val) { m_TotalRadius = val;}
139 
140  float GetTotalRadius(){return m_TotalRadius;}
141 
144  void SetInnerRadius(float val) { m_InnerRadius = val;}
145 
146  float GetInnerRadius() { return m_InnerRadius;}
147 
148 
149 protected:
150  NarrowBand() {m_TotalRadius = 0.0; m_InnerRadius = 0.0;}
153 
154 private:
155  NarrowBand(const Self&); //purposely not implemented
156  void operator=(const Self&); //purposely not implemented
158 
159 };
160 
161 } // end namespace itk
162 
163 #ifndef ITK_MANUAL_INSTANTIATION
164 #include "itkNarrowBand.txx"
165 #endif
166 
167 #endif

Generated at Sat Feb 2 2013 23:54:59 for Orfeo Toolbox with doxygen 1.8.1.1