ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkImagePCAShapeModelEstimator.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 itkImagePCAShapeModelEstimator_h
19#define itkImagePCAShapeModelEstimator_h
20
21#include <ctime>
22#include <cmath>
23#include <cfloat>
24
25#include "vnl/vnl_vector.h"
26#include "vnl/vnl_matrix.h"
27#include "itkMath.h"
28#include "vnl/algo/vnl_matrix_inverse.h"
29
31#include "itkMacro.h"
32
34#include "itkConceptChecking.h"
35#include "itkImage.h"
37
38namespace itk
39{
73
74template <typename TInputImage, typename TOutputImage = Image<double, TInputImage::ImageDimension>>
75class ITK_TEMPLATE_EXPORT ImagePCAShapeModelEstimator : public ImageShapeModelEstimatorBase<TInputImage, TOutputImage>
76{
77public:
78 ITK_DISALLOW_COPY_AND_MOVE(ImagePCAShapeModelEstimator);
79
85
87 itkNewMacro(Self);
88
90 itkOverrideGetNameOfClassMacro(ImagePCAShapeModelEstimator);
91
93 using InputImageType = TInputImage;
94 using InputImagePointer = typename TInputImage::Pointer;
95 using InputImageConstPointer = typename TInputImage::ConstPointer;
96
98 using InputImagePixelType = typename TInputImage::PixelType;
99
103
105 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
106
108 using OutputImageType = TOutputImage;
109 using OutputImagePointer = typename TOutputImage::Pointer;
110
113
115 using MatrixOfDoubleType = vnl_matrix<double>;
116
118 using MatrixOfIntegerType = vnl_matrix<int>;
119
121 using VectorOfDoubleType = vnl_vector<double>;
122
127 virtual void
129
130 itkGetConstMacro(NumberOfPrincipalComponentsRequired, unsigned int);
131
133 virtual void
135
136 itkGetConstMacro(NumberOfTrainingImages, unsigned int);
137
139 itkGetConstMacro(EigenValues, VectorOfDoubleType);
140
141protected:
143 ~ImagePCAShapeModelEstimator() override = default;
144 void
145 PrintSelf(std::ostream & os, Indent indent) const override;
146
150 void
152
157 void
159
161 void
162 GenerateData() override;
163
164private:
166 using InputImagePointerArray = std::vector<InputImageConstPointer>;
167 using InputImageIteratorArray = std::vector<InputImageConstIterator>;
168
169 using ImageSizeType = typename TInputImage::SizeType;
170
172 using InputPixelType = typename TInputImage::PixelType;
173
182 void
184
186 void
188
191 void
193
195
197
199
201
203
205
207
208 unsigned int m_NumberOfPixels{ 0 };
209
210 unsigned int m_NumberOfTrainingImages{ 0 };
211
213};
214
215} // end namespace itk
216
217#ifndef ITK_MANUAL_INSTANTIATION
218# include "itkImagePCAShapeModelEstimator.hxx"
219#endif
220
221#endif
Base class for all data objects in ITK.
typename TInputImage::Pointer InputImagePointer
virtual void SetNumberOfPrincipalComponentsRequired(unsigned int n)
std::vector< InputImageConstIterator > InputImageIteratorArray
static constexpr unsigned int InputImageDimension
typename TInputImage::PixelType InputPixelType
~ImagePCAShapeModelEstimator() override=default
typename TOutputImage::Pointer OutputImagePointer
typename TInputImage::ConstPointer InputImageConstPointer
std::vector< InputImageConstPointer > InputImagePointerArray
ImageRegionIterator< TInputImage > InputImageIterator
void GenerateInputRequestedRegion() override
ImageShapeModelEstimatorBase< TInputImage, TOutputImage > Superclass
virtual void SetNumberOfTrainingImages(unsigned int n)
typename TInputImage::PixelType InputImagePixelType
ImageRegionConstIterator< TInputImage > InputImageConstIterator
void PrintSelf(std::ostream &os, Indent indent) const override
void EnlargeOutputRequestedRegion(DataObject *) override
ImageRegionIterator< TOutputImage > OutputImageIterator
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:51
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....