Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

Review/Statistics/itkProbabilityDistribution.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkProbabilityDistribution.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-05-02 05:43:58 $
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 __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&); //purposely not implemented
00165   void operator=(const Self&); //purposely not implemented
00166 
00167 }; // end of class
00168 
00169 } // end of namespace Statistics
00170 } // end namespace itk
00171 
00172 #endif
00173 

Generated at Mon Jul 12 2010 19:29:22 for ITK by doxygen 1.7.1 written by Dimitri van Heesch, © 1997-2000