Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkImplicitManifoldNormalVectorFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkImplicitManifoldNormalVectorFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2003/09/10 14:28:50 $
00007   Version:   $Revision: 1.3 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016      =========================================================================*/
00017 #ifndef __itkImplicitManifoldNormalVectorFilter_h_
00018 #define __itkImplicitManifoldNormalVectorFilter_h_
00019 
00020 #include "itkConstNeighborhoodIterator.h"
00021 #include "itkNormalVectorFunctionBase.h"
00022 #include "itkFiniteDifferenceSparseImageFilter.h"
00023 #include "itkVector.h"
00024 
00025 namespace itk {
00026 
00070 template <class TInputImage, class TSparseOutputImage>
00071 class ImplicitManifoldNormalVectorFilter  
00072   : public FiniteDifferenceSparseImageFilter <TInputImage, TSparseOutputImage>
00073 {
00074 public:  
00075 
00077   typedef ImplicitManifoldNormalVectorFilter Self;
00078   typedef FiniteDifferenceSparseImageFilter <TInputImage,
00079                                              TSparseOutputImage> Superclass;
00080   typedef SmartPointer<Self>  Pointer;
00081   typedef SmartPointer<const Self>  ConstPointer;
00082 
00084   itkTypeMacro(ImplicitManifoldNormalVectorFilter,
00085                FiniteDifferenceSparseImageFilter);
00086 
00088   itkNewMacro(Self);
00089 
00091   itkStaticConstMacro(ImageDimension, unsigned int,Superclass::ImageDimension);
00092 
00094   typedef typename Superclass::InputImageType  InputImageType;
00095   typedef typename Superclass::IndexType       IndexType;
00096   typedef typename Superclass::NodeDataType    NormalVectorType;
00097   typedef typename Superclass::NodeValueType   NodeValueType;
00098   typedef typename Superclass::FiniteDifferenceFunctionType
00099   FiniteDifferenceFunctionType;
00100   typedef typename Superclass::SparseOutputImageType SparseOutputImageType;
00101   typedef typename Superclass::OutputNodeType NormalBandNodeType;
00102   typedef typename Superclass::NodeListType NodeListType;
00103 
00105   typedef ConstNeighborhoodIterator <InputImageType> InputImageIteratorType;
00106 
00109   typedef NormalVectorFunctionBase <SparseOutputImageType> NormalFunctionType;
00110 
00112   typedef typename FiniteDifferenceFunctionType::RadiusType RadiusType;    
00113 
00115   void SetNormalFunction( NormalFunctionType *nf );  
00116 
00117   itkSetMacro(MaxIteration, unsigned int);
00118   itkGetMacro(MaxIteration, unsigned int);
00119   itkSetMacro(IsoLevelLow,  NodeValueType);
00120   itkGetMacro(IsoLevelLow,  NodeValueType);
00121   itkSetMacro(IsoLevelHigh, NodeValueType);
00122   itkGetMacro(IsoLevelHigh, NodeValueType);
00123   itkSetMacro(MinVectorNorm, NodeValueType);
00124   itkGetMacro(MinVectorNorm, NodeValueType);
00125   itkSetMacro(UnsharpMaskingFlag, bool);
00126   itkGetMacro(UnsharpMaskingFlag, bool);
00127   itkSetMacro(UnsharpMaskingWeight, NodeValueType);
00128   itkGetMacro(UnsharpMaskingWeight, NodeValueType);
00129  
00130 protected:   
00131   ImplicitManifoldNormalVectorFilter();  
00132   ~ImplicitManifoldNormalVectorFilter() {};
00133   void PrintSelf(std::ostream& os, Indent indent) const;
00134 
00136   virtual void Initialize();
00137 
00139   void SetNormalBand();
00140 
00142   void InitializeNormalBandNode( NormalBandNodeType *node,
00143                                  const InputImageIteratorType &it );
00144 
00147   virtual void CopyInputToOutput() {};
00148 
00149 private:
00150   ImplicitManifoldNormalVectorFilter(const Self&); //purposely not implemented
00151   void operator=(const Self&); //purposely not implemented
00152     
00154   NormalFunctionType *m_NormalFunction;
00155 
00157   unsigned int m_MaxIteration;
00158 
00161   NodeValueType m_IsoLevelLow, m_IsoLevelHigh;
00162 
00164   NodeValueType m_MinVectorNorm;
00165 
00167   bool m_UnsharpMaskingFlag;
00168 
00171   NodeValueType m_UnsharpMaskingWeight;
00172 
00174   unsigned long m_Indicator [itkGetStaticConstMacro(ImageDimension)];
00175   unsigned int  m_NumVertex;
00176   NodeValueType m_DimConst, m_DimConst2;
00177   RadiusType    m_ManifoldRadius;
00178 
00179 protected:
00181   virtual NormalVectorType DataConstraint( const NormalVectorType &data ) const 
00182   {
00183     return (data / (m_MinVectorNorm + data.GetNorm()));
00184   }
00185 
00189   virtual void PostProcessOutput();
00190 
00191 public:
00194   virtual bool Halt()
00195   {
00196     if (this->GetElapsedIterations()==m_MaxIteration) return true;
00197     else return false;
00198   }
00199 };
00201 
00202 }// end namespace itk
00203 
00204 #ifndef ITK_MANUAL_INSTANTIATION
00205 #include "itkImplicitManifoldNormalVectorFilter.txx"
00206 #endif
00207 
00208 #endif
00209 

Generated at Sun Sep 23 13:13:07 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000