ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkFlatStructuringElement.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 itkFlatStructuringElement_h
19#define itkFlatStructuringElement_h
20
21#include "itkNeighborhood.h"
22#include <vector>
23#include "itkVector.h"
24#include "itkImage.h"
25
26namespace itk
27{
86
87template <unsigned int VDimension>
88class ITK_TEMPLATE_EXPORT FlatStructuringElement : public Neighborhood<bool, VDimension>
89{
90public:
94
96 using typename Superclass::PixelType;
97
101 using typename Superclass::Iterator;
102 using typename Superclass::ConstIterator;
103
105 using typename Superclass::SizeType;
106 using typename Superclass::OffsetType;
107
109 using typename Superclass::RadiusType;
110
112 using typename Superclass::SliceIteratorType;
113
115 static constexpr unsigned int NeighborhoodDimension = VDimension;
116
118 using DecompType = std::vector<LType>;
119
122
124 ~FlatStructuringElement() override = default;
125
128 {
129 m_Decomposable = false;
130 m_RadiusIsParametric = false;
131 }
132
134
139 static Self
141
143 static Self
144 Ball(RadiusType radius, bool radiusIsParametric = false);
145
147 static Self
149
151 static Self
152 Annulus(RadiusType radius, unsigned int thickness = 1, bool includeCenter = false, bool radiusIsParametric = false);
153
159 static Self
160 Polygon(RadiusType radius, unsigned int lines);
161
167 bool
169 {
170 return m_Decomposable;
171 }
172 void
174 {
175 m_Decomposable = v;
176 }
177
178
180 const DecompType &
181 GetLines() const
182 {
183 return (m_Lines);
184 }
185 void
187 {
188 m_Lines.push_back(l);
189 }
190
191
192 bool
193 CheckParallel(LType NewVec) const;
194
199 void
201
207 bool
209 {
211 }
212 void
214 {
216 }
217 itkBooleanMacro(RadiusIsParametric);
219
222 static Self
223 FromImage(const ImageType * image);
224
225protected:
226 void
227 PrintSelf(std::ostream & os, Indent indent) const override;
228
229private:
231
233
234 template <unsigned int VDimension3>
239 using FacetType = StructuringElementFacet<VDimension>;
240
241 template <typename TStructuringElement, typename TRadius>
242 static void
243 GeneratePolygon(TStructuringElement & res, TRadius radius, unsigned int lines);
244 static void
246 static void
248
250
252 using FacetType3 = StructuringElementFacet<3>;
253
255
258 static RadiusType
259 CheckImageSize(const ImageType * image);
260};
261} // namespace itk
262
263#ifndef ITK_MANUAL_INSTANTIATION
264# include "itkFlatStructuringElement.hxx"
265#endif
266
267#endif
A class to support a variety of flat structuring elements, including versions created by decompositio...
bool CheckParallel(LType NewVec) const
static void GeneratePolygon(itk::FlatStructuringElement< 3 > &res, itk::Size< 3 > radius, unsigned int lines)
static void GeneratePolygon(itk::FlatStructuringElement< 2 > &res, itk::Size< 2 > radius, unsigned int lines)
static RadiusType CheckImageSize(const ImageType *image)
void PrintSelf(std::ostream &os, Indent indent) const override
static Self Cross(RadiusType radius)
static void GeneratePolygon(TStructuringElement &res, TRadius radius, unsigned int lines)
const DecompType & GetLines() const
~FlatStructuringElement() override=default
static Self FromImage(const ImageType *image)
static Self Ball(RadiusType radius, bool radiusIsParametric=false)
static Self Polygon(RadiusType radius, unsigned int lines)
static Self Annulus(RadiusType radius, unsigned int thickness=1, bool includeCenter=false, bool radiusIsParametric=false)
static Self Box(RadiusType radius)
typename itk::Image< PixelType, VDimension > ImageType
Templated n-dimensional image class.
Definition itkImage.h:89
Control indentation during Print() invocation.
Definition itkIndent.h:50
typename AllocatorType::iterator Iterator
SliceIterator< bool, Self > SliceIteratorType
typename AllocatorType::const_iterator ConstIterator
A templated class holding a n-Dimensional vector.
Definition itkVector.h:63
AddImageFilter Self
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Represent a n-dimensional size (bounds) of a n-dimensional image.
Definition itkSize.h:70