ITK  4.8.0
Insight Segmentation and Registration Toolkit
itkAnnulusOperator.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkAnnulusOperator_h
19 #define itkAnnulusOperator_h
20 
22 #include "itkVector.h"
23 
24 namespace itk
25 {
68 template< typename TPixel, unsigned int TDimension = 2,
69  typename TAllocator = NeighborhoodAllocator< TPixel > >
71  public NeighborhoodOperator< TPixel, TDimension, TAllocator >
72 {
73 public:
74 
78 
80  typedef typename Superclass::SizeType SizeType;
83 
85 
87  NeighborhoodOperator< TPixel, TDimension, TAllocator >(),
88  m_InnerRadius(1.0),
89  m_Thickness( 1.0 ),
90  m_Normalize(false),
91  m_BrightCenter(false),
92  m_InteriorValue(NumericTraits< PixelType >::ZeroValue()),
93  m_AnnulusValue(NumericTraits< PixelType >::OneValue()),
94  m_ExteriorValue(NumericTraits< PixelType >::ZeroValue()),
95  m_Spacing( 1.0 )
96  {}
97 
98  AnnulusOperator(const Self & other):
99  NeighborhoodOperator< TPixel, TDimension, TAllocator >(other),
100  m_InnerRadius( other.m_InnerRadius ),
101  m_Thickness( other.m_Thickness ),
102  m_Normalize( other.m_Normalize ),
107  m_Spacing( other.m_Spacing )
108  {
109  }
110 
113  void CreateOperator();
114 
117  void SetInnerRadius(double r)
118  { m_InnerRadius = r; }
119  double GetInnerRadius() const
120  { return m_InnerRadius; }
122 
126  void SetThickness(double t)
127  { m_Thickness = t; }
128  double GetThickness() const
129  { return m_Thickness; }
131 
135  { m_Spacing = s; }
136  const SpacingType & GetSpacing() const
137  { return m_Spacing; }
139 
142  void SetNormalize(bool b)
143  { m_Normalize = b; }
144  bool GetNormalize() const
145  { return m_Normalize; }
146  void NormalizeOn()
147  { this->SetNormalize(true); }
149  { this->SetNormalize(false); }
151 
154  void SetBrightCenter(bool b)
155  { m_BrightCenter = b; }
156  bool GetBrightCenter() const
157  { return m_BrightCenter; }
159  { this->SetBrightCenter(true); }
161  { this->SetBrightCenter(false); }
163 
168  void SetInteriorValue(TPixel v)
169  { m_InteriorValue = v; }
170  TPixel GetInteriorValue() const
171  { return m_InteriorValue; }
172  void SetAnnulusValue(TPixel v)
173  { m_AnnulusValue = v; }
174  TPixel GetAnnulusValue() const
175  { return m_AnnulusValue; }
176  void SetExteriorValue(TPixel v)
177  { m_ExteriorValue = v; }
178  TPixel GetExteriorValue() const
179  { return m_ExteriorValue; }
181 
183  Self & operator=(const Self & other)
184  {
185  if(this != &other)
186  {
187  Superclass::operator=(other);
189  m_Thickness = other.m_Thickness;
190  m_Spacing = other.m_Spacing;
194  m_Normalize = other.m_Normalize;
196  }
197  return *this;
198  }
200 
202  virtual void PrintSelf(std::ostream & os, Indent i) const ITK_OVERRIDE
203  {
204  os << i << "AnnulusOperator { this=" << this
205  << ", m_InnerRadius = " << m_InnerRadius
206  << ", m_Thickness = " << m_Thickness
207  << ", m_Spacing = " << m_Spacing
208  << ", m_Normalize = " << m_Normalize
209  << ", m_BrightCenter = " << m_BrightCenter
210  << ", m_InteriorValue = " << m_InteriorValue
211  << ", m_ExteriorValue = " << m_ExteriorValue
212  << "}" << std::endl;
213  Superclass::PrintSelf( os, i.GetNextIndent() );
214  }
216 
217 protected:
218 
223 
226 
228  void Fill(const CoefficientVector & c) ITK_OVERRIDE;
229 
230 private:
231 
233  double m_Thickness;
240 };
241 } // namespace itk
242 
243 #ifndef ITK_MANUAL_INSTANTIATION
244 #include "itkAnnulusOperator.hxx"
245 #endif
246 #endif
void Fill(const CoefficientVector &c) override
void SetExteriorValue(TPixel v)
TPixel GetExteriorValue() const
A NeighborhoodOperator for performing a matched filtering with an annulus (two concentric circles...
void SetThickness(double t)
virtual void PrintSelf(std::ostream &os, Indent i) const override
CoefficientVector GenerateCoefficients() override
A memory allocator for use as the default allocator type in Neighborhood.
TPixel GetInteriorValue() const
Superclass::CoefficientVector CoefficientVector
Superclass::OffsetType OffsetType
TPixel GetAnnulusValue() const
void SetAnnulusValue(TPixel v)
Virtual class that defines a common interface to all neighborhood operator subtypes.
Self & operator=(const Self &other)
void SetInteriorValue(TPixel v)
double GetInnerRadius() const
Superclass::PixelType PixelType
bool GetBrightCenter() const
NeighborhoodOperator< TPixel, TDimension, TAllocator > Superclass
double GetThickness() const
virtual void PrintSelf(std::ostream &os, Indent i) const override
Control indentation during Print() invocation.
Definition: itkIndent.h:49
void SetSpacing(SpacingType &s)
Define additional traits for native types such as int or float.
Vector< double, TDimension > SpacingType
Superclass::SizeType SizeType
AnnulusOperator(const Self &other)
const SpacingType & GetSpacing() const
void SetInnerRadius(double r)