ITK  5.4.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  * https://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 PixelType = TPixel;
82  using typename Superclass::SizeType;
83  using typename Superclass::OffsetType;
85 
87  itkOverrideGetNameOfClassMacro(AnnulusOperator);
88 
90  void
91  CreateOperator();
92 
95  void
96  SetInnerRadius(double r)
97  {
98  m_InnerRadius = r;
99  }
100  double
102  {
103  return m_InnerRadius;
104  }
110  void
111  SetThickness(double t)
112  {
113  m_Thickness = t;
114  }
115  double
116  GetThickness() const
117  {
118  return m_Thickness;
119  }
124  void
126  {
127  m_Spacing = s;
128  }
129  const SpacingType &
130  GetSpacing() const
131  {
132  return m_Spacing;
133  }
138  void
139  SetNormalize(bool b)
140  {
141  m_Normalize = b;
142  }
143  bool
144  GetNormalize() const
145  {
146  return m_Normalize;
147  }
148  void
150  {
151  this->SetNormalize(true);
152  }
153  void
155  {
156  this->SetNormalize(false);
157  }
162  void
164  {
165  m_BrightCenter = b;
166  }
167  bool
169  {
170  return m_BrightCenter;
171  }
172  void
174  {
175  this->SetBrightCenter(true);
176  }
177  void
179  {
180  this->SetBrightCenter(false);
181  }
188  void
190  {
191  m_InteriorValue = v;
192  }
193  TPixel
195  {
196  return m_InteriorValue;
197  }
198  void
199  SetAnnulusValue(TPixel v)
200  {
201  m_AnnulusValue = v;
202  }
203  TPixel
205  {
206  return m_AnnulusValue;
207  }
208  void
210  {
211  m_ExteriorValue = v;
212  }
213  TPixel
215  {
216  return m_ExteriorValue;
217  }
220  void
221  PrintSelf(std::ostream & os, Indent indent) const override
222  {
223  Superclass::PrintSelf(os, indent);
224 
225  os << indent << "InnerRadius: " << m_InnerRadius << std::endl;
226  os << indent << "Thickness: " << m_Thickness << std::endl;
227  os << indent << "Normalize: " << m_Normalize << std::endl;
228  os << indent << "BrightCenter: " << m_BrightCenter << std::endl;
229  os << indent << "InteriorValue: " << static_cast<typename NumericTraits<PixelType>::PrintType>(m_InteriorValue)
230  << std::endl;
231  os << indent << "AnnulusValue: " << static_cast<typename NumericTraits<PixelType>::PrintType>(m_AnnulusValue)
232  << std::endl;
233  os << indent << "ExteriorValue: " << static_cast<typename NumericTraits<PixelType>::PrintType>(m_ExteriorValue)
234  << std::endl;
235  os << indent << "Spacing: " << static_cast<typename NumericTraits<SpacingType>::PrintType>(m_Spacing) << std::endl;
236  }
237 
238 protected:
240  using typename Superclass::CoefficientVector;
241 
243  CoefficientVector
244  GenerateCoefficients() override;
245 
247  void
248  Fill(const CoefficientVector & coeff) override;
249 
250 private:
251  double m_InnerRadius{ 1.0 };
252  double m_Thickness{ 1.0 };
253  bool m_Normalize{ false };
254  bool m_BrightCenter{ false };
255  PixelType m_InteriorValue{};
257  PixelType m_ExteriorValue{};
258  SpacingType m_Spacing{ MakeFilled<SpacingType>(1.0) };
259 };
260 } // namespace itk
261 
262 #ifndef ITK_MANUAL_INSTANTIATION
263 # include "itkAnnulusOperator.hxx"
264 #endif
265 #endif
itk::AnnulusOperator::PixelType
TPixel PixelType
Definition: itkAnnulusOperator.h:81
itk::NeighborhoodOperator
Virtual class that defines a common interface to all neighborhood operator subtypes.
Definition: itkNeighborhoodOperator.h:72
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:125
itk::Vector< double, TDimension >
itk::AnnulusOperator::GetAnnulusValue
TPixel GetAnnulusValue() const
Definition: itkAnnulusOperator.h:204
itkNeighborhoodOperator.h
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::AnnulusOperator::GetInnerRadius
double GetInnerRadius() const
Definition: itkAnnulusOperator.h:101
itk::AnnulusOperator::GetBrightCenter
bool GetBrightCenter() const
Definition: itkAnnulusOperator.h:168
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::AnnulusOperator::BrightCenterOn
void BrightCenterOn()
Definition: itkAnnulusOperator.h:173
itk::AnnulusOperator::SetBrightCenter
void SetBrightCenter(bool b)
Definition: itkAnnulusOperator.h:163
itk::AnnulusOperator::SetInnerRadius
void SetInnerRadius(double r)
Definition: itkAnnulusOperator.h:96
itk::AnnulusOperator::NormalizeOn
void NormalizeOn()
Definition: itkAnnulusOperator.h:149
itk::AnnulusOperator::BrightCenterOff
void BrightCenterOff()
Definition: itkAnnulusOperator.h:178
itk::AnnulusOperator::NormalizeOff
void NormalizeOff()
Definition: itkAnnulusOperator.h:154
itk::AnnulusOperator::GetNormalize
bool GetNormalize() const
Definition: itkAnnulusOperator.h:144
itk::NumericTraits::OneValue
static T OneValue()
Definition: itkNumericTraits.h:157
itk::AnnulusOperator::GetInteriorValue
TPixel GetInteriorValue() const
Definition: itkAnnulusOperator.h:194
itk::AnnulusOperator::SetNormalize
void SetNormalize(bool b)
Definition: itkAnnulusOperator.h:139
itk::NumericTraits::PrintType
T PrintType
Definition: itkNumericTraits.h:69
itk::AnnulusOperator::SetExteriorValue
void SetExteriorValue(TPixel v)
Definition: itkAnnulusOperator.h:209
itk::NumericTraits
Define additional traits for native types such as int or float.
Definition: itkNumericTraits.h:59
itk::Offset
Represent a n-dimensional offset between two n-dimensional indexes of n-dimensional image.
Definition: itkOffset.h:69
itk::AnnulusOperator::GetThickness
double GetThickness() const
Definition: itkAnnulusOperator.h:116
itk::AnnulusOperator::SetThickness
void SetThickness(double t)
Definition: itkAnnulusOperator.h:111
itk::AnnulusOperator::GetSpacing
const SpacingType & GetSpacing() const
Definition: itkAnnulusOperator.h:130
itk::AnnulusOperator::GetExteriorValue
TPixel GetExteriorValue() const
Definition: itkAnnulusOperator.h:214
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:189
itk::AnnulusOperator::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
Definition: itkAnnulusOperator.h:221
itk::AnnulusOperator::SetAnnulusValue
void SetAnnulusValue(TPixel v)
Definition: itkAnnulusOperator.h:199