ITK  4.3.0
Insight Segmentation and Registration Toolkit
itkProbabilityDistribution.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkProbabilityDistribution_h
19 #define __itkProbabilityDistribution_h
20 
21 #include "itkIntTypes.h"
22 #include "itkObject.h"
23 #include "itkObjectFactory.h"
24 #include "itkArray.h"
25 
26 namespace itk
27 {
28 namespace Statistics
29 {
71 class ITK_EXPORT ProbabilityDistribution:
72  public Object
73 {
74 public:
77  typedef Object Superclass;
80 
83 
86 
90  virtual SizeValueType GetNumberOfParameters() const = 0;
91 
95  itkGetConstReferenceMacro(Parameters, ParametersType);
96 
100  virtual void SetParameters(const ParametersType & params)
101  {
102  if ( ( params.GetSize() != m_Parameters.GetSize() )
103  || ( params != m_Parameters ) )
104  {
105  m_Parameters = params;
106  this->Modified();
107  }
108  }
110 
113  virtual double EvaluatePDF(double x) const = 0;
114 
118  virtual double EvaluatePDF(double x, const ParametersType &) const = 0;
119 
123  virtual double EvaluateCDF(double x) const = 0;
124 
128  virtual double EvaluateCDF(double x, const ParametersType &) const = 0;
129 
134  virtual double EvaluateInverseCDF(double p) const = 0;
135 
140  virtual double EvaluateInverseCDF(double p, const ParametersType &) const = 0;
141 
143  virtual bool HasMean() const = 0;
144 
146  virtual bool HasVariance() const = 0;
147 
150  virtual double GetMean() const = 0;
151 
154  virtual double GetVariance() const = 0;
155 
156 protected:
158  virtual ~ProbabilityDistribution(void) {}
159  void PrintSelf(std::ostream & os, Indent indent) const
160  {
161  Superclass::PrintSelf(os, indent);
162  os << indent << "Parameters: " << m_Parameters << std::endl;
163  }
164 
166 
167 private:
168  ProbabilityDistribution(const Self &); //purposely not implemented
169  void operator=(const Self &); //purposely not implemented
170 }; // end of class
171 } // end of namespace Statistics
172 } // end namespace itk
173 
174 #endif
175