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: 2009-05-12 17:22:49 $
00007   Version:   $Revision: 1.6 $
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 ITK_EXPORT ImplicitManifoldNormalVectorFilter  
00072   : public FiniteDifferenceSparseImageFilter <TInputImage, TSparseOutputImage>
00073 {
00074 public:  
00075 
00077   typedef ImplicitManifoldNormalVectorFilter Self;
00078   typedef FiniteDifferenceSparseImageFilter <
00079     TInputImage,
00080     TSparseOutputImage>                      Superclass;
00081   typedef SmartPointer<Self>                 Pointer;
00082   typedef SmartPointer<const Self>           ConstPointer;
00083 
00085   itkTypeMacro(ImplicitManifoldNormalVectorFilter,
00086                FiniteDifferenceSparseImageFilter);
00087 
00089   itkNewMacro(Self);
00090 
00092   itkStaticConstMacro(ImageDimension, unsigned int,Superclass::ImageDimension);
00093 
00095   typedef typename Superclass::InputImageType  InputImageType;
00096   typedef typename Superclass::IndexType       IndexType;
00097   typedef typename Superclass::NodeDataType    NormalVectorType;
00098   typedef typename Superclass::NodeValueType   NodeValueType;
00099   typedef typename Superclass::FiniteDifferenceFunctionType
00100                                                FiniteDifferenceFunctionType;
00101 
00102   typedef typename Superclass::SparseOutputImageType SparseOutputImageType;
00103   typedef typename Superclass::OutputNodeType        NormalBandNodeType;
00104   typedef typename Superclass::NodeListType          NodeListType;
00105   
00107   typedef ConstNeighborhoodIterator <InputImageType> InputImageIteratorType;
00108 
00111   typedef NormalVectorFunctionBase <SparseOutputImageType> NormalFunctionType;
00112 
00114   typedef typename FiniteDifferenceFunctionType::RadiusType RadiusType;
00115 
00117   void SetNormalFunction( NormalFunctionType *nf );  
00118 
00119   itkSetMacro(MaxIteration, unsigned int);
00120   itkGetConstMacro(MaxIteration, unsigned int);
00121   itkSetMacro(IsoLevelLow,  NodeValueType);
00122   itkGetConstMacro(IsoLevelLow,  NodeValueType);
00123   itkSetMacro(IsoLevelHigh, NodeValueType);
00124   itkGetConstMacro(IsoLevelHigh, NodeValueType);
00125   itkSetMacro(MinVectorNorm, NodeValueType);
00126   itkGetConstMacro(MinVectorNorm, NodeValueType);
00127   itkSetMacro(UnsharpMaskingFlag, bool);
00128   itkGetConstMacro(UnsharpMaskingFlag, bool);
00129   itkSetMacro(UnsharpMaskingWeight, NodeValueType);
00130   itkGetConstMacro(UnsharpMaskingWeight, NodeValueType);
00131  
00132 protected:   
00133   ImplicitManifoldNormalVectorFilter();  
00134   ~ImplicitManifoldNormalVectorFilter() {};
00135   void PrintSelf(std::ostream& os, Indent indent) const;
00136 
00138   virtual void Initialize();
00139 
00141   void SetNormalBand();
00142 
00145   void InitializeNormalBandNode( NormalBandNodeType *node,
00146                                  const InputImageIteratorType &it );
00147 
00150   virtual void CopyInputToOutput() {};
00151 
00154   virtual bool Halt()
00155     {
00156     if (this->GetElapsedIterations() == m_MaxIteration)
00157       {
00158       return true;
00159       }
00160     else
00161       {
00162       return false;
00163       }
00164     }
00165 protected:
00166 
00168   virtual NormalVectorType DataConstraint( const NormalVectorType &data ) const 
00169     {
00170     return (data / (m_MinVectorNorm + data.GetNorm()));
00171     }
00172 
00176   virtual void PostProcessOutput();
00177 
00178 private:
00179   ImplicitManifoldNormalVectorFilter(const Self&); //purposely not implemented
00180   void operator=(const Self&); //purposely not implemented
00181     
00183   NormalFunctionType *m_NormalFunction;
00184 
00186   unsigned int m_MaxIteration;
00187 
00190   NodeValueType m_IsoLevelLow, m_IsoLevelHigh;
00191 
00193   NodeValueType m_MinVectorNorm;
00194 
00196   bool m_UnsharpMaskingFlag;
00197 
00200   NodeValueType m_UnsharpMaskingWeight;
00201 
00203   unsigned long m_Indicator[itkGetStaticConstMacro(ImageDimension)];
00204   unsigned int  m_NumVertex;
00205   NodeValueType m_DimConst;
00206   NodeValueType m_DimConst2;
00207   RadiusType    m_ManifoldRadius;
00208 
00209 };
00210 
00211 }// end namespace itk
00212 
00213 #ifndef ITK_MANUAL_INSTANTIATION
00214 #include "itkImplicitManifoldNormalVectorFilter.txx"
00215 #endif
00216 
00217 #endif
00218 

Generated at Mon Jul 12 2010 18:49:01 for ITK by doxygen 1.7.1 written by Dimitri van Heesch, © 1997-2000