ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkImageGaussianModelEstimator.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
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 * https://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#include <memory> // For unique_ptr.
24
25#include "vnl/vnl_vector.h"
26#include "vnl/vnl_matrix.h"
27#include "vnl/vnl_matrix_fixed.h"
28#include "itkMath.h"
29#include "vnl/algo/vnl_matrix_inverse.h"
30
32#include "itkMacro.h"
33
35
36namespace itk
37{
76template <typename TInputImage, typename TMembershipFunction, typename TTrainingImage>
77class ITK_TEMPLATE_EXPORT ImageGaussianModelEstimator : public ImageModelEstimatorBase<TInputImage, TMembershipFunction>
78{
79public:
80 ITK_DISALLOW_COPY_AND_MOVE(ImageGaussianModelEstimator);
81
87
89 itkNewMacro(Self);
90
92 itkOverrideGetNameOfClassMacro(ImageGaussianModelEstimator);
93
95 using InputImageType = TInputImage;
96 using InputImagePointer = typename TInputImage::Pointer;
97 using InputImageConstPointer = typename TInputImage::ConstPointer;
98
100 using TrainingImageType = TTrainingImage;
101 using TrainingImagePointer = typename TTrainingImage::Pointer;
102 using TrainingImageConstPointer = typename TTrainingImage::ConstPointer;
103
106 using InputImagePixelType = typename TInputImage::PixelType;
107
110 using TrainingImagePixelType = typename TTrainingImage::PixelType;
111
117
119 using MembershipFunctionType = TMembershipFunction;
120 using MembershipFunctionPointer = typename TMembershipFunction::Pointer;
121
123 itkSetObjectMacro(TrainingImage, TrainingImageType);
124 itkGetModifiableObjectMacro(TrainingImage, TrainingImageType);
126
127protected:
129 ~ImageGaussianModelEstimator() override = default;
130 void
131 PrintSelf(std::ostream & os, Indent indent) const override;
132
134 void
135 GenerateData() override;
136
137private:
138 using MatrixType = vnl_matrix<double>;
139
140 using InputImageSizeType = typename TInputImage::SizeType;
141
143 static constexpr unsigned int VectorDimension = InputImagePixelType::Dimension;
144
150 void
151 EstimateModels() override;
152
153 void
155
158 std::unique_ptr<MatrixType[]> m_Covariance{ nullptr };
159
161};
162} // end namespace itk
163
164#ifndef ITK_MANUAL_INSTANTIATION
165# include "itkImageGaussianModelEstimator.hxx"
166#endif
167
168#endif
typename TTrainingImage::Pointer TrainingImagePointer
ImageModelEstimatorBase< TInputImage, TMembershipFunction > Superclass
void PrintSelf(std::ostream &os, Indent indent) const override
~ImageGaussianModelEstimator() override=default
typename TInputImage::Pointer InputImagePointer
typename TInputImage::ConstPointer InputImageConstPointer
typename TTrainingImage::PixelType TrainingImagePixelType
ImageRegionIterator< TInputImage > InputImageIterator
typename TInputImage::SizeType InputImageSizeType
ImageRegionConstIterator< TInputImage > InputImageConstIterator
typename TMembershipFunction::Pointer MembershipFunctionPointer
typename TTrainingImage::ConstPointer TrainingImageConstPointer
ImageRegionConstIterator< TTrainingImage > TrainingImageConstIterator
typename TInputImage::PixelType InputImagePixelType
ImageRegionIterator< TTrainingImage > TrainingImageIterator
A multi-dimensional iterator templated over image type that walks a region of pixels.
A multi-dimensional iterator templated over image type that walks a region of pixels.
Control indentation during Print() invocation.
Definition itkIndent.h:50
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....