00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkCurvatureAnisotropicDiffusionImageFilter.h,v $ 00005 Language: C++ 00006 Date: $Date: 2003/09/10 14:28:46 $ 00007 Version: $Revision: 1.29 $ 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 __itkCurvatureAnisotropicDiffusionImageFilter_h_ 00018 #define __itkCurvatureAnisotropicDiffusionImageFilter_h_ 00019 00020 #include "itkAnisotropicDiffusionImageFilter.h" 00021 #include "itkCurvatureNDAnisotropicDiffusionFunction.h" 00022 #include "itkMacro.h" 00023 namespace itk { 00024 00054 template <class TInputImage, class TOutputImage> 00055 class ITK_EXPORT CurvatureAnisotropicDiffusionImageFilter 00056 : public AnisotropicDiffusionImageFilter<TInputImage, TOutputImage> 00057 { 00058 public: 00060 typedef CurvatureAnisotropicDiffusionImageFilter Self; 00061 typedef AnisotropicDiffusionImageFilter<TInputImage, TOutputImage> 00062 Superclass; 00063 typedef SmartPointer<Self> Pointer; 00064 typedef SmartPointer<const Self> ConstPointer; 00065 00067 itkNewMacro(Self); 00068 00070 itkTypeMacro(CurvatureAnisotropicDiffusionImageFilter, 00071 AnisotropicDiffusionImageFilter); 00072 00074 typedef typename Superclass::UpdateBufferType UpdateBufferType; 00075 00077 itkStaticConstMacro(ImageDimension, unsigned int, 00078 Superclass::ImageDimension); 00079 00080 protected: 00081 CurvatureAnisotropicDiffusionImageFilter() 00082 { 00083 typename CurvatureNDAnisotropicDiffusionFunction<UpdateBufferType>::Pointer q 00084 = CurvatureNDAnisotropicDiffusionFunction<UpdateBufferType>::New(); 00085 this->SetDifferenceFunction(q); 00086 } 00087 ~CurvatureAnisotropicDiffusionImageFilter() {} 00088 00089 virtual void InitializeIteration() 00090 { 00091 Superclass::InitializeIteration(); 00092 if (this->GetTimeStep() > 0.5 / pow(2.0, static_cast<double>(ImageDimension)) ) 00093 { 00094 itkWarningMacro(<< "Anisotropic diffusion is using a time step which may introduce instability into the solution." ); 00095 } 00096 } 00097 00098 private: 00099 CurvatureAnisotropicDiffusionImageFilter(const Self&); //purposely not implemented 00100 void operator=(const Self&); //purposely not implemented 00101 00102 }; 00103 00104 } // end namspace itk 00105 00106 #endif