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
30#include "itkMacro.h"
31#if !defined(ITK_LEGACY_REMOVE) && !defined(ITK_FUTURE_LEGACY_REMOVE)
32# include "vnl/algo/vnl_matrix_inverse.h" // transitional transitive include; dropped on ITK legacy removal
33#endif
34
36#include "itkConceptChecking.h"
37#include "itkImage.h"
39
40namespace itk
41{
75
76template <typename TInputImage, typename TOutputImage = Image<double, TInputImage::ImageDimension>>
77class ITK_TEMPLATE_EXPORT ImagePCAShapeModelEstimator : public ImageShapeModelEstimatorBase<TInputImage, TOutputImage>
78{
79public:
80 ITK_DISALLOW_COPY_AND_MOVE(ImagePCAShapeModelEstimator);
81
87
89 itkNewMacro(Self);
90
92 itkOverrideGetNameOfClassMacro(ImagePCAShapeModelEstimator);
93
95 using InputImageType = TInputImage;
96 using InputImagePointer = typename TInputImage::Pointer;
97 using InputImageConstPointer = typename TInputImage::ConstPointer;
98
100 using InputImagePixelType = typename TInputImage::PixelType;
101
105
107 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
108
110 using OutputImageType = TOutputImage;
111 using OutputImagePointer = typename TOutputImage::Pointer;
112
115
117 using MatrixOfDoubleType = vnl_matrix<double>;
118
120 using MatrixOfIntegerType = vnl_matrix<int>;
121
123 using VectorOfDoubleType = vnl_vector<double>;
124
129 virtual void
131
132 itkGetConstMacro(NumberOfPrincipalComponentsRequired, unsigned int);
133
135 virtual void
137
138 itkGetConstMacro(NumberOfTrainingImages, unsigned int);
139
141 itkGetConstMacro(EigenValues, VectorOfDoubleType);
142
143protected:
145 ~ImagePCAShapeModelEstimator() override = default;
146 void
147 PrintSelf(std::ostream & os, Indent indent) const override;
148
152 void
154
159 void
161
163 void
164 GenerateData() override;
165
166private:
168 using InputImagePointerArray = std::vector<InputImageConstPointer>;
169 using InputImageIteratorArray = std::vector<InputImageConstIterator>;
170
171 using ImageSizeType = typename TInputImage::SizeType;
172
174 using InputPixelType = typename TInputImage::PixelType;
175
184 void
186
188 void
190
193 void
195
197
199
201
203
205
207
209
210 unsigned int m_NumberOfPixels{ 0 };
211
212 unsigned int m_NumberOfTrainingImages{ 0 };
213
215};
216
217} // end namespace itk
218
219#ifndef ITK_MANUAL_INSTANTIATION
220# include "itkImagePCAShapeModelEstimator.hxx"
221#endif
222
223#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....