ITK  4.2.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 protected:
137  void PrintSelf(std::ostream & os, Indent indent) const;
138 
140  virtual void Initialize();
141 
143  void SetNormalBand();
144 
147  void InitializeNormalBandNode(NormalBandNodeType *node,
148  const InputImageIteratorType & it);
149 
152  virtual void CopyInputToOutput() {}
153 
156  virtual bool Halt()
157  {
158  if ( this->GetElapsedIterations() == m_MaxIteration )
159  {
160  return true;
161  }
162  else
163  {
164  return false;
165  }
166  }
168 
169 protected:
171  virtual NormalVectorType DataConstraint(const NormalVectorType & data) const
172  {
173  return ( data / ( m_MinVectorNorm + data.GetNorm() ) );
174  }
175 
179  virtual void PostProcessOutput();
180 
181 private:
182  ImplicitManifoldNormalVectorFilter(const Self &); //purposely not implemented
183  void operator=(const Self &); //purposely not implemented
184 
187 
189  unsigned int m_MaxIteration;
190 
193  NodeValueType m_IsoLevelLow, m_IsoLevelHigh;
194 
197 
200 
204 
206  unsigned long m_Indicator[itkGetStaticConstMacro(ImageDimension)];
207  unsigned int m_NumVertex;
211 };
212 } // end namespace itk
213 
214 #ifndef ITK_MANUAL_INSTANTIATION
215 #include "itkImplicitManifoldNormalVectorFilter.hxx"
216 #endif
217 
218 #endif
219