ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkMixtureModelComponentBase.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 itkMixtureModelComponentBase_h
19 #define itkMixtureModelComponentBase_h
20 
21 #include "vnl/vnl_vector.h"
22 #include "vnl/vnl_matrix.h"
23 
24 #include "itkArray.h"
25 #include "itkObject.h"
27 
28 namespace itk
29 {
30 namespace Statistics
31 {
55 template< typename TSample >
57  public Object
58 {
59 public:
62  typedef Object Superclass;
65 
68 
69  typedef typename TSample::MeasurementVectorType MeasurementVectorType;
70  typedef typename TSample::MeasurementVectorSizeType MeasurementVectorSizeType;
71 
75 
78 
80 
82  virtual void SetSample(const TSample *sample);
83 
85  const TSample * GetSample() const;
86 
92 
93  void SetMinimalParametersChange(double change)
94  {
96  }
97 
99  {
101  }
102 
103  virtual void SetParameters(const ParametersType & parameters);
104 
106  {
107  return m_Parameters;
108  }
109 
112  void AreParametersModified(bool flag);
113 
115  bool AreParametersModified();
116 
118  void SetWeight(unsigned int index, double value);
119 
121  double GetWeight(unsigned int index) const;
122 
124  double Evaluate(MeasurementVectorType & measurements);
125 
127  itkGetConstReferenceMacro(Weights, WeightArrayType);
128 
129  virtual void Update();
130 
131 protected:
133  virtual ~MixtureModelComponentBase();
134  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
135 
140 
141  virtual void GenerateData() = 0;
142 
143 private:
145  const TSample *m_Sample;
146 
148 
150 
153 
156 
159 }; // end of class
160 } // end of namespace Statistics
161 } // end of namespace itk
162 
163 #ifndef ITK_MANUAL_INSTANTIATION
164 #include "itkMixtureModelComponentBase.hxx"
165 #endif
166 
167 #endif
double GetWeight(unsigned int index) const
MembershipFunctionType * GetMembershipFunction()
void SetMembershipFunction(MembershipFunctionType *function)
virtual void SetParameters(const ParametersType &parameters)
MembershipFunctionBase< MeasurementVectorType > MembershipFunctionType
double Evaluate(MeasurementVectorType &measurements)
virtual void PrintSelf(std::ostream &os, Indent indent) const override
MembershipFunctionBase defines common interfaces for membership functions.
virtual void SetSample(const TSample *sample)
Control indentation during Print() invocation.
Definition: itkIndent.h:49
base class for distribution modules that supports analytical way to update the distribution parameter...
TSample::MeasurementVectorSizeType MeasurementVectorSizeType
Base class for most ITK classes.
Definition: itkObject.h:57
void SetWeight(unsigned int index, double value)