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
24namespace itk
25{
71template <typename TPixel, unsigned int TDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
72class ITK_TEMPLATE_EXPORT AnnulusOperator : public NeighborhoodOperator<TPixel, TDimension, TAllocator>
73{
74public:
75
79
81 using PixelType = TPixel;
82 using typename Superclass::SizeType;
83 using typename Superclass::OffsetType;
85
87 itkOverrideGetNameOfClassMacro(AnnulusOperator);
88
90 void
92
95 void
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
117 {
118 return m_Thickness;
119 }
124 void
126 {
127 m_Spacing = s;
128 }
129 const SpacingType &
131 {
132 return m_Spacing;
133 }
138 void
140 {
141 m_Normalize = b;
142 }
143 bool
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
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
238protected:
240 using typename Superclass::CoefficientVector;
241
243 CoefficientVector
245
247 void
248 Fill(const CoefficientVector & coeff) override;
249
250private:
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
A NeighborhoodOperator for performing a matched filtering with an annulus (two concentric circles,...
const SpacingType & GetSpacing() const
double GetThickness() const
void PrintSelf(std::ostream &os, Indent indent) const override
void SetSpacing(SpacingType &s)
CoefficientVector GenerateCoefficients() override
TPixel GetInteriorValue() const
void SetExteriorValue(TPixel v)
void Fill(const CoefficientVector &coeff) override
TPixel GetAnnulusValue() const
void SetInnerRadius(double r)
void SetAnnulusValue(TPixel v)
void SetInteriorValue(TPixel v)
TPixel GetExteriorValue() const
double GetInnerRadius() const
typename std::vector< PixelRealType > CoefficientVector
void SetThickness(double t)
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Virtual class that defines a common interface to all neighborhood operator subtypes.
Define additional traits for native types such as int or float.
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:63
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....