00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkProbabilityDistribution_h
00018 #define __itkProbabilityDistribution_h
00019
00020 #include "itkObject.h"
00021 #include "itkObjectFactory.h"
00022 #include "itkArray.h"
00023
00024 namespace itk {
00025 namespace Statistics {
00026
00067 class ITK_EXPORT ProbabilityDistribution :
00068 public Object
00069 {
00070 public:
00072 typedef ProbabilityDistribution Self;
00073 typedef Object Superclass;
00074 typedef SmartPointer<Self> Pointer;
00075 typedef SmartPointer<const Self> ConstPointer;
00076
00078 itkTypeMacro(ProbabilityDistribution, Object);
00079
00081 typedef Array< double > ParametersType;
00082
00086 virtual unsigned long GetNumberOfParameters() const = 0;
00087
00091 itkGetConstReferenceMacro(Parameters, ParametersType);
00092
00096 virtual void SetParameters(const ParametersType& params)
00097 {
00098 if ((params.GetSize() != m_Parameters.GetSize())
00099 || (params != m_Parameters))
00100 {
00101 m_Parameters = params;
00102 this->Modified();
00103 }
00104 }
00106
00109 virtual double EvaluatePDF(double x) const = 0;
00110
00114 virtual double EvaluatePDF(double x, const ParametersType&) const = 0;
00115
00119 virtual double EvaluateCDF(double x) const = 0;
00120
00124 virtual double EvaluateCDF(double x, const ParametersType&) const = 0;
00125
00130 virtual double EvaluateInverseCDF(double p) const = 0;
00131
00136 virtual double EvaluateInverseCDF(double p, const ParametersType&) const = 0;
00137
00139 virtual bool HasMean() const = 0;
00140
00142 virtual bool HasVariance() const = 0;
00143
00146 virtual double GetMean() const = 0;
00147
00150 virtual double GetVariance() const = 0;
00151
00152 protected:
00153 ProbabilityDistribution(void) {}
00154 virtual ~ProbabilityDistribution(void) {}
00155 void PrintSelf(std::ostream& os, Indent indent) const
00156 {
00157 Superclass::PrintSelf(os,indent);
00158 os << indent << "Parameters: " << m_Parameters << std::endl;
00159 }
00160
00161 ParametersType m_Parameters;
00162
00163 private:
00164 ProbabilityDistribution(const Self&);
00165 void operator=(const Self&);
00166
00167 };
00168
00169 }
00170 }
00171
00172 #endif
00173