ITK  4.3.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< class TInputImage, class TSparseOutputImage >
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;
139 
141  virtual void Initialize();
142 
144  void SetNormalBand();
145 
148  void InitializeNormalBandNode(NormalBandNodeType *node,
149  const InputImageIteratorType & it);
150 
153  virtual void CopyInputToOutput() {}
154 
157  virtual bool Halt()
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
173  {
174  return ( data / ( m_MinVectorNorm + data.GetNorm() ) );
175  }
176 
180  virtual void PostProcessOutput();
181 
182 private:
183  ImplicitManifoldNormalVectorFilter(const Self &); //purposely not implemented
184  void operator=(const Self &); //purposely not implemented
185 
188 
190  unsigned int m_MaxIteration;
191 
194  NodeValueType m_IsoLevelLow, m_IsoLevelHigh;
195 
198 
201 
205 
207  unsigned long m_Indicator[itkGetStaticConstMacro(ImageDimension)];
208  unsigned int m_NumVertex;
212 };
213 } // end namespace itk
214 
215 #ifndef ITK_MANUAL_INSTANTIATION
216 #include "itkImplicitManifoldNormalVectorFilter.hxx"
217 #endif
218 
219 #endif
220