ITK  6.0.0
Insight Toolkit
itkImplicitManifoldNormalVectorFilter.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 itkImplicitManifoldNormalVectorFilter_h
19#define itkImplicitManifoldNormalVectorFilter_h
20
24#include "itkVector.h"
25
26namespace itk
27{
72template <typename TInputImage, typename TSparseOutputImage>
73class ITK_TEMPLATE_EXPORT ImplicitManifoldNormalVectorFilter
74 : public FiniteDifferenceSparseImageFilter<TInputImage, TSparseOutputImage>
75{
76public:
77 ITK_DISALLOW_COPY_AND_MOVE(ImplicitManifoldNormalVectorFilter);
78
82
85
87 itkOverrideGetNameOfClassMacro(ImplicitManifoldNormalVectorFilter);
88
90 itkNewMacro(Self);
91
93 static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
94
96 using typename Superclass::InputImageType;
97 using typename Superclass::IndexType;
98 using NormalVectorType = typename Superclass::NodeDataType;
99 using typename Superclass::NodeValueType;
100 using typename Superclass::FiniteDifferenceFunctionType;
101
102 using typename Superclass::SparseOutputImageType;
103 using NormalBandNodeType = typename Superclass::OutputNodeType;
104 using typename Superclass::NodeListType;
105
108
112
115
117 void
119
120 itkSetMacro(MaxIteration, unsigned int);
121 itkGetConstMacro(MaxIteration, unsigned int);
122 itkSetMacro(IsoLevelLow, NodeValueType);
123 itkGetConstMacro(IsoLevelLow, NodeValueType);
124 itkSetMacro(IsoLevelHigh, NodeValueType);
125 itkGetConstMacro(IsoLevelHigh, NodeValueType);
126 itkSetMacro(MinVectorNorm, NodeValueType);
127 itkGetConstMacro(MinVectorNorm, NodeValueType);
128 itkSetMacro(UnsharpMaskingFlag, bool);
129 itkGetConstMacro(UnsharpMaskingFlag, bool);
130 itkSetMacro(UnsharpMaskingWeight, NodeValueType);
131 itkGetConstMacro(UnsharpMaskingWeight, NodeValueType);
132
133protected:
136 void
137 PrintSelf(std::ostream & os, Indent indent) const override;
138
140 void
141 Initialize() override;
142
144 void
146
149 void
151
154 void
156 {}
157
160 bool
161 Halt() override
162 {
163 if (this->GetElapsedIterations() == m_MaxIteration)
164 {
165 return true;
166 }
167 else
168 {
169 return false;
170 }
171 }
174protected:
176 NormalVectorType
177 DataConstraint(const NormalVectorType & data) const override
178 {
179 return (data / (m_MinVectorNorm + data.GetNorm()));
180 }
181
185 void
187
188private:
190 NormalFunctionType * m_NormalFunction{};
191
193 unsigned int m_MaxIteration{};
194
197 NodeValueType m_IsoLevelLow, m_IsoLevelHigh{};
198
200 NodeValueType m_MinVectorNorm{};
201
203 bool m_UnsharpMaskingFlag{};
204
207 NodeValueType m_UnsharpMaskingWeight{};
208
210 unsigned long m_Indicator[Self::ImageDimension]{};
211 unsigned int m_NumVertex{};
212 NodeValueType m_DimConst{};
213 NodeValueType m_DimConst2{};
214 RadiusType m_ManifoldRadius{};
215};
216} // end namespace itk
217
218#ifndef ITK_MANUAL_INSTANTIATION
219# include "itkImplicitManifoldNormalVectorFilter.hxx"
220#endif
221
222#endif
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
typename ConstNeighborhoodIterator< TImageType >::RadiusType RadiusType
This class implements a multi-threaded base class for Image to SparseImage finite difference processe...
This class implements the filter for computing the normal vectors from a scalar implicit function (i....
void InitializeNormalBandNode(NormalBandNodeType *node, const InputImageIteratorType &it)
typename FiniteDifferenceFunctionType::RadiusType RadiusType
NormalVectorType DataConstraint(const NormalVectorType &data) const override
void SetNormalFunction(NormalFunctionType *nf)
~ImplicitManifoldNormalVectorFilter() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
This class defines the common functionality for Sparse Image neighborhoods of unit vectors.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....