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 != m_Parameters)
00099 {
00100 m_Parameters = params;
00101 this->Modified();
00102 }
00103 }
00105
00108 virtual double EvaluatePDF(double x) const = 0;
00109
00113 virtual double EvaluatePDF(double x, const ParametersType&) const = 0;
00114
00118 virtual double EvaluateCDF(double x) const = 0;
00119
00123 virtual double EvaluateCDF(double x, const ParametersType&) const = 0;
00124
00129 virtual double EvaluateInverseCDF(double p) const = 0;
00130
00135 virtual double EvaluateInverseCDF(double p, const ParametersType&) const = 0;
00136
00138 virtual bool HasMean() const = 0;
00139
00141 virtual bool HasVariance() const = 0;
00142
00145 virtual double GetMean() const = 0;
00146
00149 virtual double GetVariance() const = 0;
00150
00151 protected:
00152 ProbabilityDistribution(void) {}
00153 virtual ~ProbabilityDistribution(void) {}
00154 void PrintSelf(std::ostream& os, Indent indent) const
00155 {
00156 Superclass::PrintSelf(os,indent);
00157 os << indent << "Parameters: " << m_Parameters << std::endl;
00158 };
00159
00160 ParametersType m_Parameters;
00161
00162 private:
00163 ProbabilityDistribution(const Self&);
00164 void operator=(const Self&);
00165
00166 };
00167
00168 }
00169 }
00170
00171 #endif
00172