Orfeo Toolbox  3.16
itkAnnulusOperator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkAnnulusOperator.h,v $
5  Language: C++
6  Date: $Date: 2008-01-07 13:33:59 $
7  Version: $Revision: 1.10 $
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 
18 #ifndef __itkAnnulusOperator_h
19 #define __itkAnnulusOperator_h
20 
21 #include "itkExceptionObject.h"
23 #include "itkVector.h"
24 
25 namespace itk {
26 
68 template<class TPixel, unsigned int TDimension=2,
69  class TAllocator = NeighborhoodAllocator<TPixel> >
71  : public NeighborhoodOperator<TPixel, TDimension, TAllocator>
72 {
73 public:
77 
79  typedef typename Superclass::SizeType SizeType;
83 
85 
87  : NeighborhoodOperator<TPixel, TDimension, TAllocator>(),
88  m_Normalize(false), m_BrightCenter(false),
89  m_InteriorValue(NumericTraits<PixelType>::Zero),
90  m_AnnulusValue(NumericTraits<PixelType>::One),
91  m_ExteriorValue(NumericTraits<PixelType>::Zero)
92  { m_Spacing.Fill(1.0); }
93 
94  AnnulusOperator(const Self& other)
95  : NeighborhoodOperator<TPixel, TDimension, TAllocator>(other)
96  {
97  m_InnerRadius = other.m_InnerRadius;
98  m_Thickness = other.m_Thickness;
99  m_Spacing = other.m_Spacing;
100  m_InteriorValue = other.m_InteriorValue;
101  m_AnnulusValue = other.m_AnnulusValue;
102  m_ExteriorValue = other.m_ExteriorValue;
103  m_Normalize = other.m_Normalize;
104  m_BrightCenter = other.m_BrightCenter;
105  }
106 
109  void CreateOperator();
110 
113  void SetInnerRadius(double r)
114  { m_InnerRadius = r; }
115  double GetInnerRadius() const
116  { return m_InnerRadius; }
117 
121  void SetThickness(double t)
122  { m_Thickness = t; }
123  double GetThickness() const
124  { return m_Thickness; }
125 
128  void SetSpacing(SpacingType &s)
129  { m_Spacing = s; }
130  const SpacingType& GetSpacing() const
131  { return m_Spacing; }
132 
135  void SetNormalize(bool b)
136  { m_Normalize = b; }
137  bool GetNormalize() const
138  { return m_Normalize; }
139  void NormalizeOn()
140  { this->SetNormalize(true); }
141  void NormalizeOff()
142  { this->SetNormalize(false); }
143 
146  void SetBrightCenter(bool b)
147  { m_BrightCenter = b; }
148  bool GetBrightCenter() const
149  { return m_BrightCenter; }
150  void BrightCenterOn()
151  { this->SetBrightCenter(true); }
152  void BrightCenterOff()
153  { this->SetBrightCenter(false); }
154 
159  void SetInteriorValue(TPixel v)
160  { m_InteriorValue = v; }
161  TPixel GetInteriorValue() const
162  { return m_InteriorValue; }
163  void SetAnnulusValue(TPixel v)
164  { m_AnnulusValue = v; }
165  TPixel GetAnnulusValue() const
166  { return m_AnnulusValue; }
167  void SetExteriorValue(TPixel v)
168  { m_ExteriorValue = v; }
169  TPixel GetExteriorValue() const
170  { return m_ExteriorValue; }
171 
173  Self &operator=(const Self& other)
174  {
175  Superclass::operator=(other);
176  m_InnerRadius = other.m_InnerRadius;
177  m_Thickness = other.m_Thickness;
178  m_Spacing = other.m_Spacing;
179  m_InteriorValue = other.m_InteriorValue;
180  m_AnnulusValue = other.m_AnnulusValue;
181  m_ExteriorValue = other.m_ExteriorValue;
182  m_Normalize = other.m_Normalize;
183  m_BrightCenter = other.m_BrightCenter;
184  return *this;
185  }
186 
188  virtual void PrintSelf(std::ostream &os, Indent i) const
189  {
190  os << i << "AnnulusOperator { this=" << this
191  << ", m_InnerRadius = " << m_InnerRadius
192  << ", m_Thickness = " << m_Thickness
193  << ", m_Spacing = " << m_Spacing
194  << ", m_Normalize = " << m_Normalize
195  << ", m_BrightCenter = " << m_BrightCenter
196  << ", m_InteriorValue = " << m_InteriorValue
197  << ", m_ExteriorValue = " << m_ExteriorValue
198  << "}" << std::endl;
199  Superclass::PrintSelf(os, i.GetNextIndent());
200  }
201 
202 protected:
203 
208 
210  CoefficientVector GenerateCoefficients();
211 
213  void Fill(const CoefficientVector &c);
214 
215 private:
216 
218  double m_Thickness;
225 };
226 
227 } // namespace itk
228 
229 
230 // Define instantiation macro for this template.
231 #define ITK_TEMPLATE_AnnulusOperator(_, EXPORT, x, y) namespace itk { \
232  _(2(class EXPORT AnnulusOperator< ITK_TEMPLATE_2 x >)) \
233  namespace Templates { typedef AnnulusOperator< ITK_TEMPLATE_2 x > \
234  AnnulusOperator##y; } \
235  }
236 
237 #if ITK_TEMPLATE_EXPLICIT
238 # include "Templates/itkAnnulusOperator+-.h"
239 #endif
240 
241 #if ITK_TEMPLATE_TXX
242 # include "itkAnnulusOperator.txx"
243 #endif
244 
245 #endif

Generated at Sat Feb 2 2013 23:24:02 for Orfeo Toolbox with doxygen 1.8.1.1