ITK  4.13.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 
81  TInputImage,
82  TSparseOutputImage > Superclass;
83 
86 
90 
92  itkNewMacro(Self);
93 
95  itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension);
96 
98  typedef typename Superclass::InputImageType InputImageType;
99  typedef typename Superclass::IndexType IndexType;
100  typedef typename Superclass::NodeDataType NormalVectorType;
101  typedef typename Superclass::NodeValueType NodeValueType;
102  typedef typename Superclass::FiniteDifferenceFunctionType
104 
105  typedef typename Superclass::SparseOutputImageType SparseOutputImageType;
106  typedef typename Superclass::OutputNodeType NormalBandNodeType;
107  typedef typename Superclass::NodeListType NodeListType;
108 
111 
115 
117  typedef typename FiniteDifferenceFunctionType::RadiusType 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:
138  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
139 
141  virtual void Initialize() ITK_OVERRIDE;
142 
144  void SetNormalBand();
145 
148  void InitializeNormalBandNode(NormalBandNodeType *node,
149  const InputImageIteratorType & it);
150 
153  virtual void CopyInputToOutput() ITK_OVERRIDE {}
154 
157  virtual bool Halt() ITK_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  virtual NormalVectorType DataConstraint(const NormalVectorType & data) const ITK_OVERRIDE
173  {
174  return ( data / ( m_MinVectorNorm + data.GetNorm() ) );
175  }
176 
180  virtual void PostProcessOutput() ITK_OVERRIDE;
181 
182 private:
183  ITK_DISALLOW_COPY_AND_ASSIGN(ImplicitManifoldNormalVectorFilter);
184 
186  NormalFunctionType *m_NormalFunction;
187 
189  unsigned int m_MaxIteration;
190 
193  NodeValueType m_IsoLevelLow, m_IsoLevelHigh;
194 
196  NodeValueType m_MinVectorNorm;
197 
199  bool m_UnsharpMaskingFlag;
200 
203  NodeValueType m_UnsharpMaskingWeight;
204 
206  unsigned long m_Indicator[itkGetStaticConstMacro(ImageDimension)];
207  unsigned int m_NumVertex;
208  NodeValueType m_DimConst;
209  NodeValueType m_DimConst2;
210  RadiusType m_ManifoldRadius;
211 };
212 } // end namespace itk
213 
214 #ifndef ITK_MANUAL_INSTANTIATION
215 #include "itkImplicitManifoldNormalVectorFilter.hxx"
216 #endif
217 
218 #endif
Light weight base class for most itk classes.
ConstNeighborhoodIterator< InputImageType > InputImageIteratorType
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...
FiniteDifferenceSparseImageFilter< TInputImage, TSparseOutputImage > Superclass
NormalVectorFunctionBase< SparseOutputImageType > NormalFunctionType
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
Superclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType
FiniteDifferenceFunctionType::RadiusType RadiusType
virtual NormalVectorType DataConstraint(const NormalVectorType &data) const override
This class implements a multi-threaded base class for Image to SparseImage finite difference processe...
Control indentation during Print() invocation.
Definition: itkIndent.h:49