00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkBSplineDerivativeKernelFunction.h,v $ 00005 Language: C++ 00006 Date: $Date: 2007/01/25 23:18:05 $ 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 __itkBSplineDerivativeKernelFunction_h 00018 #define __itkBSplineDerivativeKernelFunction_h 00019 00020 #include "itkKernelFunction.h" 00021 #include "itkBSplineKernelFunction.h" 00022 00023 namespace itk 00024 { 00025 00041 template <unsigned int VSplineOrder = 3> 00042 class ITK_EXPORT BSplineDerivativeKernelFunction : public KernelFunction 00043 { 00044 public: 00046 typedef BSplineDerivativeKernelFunction Self; 00047 typedef KernelFunction Superclass; 00048 typedef SmartPointer<Self> Pointer; 00049 00051 itkNewMacro(Self); 00052 00054 itkTypeMacro(BSplineDerivativeKernelFunction, KernelFunction); 00055 00057 itkStaticConstMacro(SplineOrder, unsigned int, VSplineOrder); 00058 00060 inline double Evaluate( const double & u ) const 00061 { 00062 return ( m_KernelFunction->Evaluate( u + 0.5 ) - 00063 m_KernelFunction->Evaluate( u - 0.5 ) ); 00064 } 00065 00066 protected: 00067 00068 typedef BSplineKernelFunction<itkGetStaticConstMacro(SplineOrder) - 1> 00069 KernelType; 00070 00071 BSplineDerivativeKernelFunction() 00072 { 00073 m_KernelFunction = KernelType::New(); 00074 } 00075 00076 ~BSplineDerivativeKernelFunction(){}; 00077 void PrintSelf(std::ostream& os, Indent indent) const 00078 { 00079 Superclass::PrintSelf( os, indent ); 00080 os << indent << "Spline Order: " << SplineOrder << std::endl; 00081 } 00082 00083 private: 00084 BSplineDerivativeKernelFunction(const Self&); //purposely not implemented 00085 void operator=(const Self&); //purposely not implemented 00086 00087 typename KernelType::Pointer m_KernelFunction; 00088 00089 }; 00090 00091 } // end namespace itk 00092 00093 #endif 00094