ITK  5.3.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 PixelType = TPixel;
82  using SizeType = typename Superclass::SizeType;
85 
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  }
106 
110  void
111  SetThickness(double t)
112  {
113  m_Thickness = t;
114  }
115  double
116  GetThickness() const
117  {
118  return m_Thickness;
119  }
121 
124  void
126  {
127  m_Spacing = s;
128  }
129  const SpacingType &
130  GetSpacing() const
131  {
132  return m_Spacing;
133  }
135 
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  }
159 
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  }
183 
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  }
219 
221  void
222  PrintSelf(std::ostream & os, Indent i) const override
223  {
224  os << i << "AnnulusOperator { this=" << this << ", m_InnerRadius = " << m_InnerRadius
225  << ", m_Thickness = " << m_Thickness << ", m_Spacing = " << m_Spacing << ", m_Normalize = " << m_Normalize
226  << ", m_BrightCenter = " << m_BrightCenter << ", m_InteriorValue = " << m_InteriorValue
227  << ", m_ExteriorValue = " << m_ExteriorValue << "}" << std::endl;
228  Superclass::PrintSelf(os, i.GetNextIndent());
229  }
231 
232 protected:
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
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::OffsetType
typename Superclass::OffsetType OffsetType
Definition: itkAnnulusOperator.h:83
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::AnnulusOperator::CoefficientVector
typename Superclass::CoefficientVector CoefficientVector
Definition: itkAnnulusOperator.h:235
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::AnnulusOperator::BrightCenterOn
void BrightCenterOn()
Definition: itkAnnulusOperator.h:173
itk::AnnulusOperator::SizeType
typename Superclass::SizeType SizeType
Definition: itkAnnulusOperator.h:82
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:156
itk::AnnulusOperator::GetInteriorValue
TPixel GetInteriorValue() const
Definition: itkAnnulusOperator.h:194
itk::AnnulusOperator::SetNormalize
void SetNormalize(bool b)
Definition: itkAnnulusOperator.h:139
itk::AnnulusOperator::SetExteriorValue
void SetExteriorValue(TPixel v)
Definition: itkAnnulusOperator.h:209
itk::AnnulusOperator::PrintSelf
void PrintSelf(std::ostream &os, Indent i) const override
Definition: itkAnnulusOperator.h:222
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:116
itk::AnnulusOperator::SetThickness
void SetThickness(double t)
Definition: itkAnnulusOperator.h:111
itk::NumericTraits::ZeroValue
static T ZeroValue()
Definition: itkNumericTraits.h:148
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::SetAnnulusValue
void SetAnnulusValue(TPixel v)
Definition: itkAnnulusOperator.h:199
itk::NeighborhoodOperator< TPixel, TDimension, TAllocator >::CoefficientVector
std::vector< PixelRealType > CoefficientVector
Definition: itkNeighborhoodOperator.h:148