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
132
135
137
142 static Self
144
146 static Self
147 Ball(RadiusType radius, bool radiusIsParametric = false);
148
150 static Self
152
154 static Self
155 Annulus(RadiusType radius, unsigned int thickness = 1, bool includeCenter = false, bool radiusIsParametric = false);
156
162 static Self
163 Polygon(RadiusType radius, unsigned int lines);
164
171 [[nodiscard]] bool
173 {
174 return m_Decomposable;
175 }
176 void
178 {
179 m_Decomposable = v;
180 }
181
184 [[nodiscard]] const DecompType &
185 GetLines() const
186 {
187 return m_Lines;
188 }
189 void
191 {
192 m_Lines.push_back(l);
193 }
194
195 [[nodiscard]] bool
196 CheckParallel(LType NewVec) const;
197
202 void
204
211 [[nodiscard]] bool
213 {
215 }
216 void
218 {
220 }
221 itkBooleanMacro(RadiusIsParametric);
225 static Self
226 FromImage(const ImageType * image);
227
228protected:
229 void
230 PrintSelf(std::ostream & os, Indent indent) const override;
231
232private:
234
236
237 template <unsigned int VDimension3>
242 using FacetType = StructuringElementFacet<VDimension>;
243
244 template <typename TStructuringElement, typename TRadius>
245 static void
246 GeneratePolygon(TStructuringElement & res, TRadius radius, unsigned int lines);
247 static void
249 static void
251
253
255 using FacetType3 = StructuringElementFacet<3>;
256
258
261 static RadiusType
262 CheckImageSize(const ImageType * image);
263};
264} // namespace itk
265
266#ifndef ITK_MANUAL_INSTANTIATION
267# include "itkFlatStructuringElement.hxx"
268#endif
269
270#endif
A class to support a variety of flat structuring elements, including versions created by decompositio...
FlatStructuringElement(FlatStructuringElement &&)=default
bool CheckParallel(LType NewVec) const
FlatStructuringElement & operator=(FlatStructuringElement &&)=default
static void GeneratePolygon(itk::FlatStructuringElement< 3 > &res, itk::Size< 3 > radius, unsigned int lines)
FlatStructuringElement(const FlatStructuringElement &)=default
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
FlatStructuringElement & operator=(const FlatStructuringElement &)=default
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)
Templated n-dimensional image class.
Definition itkImage.h:89
Control indentation during Print() invocation.
Definition itkIndent.h:51
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