ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkImplicitManifoldNormalVectorFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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_ASSIGN(ImplicitManifoldNormalVectorFilter);
78 
82  TInputImage,
83  TSparseOutputImage >;
84 
87 
91 
93  itkNewMacro(Self);
94 
96  static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
97 
99  using InputImageType = typename Superclass::InputImageType;
101  using NormalVectorType = typename Superclass::NodeDataType;
102  using NodeValueType = typename Superclass::NodeValueType;
103  using FiniteDifferenceFunctionType = typename Superclass::FiniteDifferenceFunctionType;
104 
105  using SparseOutputImageType = typename Superclass::SparseOutputImageType;
106  using NormalBandNodeType = typename Superclass::OutputNodeType;
107  using NodeListType = typename Superclass::NodeListType;
108 
111 
115 
117  using RadiusType = typename FiniteDifferenceFunctionType::RadiusType;
118 
120  void SetNormalFunction(NormalFunctionType *nf);
121 
122  itkSetMacro(MaxIteration, unsigned int);
123  itkGetConstMacro(MaxIteration, unsigned int);
124  itkSetMacro(IsoLevelLow, NodeValueType);
125  itkGetConstMacro(IsoLevelLow, NodeValueType);
126  itkSetMacro(IsoLevelHigh, NodeValueType);
127  itkGetConstMacro(IsoLevelHigh, NodeValueType);
128  itkSetMacro(MinVectorNorm, NodeValueType);
129  itkGetConstMacro(MinVectorNorm, NodeValueType);
130  itkSetMacro(UnsharpMaskingFlag, bool);
131  itkGetConstMacro(UnsharpMaskingFlag, bool);
132  itkSetMacro(UnsharpMaskingWeight, NodeValueType);
133  itkGetConstMacro(UnsharpMaskingWeight, NodeValueType);
134 
135 protected:
137  ~ImplicitManifoldNormalVectorFilter() override = default;
138  void PrintSelf(std::ostream & os, Indent indent) const override;
139 
141  void Initialize() override;
142 
144  void SetNormalBand();
145 
148  void InitializeNormalBandNode(NormalBandNodeType *node,
149  const InputImageIteratorType & it);
150 
153  void CopyInputToOutput() override {}
154 
157  bool Halt() override
158  {
159  if ( this->GetElapsedIterations() == m_MaxIteration )
160  {
161  return true;
162  }
163  else
164  {
165  return false;
166  }
167  }
169 
170 protected:
172  NormalVectorType DataConstraint(const NormalVectorType & data) const override
173  {
174  return ( data / ( m_MinVectorNorm + data.GetNorm() ) );
175  }
176 
180  void PostProcessOutput() override;
181 
182 private:
185 
187  unsigned int m_MaxIteration;
188 
191  NodeValueType m_IsoLevelLow, m_IsoLevelHigh;
192 
195 
198 
202 
204  unsigned long m_Indicator[Self::ImageDimension];
205  unsigned int m_NumVertex;
209 };
210 } // end namespace itk
211 
212 #ifndef ITK_MANUAL_INSTANTIATION
213 #include "itkImplicitManifoldNormalVectorFilter.hxx"
214 #endif
215 
216 #endif
Light weight base class for most itk classes.
typename Superclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType
This class defines the common functionality for Sparse Image neighborhoods of unit vectors...
This class implements the filter for computing the normal vectors from a scalar implicit function (i...
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
NormalVectorType DataConstraint(const NormalVectorType &data) const override
This class implements a multi-threaded base class for Image to SparseImage finite difference processe...
typename Superclass::SparseOutputImageType SparseOutputImageType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename FiniteDifferenceFunctionType::RadiusType RadiusType