ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
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#include "itkPrintHelper.h"
24
25namespace itk
26{
72template <typename TPixel, unsigned int TDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
73class ITK_TEMPLATE_EXPORT AnnulusOperator : public NeighborhoodOperator<TPixel, TDimension, TAllocator>
74{
75public:
79
81 using PixelType = TPixel;
82 using typename Superclass::SizeType;
83 using typename Superclass::OffsetType;
85
87 itkOverrideGetNameOfClassMacro(AnnulusOperator);
88
90 void
92
96 void
98 {
99 m_InnerRadius = r;
100 }
101 [[nodiscard]] double
103 {
104 return m_InnerRadius;
105 }
106
111 void
112 SetThickness(double t)
113 {
114 m_Thickness = t;
115 }
116 [[nodiscard]] double
118 {
119 return m_Thickness;
120 }
121
125 void
127 {
128 m_Spacing = s;
129 }
130 [[nodiscard]] const SpacingType &
132 {
133 return m_Spacing;
134 }
135
139 void
141 {
142 m_Normalize = b;
143 }
144 [[nodiscard]] bool
146 {
147 return m_Normalize;
148 }
149 void
151 {
152 this->SetNormalize(true);
153 }
154 void
156 {
157 this->SetNormalize(false);
158 }
159
163 void
165 {
166 m_BrightCenter = b;
167 }
168 [[nodiscard]] bool
170 {
171 return m_BrightCenter;
172 }
173 void
175 {
176 this->SetBrightCenter(true);
177 }
178 void
180 {
181 this->SetBrightCenter(false);
182 }
183
189 void
191 {
192 m_InteriorValue = v;
193 }
194 [[nodiscard]] TPixel
196 {
197 return m_InteriorValue;
198 }
199 void
201 {
202 m_AnnulusValue = v;
203 }
204 [[nodiscard]] TPixel
206 {
207 return m_AnnulusValue;
208 }
209 void
211 {
212 m_ExteriorValue = v;
213 }
214 [[nodiscard]] TPixel
216 {
217 return m_ExteriorValue;
218 }
219
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 print_helper::PrintNumericTrait(os, indent, "InteriorValue", m_InteriorValue);
230 print_helper::PrintNumericTrait(os, indent, "AnnulusValue", m_AnnulusValue);
231 print_helper::PrintNumericTrait(os, indent, "ExteriorValue", m_ExteriorValue);
232 print_helper::PrintNumericTrait(os, indent, "Spacing", m_Spacing);
233 }
234
235protected:
237 using typename Superclass::CoefficientVector;
238
240 CoefficientVector
242
244 void
245 Fill(const CoefficientVector & coeff) override;
246
247private:
248 double m_InnerRadius{ 1.0 };
249 double m_Thickness{ 1.0 };
250 bool m_Normalize{ false };
251 bool m_BrightCenter{ false };
256};
257} // namespace itk
258
259#ifndef ITK_MANUAL_INSTANTIATION
260# include "itkAnnulusOperator.hxx"
261#endif
262#endif
A NeighborhoodOperator for performing a matched filtering with an annulus (two concentric circles,...
const SpacingType & GetSpacing() const
Vector< double, TDimension > SpacingType
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
NeighborhoodOperator< TPixel, TDimension, TAllocator > Superclass
typename std::vector< PixelRealType > CoefficientVector
Control indentation during Print() invocation.
Definition itkIndent.h:51
Virtual class that defines a common interface to all neighborhood operator subtypes.
void PrintSelf(std::ostream &os, Indent indent) const override
A templated class holding a n-Dimensional vector.
Definition itkVector.h:63
void PrintNumericTrait(std::ostream &os, const Indent &indent, const char *name, const T &value)
Print "<name>: <value>\n" indented, matching ITK's PrintSelf style.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
constexpr TContainer MakeFilled(typename TContainer::const_reference value)