ITK  5.2.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  * http://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 
26 namespace itk
27 {
72 template <typename TInputImage, typename TSparseOutputImage>
73 class ITK_TEMPLATE_EXPORT ImplicitManifoldNormalVectorFilter
74  : public FiniteDifferenceSparseImageFilter<TInputImage, TSparseOutputImage>
75 {
76 public:
77  ITK_DISALLOW_COPY_AND_MOVE(ImplicitManifoldNormalVectorFilter);
78 
82 
85 
88 
90  itkNewMacro(Self);
91 
93  static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
94 
96  using InputImageType = typename Superclass::InputImageType;
97  using IndexType = typename Superclass::IndexType;
98  using NormalVectorType = typename Superclass::NodeDataType;
99  using NodeValueType = typename Superclass::NodeValueType;
100  using FiniteDifferenceFunctionType = typename Superclass::FiniteDifferenceFunctionType;
101 
102  using SparseOutputImageType = typename Superclass::SparseOutputImageType;
103  using NormalBandNodeType = typename Superclass::OutputNodeType;
104  using NodeListType = typename Superclass::NodeListType;
105 
108 
112 
114  using RadiusType = typename FiniteDifferenceFunctionType::RadiusType;
115 
117  void
118  SetNormalFunction(NormalFunctionType * nf);
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 
133 protected:
135  ~ImplicitManifoldNormalVectorFilter() override = default;
136  void
137  PrintSelf(std::ostream & os, Indent indent) const override;
138 
140  void
141  Initialize() override;
142 
144  void
145  SetNormalBand();
146 
149  void
150  InitializeNormalBandNode(NormalBandNodeType * node, const InputImageIteratorType & it);
151 
154  void
155  CopyInputToOutput() override
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  }
173 
174 protected:
176  NormalVectorType
177  DataConstraint(const NormalVectorType & data) const override
178  {
179  return (data / (m_MinVectorNorm + data.GetNorm()));
180  }
181 
185  void
186  PostProcessOutput() override;
187 
188 private:
191 
193  unsigned int m_MaxIteration;
194 
197  NodeValueType m_IsoLevelLow, m_IsoLevelHigh;
198 
201 
204 
208 
210  unsigned long m_Indicator[Self::ImageDimension];
211  unsigned int m_NumVertex;
215 };
216 } // end namespace itk
217 
218 #ifndef ITK_MANUAL_INSTANTIATION
219 # include "itkImplicitManifoldNormalVectorFilter.hxx"
220 #endif
221 
222 #endif
itk::ImplicitManifoldNormalVectorFilter::m_MinVectorNorm
NodeValueType m_MinVectorNorm
Definition: itkImplicitManifoldNormalVectorFilter.h:200
itk::ImplicitManifoldNormalVectorFilter::m_MaxIteration
unsigned int m_MaxIteration
Definition: itkImplicitManifoldNormalVectorFilter.h:193
itkConstNeighborhoodIterator.h
itkFiniteDifferenceSparseImageFilter.h
itkNormalVectorFunctionBase.h
itk::ImplicitManifoldNormalVectorFilter::m_NormalFunction
NormalFunctionType * m_NormalFunction
Definition: itkImplicitManifoldNormalVectorFilter.h:190
itk::ImplicitManifoldNormalVectorFilter::m_UnsharpMaskingFlag
bool m_UnsharpMaskingFlag
Definition: itkImplicitManifoldNormalVectorFilter.h:203
itk::ImplicitManifoldNormalVectorFilter::IndexType
typename Superclass::IndexType IndexType
Definition: itkImplicitManifoldNormalVectorFilter.h:97
itk::ImplicitManifoldNormalVectorFilter::m_UnsharpMaskingWeight
NodeValueType m_UnsharpMaskingWeight
Definition: itkImplicitManifoldNormalVectorFilter.h:207
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ImplicitManifoldNormalVectorFilter::m_DimConst
NodeValueType m_DimConst
Definition: itkImplicitManifoldNormalVectorFilter.h:212
itk::NormalVectorFunctionBase
This class defines the common functionality for Sparse Image neighborhoods of unit vectors.
Definition: itkNormalVectorFunctionBase.h:52
itk::ImplicitManifoldNormalVectorFilter::m_NumVertex
unsigned int m_NumVertex
Definition: itkImplicitManifoldNormalVectorFilter.h:211
itk::ImplicitManifoldNormalVectorFilter::NormalVectorType
typename Superclass::NodeDataType NormalVectorType
Definition: itkImplicitManifoldNormalVectorFilter.h:98
itk::ImplicitManifoldNormalVectorFilter::m_IsoLevelLow
NodeValueType m_IsoLevelLow
Definition: itkImplicitManifoldNormalVectorFilter.h:197
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::ImplicitManifoldNormalVectorFilter::m_DimConst2
NodeValueType m_DimConst2
Definition: itkImplicitManifoldNormalVectorFilter.h:213
itk::ImplicitManifoldNormalVectorFilter::m_ManifoldRadius
RadiusType m_ManifoldRadius
Definition: itkImplicitManifoldNormalVectorFilter.h:214
itk::ImplicitManifoldNormalVectorFilter::CopyInputToOutput
void CopyInputToOutput() override
Definition: itkImplicitManifoldNormalVectorFilter.h:155
itk::ImplicitManifoldNormalVectorFilter::NodeListType
typename Superclass::NodeListType NodeListType
Definition: itkImplicitManifoldNormalVectorFilter.h:104
itk::ImplicitManifoldNormalVectorFilter::NodeValueType
typename Superclass::NodeValueType NodeValueType
Definition: itkImplicitManifoldNormalVectorFilter.h:99
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ImplicitManifoldNormalVectorFilter::InputImageType
typename Superclass::InputImageType InputImageType
Definition: itkImplicitManifoldNormalVectorFilter.h:96
itk::ConstNeighborhoodIterator
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
Definition: itkConstNeighborhoodIterator.h:51
itk::ImplicitManifoldNormalVectorFilter::SparseOutputImageType
typename Superclass::SparseOutputImageType SparseOutputImageType
Definition: itkImplicitManifoldNormalVectorFilter.h:102
itkVector.h
itk::ImplicitManifoldNormalVectorFilter::DataConstraint
NormalVectorType DataConstraint(const NormalVectorType &data) const override
Definition: itkImplicitManifoldNormalVectorFilter.h:177
itk::ImplicitManifoldNormalVectorFilter::NormalBandNodeType
typename Superclass::OutputNodeType NormalBandNodeType
Definition: itkImplicitManifoldNormalVectorFilter.h:103
itk::ImplicitManifoldNormalVectorFilter::Halt
bool Halt() override
Definition: itkImplicitManifoldNormalVectorFilter.h:161
itk::FiniteDifferenceSparseImageFilter
This class implements a multi-threaded base class for Image to SparseImage finite difference processe...
Definition: itkFiniteDifferenceSparseImageFilter.h:63
itk::ImplicitManifoldNormalVectorFilter
This class implements the filter for computing the normal vectors from a scalar implicit function (i....
Definition: itkImplicitManifoldNormalVectorFilter.h:73
itk::ImplicitManifoldNormalVectorFilter::FiniteDifferenceFunctionType
typename Superclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType
Definition: itkImplicitManifoldNormalVectorFilter.h:100
itk::ImplicitManifoldNormalVectorFilter::RadiusType
typename FiniteDifferenceFunctionType::RadiusType RadiusType
Definition: itkImplicitManifoldNormalVectorFilter.h:114