00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkGoodnessOfFitMixtureModelCostFunction_h
00018 #define __itkGoodnessOfFitMixtureModelCostFunction_h
00019
00020 #include "itkSingleValuedCostFunction.h"
00021 #include "itkHistogram.h"
00022 #include "itkGoodnessOfFitComponentBase.h"
00023 #include "itkGoodnessOfFitFunctionBase.h"
00024 #include "itkFunctionBase.h"
00025
00026 namespace itk{
00027 namespace Statistics{
00028
00074 template< class TInputSample >
00075 class ITK_EXPORT GoodnessOfFitMixtureModelCostFunction
00076 : public SingleValuedCostFunction
00077 {
00078 public:
00080 typedef GoodnessOfFitMixtureModelCostFunction Self;
00081 typedef SingleValuedCostFunction Superclass;
00082 typedef SmartPointer< Self > Pointer;
00083 typedef SmartPointer< const Self > ConstPointer;
00084
00086 itkTypeMacro(GoodnessOfFitMixtureModelCostFunction, SingleValuedCostFunction) ;
00087
00089 itkNewMacro(Self) ;
00090
00091 typedef TInputSample InputSampleType ;
00092 itkStaticConstMacro(MeasurementVectorSize, unsigned int,
00093 TInputSample::MeasurementVectorSize) ;
00094 typedef typename TInputSample::MeasurementType MeasurementType ;
00095 typedef typename TInputSample::MeasurementVectorType MeasurementVectorType ;
00096
00099 typedef SingleValuedCostFunction::ParametersType ParamtersType ;
00100
00103 typedef SingleValuedCostFunction::MeasureType MeasureType ;
00104
00105 typedef GoodnessOfFitComponentBase< TInputSample > ComponentType ;
00106 typedef std::vector< ComponentType* > ComponentVectorType ;
00107
00108 typedef GoodnessOfFitFunctionBase< typename ComponentType::HistogramType >
00109 FunctionType ;
00110
00112 void AddComponent(ComponentType* component) ;
00113
00115 void SetFunction(FunctionType* core) ;
00116
00117 FunctionType* GetFunction()
00118 { return m_Function ; }
00119
00120 virtual unsigned int GetNumberOfParameters() const ;
00121
00124 virtual MeasureType GetValue( const ParametersType & parameters ) const ;
00125
00128 virtual void GetDerivative( const ParametersType &,
00129 DerivativeType & ) const
00130 { }
00131
00132 protected:
00133 GoodnessOfFitMixtureModelCostFunction() ;
00134 virtual ~GoodnessOfFitMixtureModelCostFunction() ;
00135 virtual void PrintSelf(std::ostream& os, Indent indent) const ;
00136
00137 private:
00139 ComponentVectorType m_Components ;
00140 FunctionType* m_Function ;
00141 } ;
00142
00143 }
00144 }
00145
00146 #ifndef ITK_MANUAL_INSTANTIATION
00147 #include "itkGoodnessOfFitMixtureModelCostFunction.txx"
00148 #endif
00149
00150 #endif
00151