ITK  5.2.0
Insight Toolkit
itkAnnulusOperator.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 {
71 template <typename TPixel, unsigned int TDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
72 class ITK_TEMPLATE_EXPORT AnnulusOperator : public NeighborhoodOperator<TPixel, TDimension, TAllocator>
73 {
74 public:
75 
79 
81  using SizeType = typename Superclass::SizeType;
84 
86 
89  void
90  CreateOperator();
91 
94  void
95  SetInnerRadius(double r)
96  {
97  m_InnerRadius = r;
98  }
99  double
101  {
102  return m_InnerRadius;
103  }
105 
109  void
110  SetThickness(double t)
111  {
112  m_Thickness = t;
113  }
114  double
115  GetThickness() const
116  {
117  return m_Thickness;
118  }
120 
123  void
125  {
126  m_Spacing = s;
127  }
128  const SpacingType &
129  GetSpacing() const
130  {
131  return m_Spacing;
132  }
134 
137  void
138  SetNormalize(bool b)
139  {
140  m_Normalize = b;
141  }
142  bool
143  GetNormalize() const
144  {
145  return m_Normalize;
146  }
147  void
149  {
150  this->SetNormalize(true);
151  }
152  void
154  {
155  this->SetNormalize(false);
156  }
158 
161  void
163  {
164  m_BrightCenter = b;
165  }
166  bool
168  {
169  return m_BrightCenter;
170  }
171  void
173  {
174  this->SetBrightCenter(true);
175  }
176  void
178  {
179  this->SetBrightCenter(false);
180  }
182 
187  void
189  {
190  m_InteriorValue = v;
191  }
192  TPixel
194  {
195  return m_InteriorValue;
196  }
197  void
198  SetAnnulusValue(TPixel v)
199  {
200  m_AnnulusValue = v;
201  }
202  TPixel
204  {
205  return m_AnnulusValue;
206  }
207  void
209  {
210  m_ExteriorValue = v;
211  }
212  TPixel
214  {
215  return m_ExteriorValue;
216  }
218 
220  void
221  PrintSelf(std::ostream & os, Indent i) const override
222  {
223  os << i << "AnnulusOperator { this=" << this << ", m_InnerRadius = " << m_InnerRadius
224  << ", m_Thickness = " << m_Thickness << ", m_Spacing = " << m_Spacing << ", m_Normalize = " << m_Normalize
225  << ", m_BrightCenter = " << m_BrightCenter << ", m_InteriorValue = " << m_InteriorValue
226  << ", m_ExteriorValue = " << m_ExteriorValue << "}" << std::endl;
227  Superclass::PrintSelf(os, i.GetNextIndent());
228  }
230 
231 protected:
235  using PixelType = typename Superclass::PixelType;
236 
239  GenerateCoefficients() override;
240 
242  void
243  Fill(const CoefficientVector & coeff) override;
244 
245 private:
246  double m_InnerRadius{ 1.0 };
247  double m_Thickness{ 1.0 };
248  bool m_Normalize{ false };
249  bool m_BrightCenter{ false };
253  SpacingType m_Spacing{ 1.0 };
254 };
255 } // namespace itk
256 
257 #ifndef ITK_MANUAL_INSTANTIATION
258 # include "itkAnnulusOperator.hxx"
259 #endif
260 #endif
itk::Indent::GetNextIndent
Indent GetNextIndent() const
itk::AnnulusOperator::PixelType
typename Superclass::PixelType PixelType
Definition: itkAnnulusOperator.h:235
itk::NeighborhoodOperator
Virtual class that defines a common interface to all neighborhood operator subtypes.
Definition: itkNeighborhoodOperator.h:72
itk::AnnulusOperator::OffsetType
typename Superclass::OffsetType OffsetType
Definition: itkAnnulusOperator.h:82
itk::AnnulusOperator
A NeighborhoodOperator for performing a matched filtering with an annulus (two concentric circles,...
Definition: itkAnnulusOperator.h:72
itk::AnnulusOperator::SetSpacing
void SetSpacing(SpacingType &s)
Definition: itkAnnulusOperator.h:124
itk::Vector< double, TDimension >
itk::AnnulusOperator::GetAnnulusValue
TPixel GetAnnulusValue() const
Definition: itkAnnulusOperator.h:203
itkNeighborhoodOperator.h
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::AnnulusOperator::GetInnerRadius
double GetInnerRadius() const
Definition: itkAnnulusOperator.h:100
itk::AnnulusOperator::GetBrightCenter
bool GetBrightCenter() const
Definition: itkAnnulusOperator.h:167
itk::AnnulusOperator::CoefficientVector
typename Superclass::CoefficientVector CoefficientVector
Definition: itkAnnulusOperator.h:234
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::AnnulusOperator::BrightCenterOn
void BrightCenterOn()
Definition: itkAnnulusOperator.h:172
itk::AnnulusOperator::SizeType
typename Superclass::SizeType SizeType
Definition: itkAnnulusOperator.h:81
itk::AnnulusOperator::SetBrightCenter
void SetBrightCenter(bool b)
Definition: itkAnnulusOperator.h:162
itk::AnnulusOperator::SetInnerRadius
void SetInnerRadius(double r)
Definition: itkAnnulusOperator.h:95
itk::AnnulusOperator::NormalizeOn
void NormalizeOn()
Definition: itkAnnulusOperator.h:148
itk::AnnulusOperator::BrightCenterOff
void BrightCenterOff()
Definition: itkAnnulusOperator.h:177
itk::AnnulusOperator::NormalizeOff
void NormalizeOff()
Definition: itkAnnulusOperator.h:153
itk::AnnulusOperator::GetNormalize
bool GetNormalize() const
Definition: itkAnnulusOperator.h:143
itk::NumericTraits::OneValue
static T OneValue()
Definition: itkNumericTraits.h:156
itk::AnnulusOperator::GetInteriorValue
TPixel GetInteriorValue() const
Definition: itkAnnulusOperator.h:193
itk::AnnulusOperator::SetNormalize
void SetNormalize(bool b)
Definition: itkAnnulusOperator.h:138
itk::AnnulusOperator::SetExteriorValue
void SetExteriorValue(TPixel v)
Definition: itkAnnulusOperator.h:208
itk::AnnulusOperator::PrintSelf
void PrintSelf(std::ostream &os, Indent i) const override
Definition: itkAnnulusOperator.h:221
itk::Offset
Represent a n-dimensional offset between two n-dimensional indexes of n-dimensional image.
Definition: itkOffset.h:67
itk::AnnulusOperator::GetThickness
double GetThickness() const
Definition: itkAnnulusOperator.h:115
itk::AnnulusOperator::SetThickness
void SetThickness(double t)
Definition: itkAnnulusOperator.h:110
itk::NumericTraits::ZeroValue
static T ZeroValue()
Definition: itkNumericTraits.h:148
itk::AnnulusOperator::GetSpacing
const SpacingType & GetSpacing() const
Definition: itkAnnulusOperator.h:129
itk::AnnulusOperator::GetExteriorValue
TPixel GetExteriorValue() const
Definition: itkAnnulusOperator.h:213
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itkVector.h
itk::AnnulusOperator::SetInteriorValue
void SetInteriorValue(TPixel v)
Definition: itkAnnulusOperator.h:188
itk::AnnulusOperator::SetAnnulusValue
void SetAnnulusValue(TPixel v)
Definition: itkAnnulusOperator.h:198
itk::NeighborhoodOperator< TPixel, TDimension, TAllocator >::CoefficientVector
std::vector< PixelRealType > CoefficientVector
Definition: itkNeighborhoodOperator.h:148