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
130
135 static Self
137
139 static Self
140 Ball(RadiusType radius, bool radiusIsParametric = false);
141
143 static Self
145
147 static Self
148 Annulus(RadiusType radius, unsigned int thickness = 1, bool includeCenter = false, bool radiusIsParametric = false);
149
155 static Self
156 Polygon(RadiusType radius, unsigned int lines);
157
164 [[nodiscard]] bool
166 {
167 return m_Decomposable;
168 }
169 void
171 {
172 m_Decomposable = v;
173 }
174
177 [[nodiscard]] const DecompType &
178 GetLines() const
179 {
180 return (m_Lines);
181 }
182 void
184 {
185 m_Lines.push_back(l);
186 }
187
188 [[nodiscard]] bool
189 CheckParallel(LType NewVec) const;
190
195 void
197
204 [[nodiscard]] bool
206 {
208 }
209 void
211 {
213 }
214 itkBooleanMacro(RadiusIsParametric);
218 static Self
219 FromImage(const ImageType * image);
220
221protected:
222 void
223 PrintSelf(std::ostream & os, Indent indent) const override;
224
225private:
227
229
230 template <unsigned int VDimension3>
235 using FacetType = StructuringElementFacet<VDimension>;
236
237 template <typename TStructuringElement, typename TRadius>
238 static void
239 GeneratePolygon(TStructuringElement & res, TRadius radius, unsigned int lines);
240 static void
242 static void
244
246
248 using FacetType3 = StructuringElementFacet<3>;
249
251
254 static RadiusType
255 CheckImageSize(const ImageType * image);
256};
257} // namespace itk
258
259#ifndef ITK_MANUAL_INSTANTIATION
260# include "itkFlatStructuringElement.hxx"
261#endif
262
263#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
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