00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkCumulativeGaussianCostFunction.h,v $ 00005 Language: C++ 00006 Date: $Date: 2003/09/10 14:29:37 $ 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 00018 #ifndef __itkCumulativeGaussianCostFunction_h 00019 #define __itkCumulativeGaussianCostFunction_h 00020 00021 #include "itkMultipleValuedCostFunction.h" 00022 00023 namespace itk 00024 { 00025 00050 class CumulativeGaussianCostFunction : public MultipleValuedCostFunction 00051 { 00052 public: 00053 00055 typedef CumulativeGaussianCostFunction Self; 00056 typedef MultipleValuedCostFunction Superclass; 00057 typedef SmartPointer<Self> Pointer; 00058 typedef SmartPointer<const Self> ConstPointer; 00059 00061 itkNewMacro(Self); 00062 00064 typedef Superclass::ParametersType ParametersType; 00065 typedef Superclass::MeasureType MeasureType; 00066 typedef Superclass::DerivativeType DerivativeType; 00067 00069 enum {SpaceDimension = 4}; 00070 00072 void GetDerivative( const ParametersType & itkNotUsed(parameters), 00073 DerivativeType & itkNotUsed(derivative)) const {}; 00074 00076 MeasureType GetValue( const ParametersType & parameters ) const; 00077 00079 MeasureType * GetValue( ParametersType & parameters ); 00080 00082 double CalculateFitError(MeasureType * setTestArray); 00083 00085 double EvaluateCumulativeGaussian(double argument) const; 00086 00088 unsigned int GetNumberOfParameters() const; 00089 00091 unsigned int GetNumberOfValues() const; 00092 00094 void Initialize(unsigned int rangeDimension); 00095 00097 void SetOriginalDataArray(MeasureType * setOriginalDataArray); 00098 00099 protected: 00100 CumulativeGaussianCostFunction(); 00101 virtual ~CumulativeGaussianCostFunction(); 00102 00103 void PrintSelf(std::ostream &os, Indent indent) const; 00104 00105 private: 00106 00108 MeasureType * m_OriginalDataArray; 00109 00111 unsigned int m_RangeDimension; 00112 00114 mutable MeasureType m_Measure; 00115 mutable MeasureType * m_MeasurePointer; 00116 mutable ParametersType m_Parameters; 00117 }; 00118 00119 } // end namespace itk 00120 00121 #endif