ITK  4.3.0
Insight Segmentation and Registration Toolkit
itkImageGaussianModelEstimator.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 __itkImageGaussianModelEstimator_h
19 #define __itkImageGaussianModelEstimator_h
20 
21 #include <cmath>
22 #include <cfloat>
23 
24 #include "vnl/vnl_vector.h"
25 #include "vnl/vnl_matrix.h"
26 #include "vnl/vnl_matrix_fixed.h"
27 #include "vnl/vnl_math.h"
28 #include "vnl/algo/vnl_matrix_inverse.h"
29 
30 #include "itkImageRegionIterator.h"
31 #include "itkMacro.h"
32 
34 
35 namespace itk
36 {
74 template< class TInputImage,
75  class TMembershipFunction,
76  class TTrainingImage >
77 class ITK_EXPORT ImageGaussianModelEstimator:
78  public ImageModelEstimatorBase< TInputImage, TMembershipFunction >
79 {
80 public:
86 
88  itkNewMacro(Self);
89 
92 
94  typedef typename TInputImage::Pointer InputImagePointer;
95 
97  typedef typename TTrainingImage::Pointer TrainingImagePointer;
98 
101  typedef typename TInputImage::PixelType InputImagePixelType;
102 
105  typedef typename TTrainingImage::PixelType TrainingImagePixelType;
106 
110 
112  typedef TMembershipFunction MembershipFunctionType;
113  typedef typename TMembershipFunction::Pointer MembershipFunctionPointer;
114 
116  itkSetMacro(TrainingImage, TrainingImagePointer);
117 
119  itkGetConstMacro(TrainingImage, TrainingImagePointer);
120 
121 protected:
124  virtual void PrintSelf(std::ostream & os, Indent indent) const;
125 
127  void GenerateData();
128 
129 private:
130  ImageGaussianModelEstimator(const Self &); //purposely not implemented
131  void operator=(const Self &); //purposely not implemented
132 
134 
135  typedef typename TInputImage::SizeType InputImageSizeType;
136 
138  itkStaticConstMacro(VectorDimension, unsigned int,
139  InputImagePixelType::Dimension);
140 
144 
146 
150  virtual void EstimateModels();
151 
152  void EstimateGaussianModelParameters();
153 }; // class ImageGaussianModelEstimator
154 } // namespace itk
155 
156 #ifndef ITK_MANUAL_INSTANTIATION
157 #include "itkImageGaussianModelEstimator.hxx"
158 #endif
159 
160 #endif
161