00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkSquaredDifferenceErrorFunction.h,v $ 00005 Language: C++ 00006 Date: $Date: 2005/08/02 19:17:37 $ 00007 Version: $Revision: 1.1 $ 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 __itkSquaredDifferenceErrorFunction_h 00018 #define __itkSquaredDifferenceErrorFunction_h 00019 00020 #include "itkErrorFunctionBase.h" 00021 #include "vnl/vnl_matrix.h" 00022 #include "vnl/vnl_vector.h" 00023 00024 namespace itk 00025 { 00026 namespace Statistics 00027 { 00028 00029 template<class TVector, class ScalarType> 00030 class SquaredDifferenceErrorFunction : public ErrorFunctionBase<TVector, ScalarType> 00031 { 00032 public: 00033 00035 typedef SquaredDifferenceErrorFunction Self; 00036 typedef ErrorFunctionBase<TVector, ScalarType> Superclass; 00037 typedef SmartPointer<Self> Pointer; 00038 typedef SmartPointer<const Self> ConstPointer; 00039 typedef typename Superclass::ErrorVectorType ErrorVectorType; 00040 00042 itkTypeMacro(SquaredDifferenceErrorFunction, FunctionBase); 00043 00045 itkNewMacro(Self) ; 00046 00048 ScalarType Evaluate(const TVector& Errors) const; 00049 00050 ErrorVectorType EvaluateDerivative(const TVector& Errors) const; 00051 00052 protected: 00053 00054 SquaredDifferenceErrorFunction(); 00055 ~SquaredDifferenceErrorFunction(); 00056 00058 virtual void PrintSelf( std::ostream& os, Indent indent ) const; 00059 }; 00060 00061 } // end namespace Statistics 00062 } // end namespace itk 00063 00064 #ifndef ITK_MANUAL_INSTANTIATION 00065 #include "itkSquaredDifferenceErrorFunction.txx" 00066 #endif 00067 00068 00069 #endif