ITK  6.0.0
Insight Toolkit
itkPCAShapeSignedDistanceFunction.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 itkPCAShapeSignedDistanceFunction_h
19#define itkPCAShapeSignedDistanceFunction_h
20
22#include "itkImage.h"
25#include "itkTransform.h"
26
27namespace itk
28{
66template <typename TCoordRep, unsigned int VSpaceDimension, typename TImage = Image<double, VSpaceDimension>>
67class ITK_TEMPLATE_EXPORT PCAShapeSignedDistanceFunction
68 : public ShapeSignedDistanceFunction<TCoordRep, VSpaceDimension>
69{
70public:
71 ITK_DISALLOW_COPY_AND_MOVE(PCAShapeSignedDistanceFunction);
72
76
79
81 itkOverrideGetNameOfClassMacro(PCAShapeSignedDistanceFunction);
82
84 itkNewMacro(Self);
85
87 static constexpr unsigned int SpaceDimension = Superclass::SpaceDimension;
88
90 using typename Superclass::CoordRepType;
91
93 using typename Superclass::InputType;
94
96 using typename Superclass::OutputType;
97
99 using typename Superclass::PointType;
100
102 using typename Superclass::ParametersType;
103
105 using ImageType = TImage;
107 using ImagePointerVector = std::vector<ImagePointer>;
108
111
115 using InterpolatorPointerVector = std::vector<InterpolatorPointer>;
116
120 using ExtrapolatorPointerVector = std::vector<ExtrapolatorPointer>;
121
125 using FunctionPointerVector = std::vector<FunctionPointer>;
126
129 void
131
132 itkGetConstMacro(NumberOfPrincipalComponents, unsigned int);
133
135 itkSetObjectMacro(MeanImage, ImageType);
136 itkGetModifiableObjectMacro(MeanImage, ImageType);
140 void
142 {
143 m_PrincipalComponentImages = v;
144 }
145 // ImagePointerVector & GetPrincipalComponentImages()
146 // { return m_PrincipalComponentImages; }
151 itkSetMacro(PrincipalComponentStandardDeviations, ParametersType);
152 itkGetConstMacro(PrincipalComponentStandardDeviations, ParametersType);
156 itkSetObjectMacro(Transform, TransformType);
157 itkGetModifiableObjectMacro(Transform, TransformType);
161 void
162 SetParameters(const ParametersType &) override;
163
164 unsigned int
166 {
167 return m_NumberOfPrincipalComponents;
168 }
169 unsigned int
171 {
172 return m_Transform ? m_Transform->GetNumberOfParameters() : 0;
173 }
174
176 OutputType
177 Evaluate(const PointType & point) const override;
178
181 void
182 Initialize() override;
183
184protected:
187
188 void
189 PrintSelf(std::ostream & os, Indent indent) const override;
190
191private:
193 unsigned int m_NumberOfPrincipalComponents{};
194 unsigned int m_NumberOfTransformParameters{};
195
196 ImagePointer m_MeanImage{};
197 ImagePointerVector m_PrincipalComponentImages{};
198 ParametersType m_PrincipalComponentStandardDeviations{};
199
201 typename TransformType::Pointer m_Transform{};
202
203 InterpolatorPointerVector m_Interpolators{};
204 ExtrapolatorPointerVector m_Extrapolators{};
205
207 ParametersType m_WeightOfPrincipalComponents{};
208 ParametersType m_TransformParameters{};
209};
210} // end namespace itk
211
212#ifndef ITK_MANUAL_INSTANTIATION
213# include "itkPCAShapeSignedDistanceFunction.hxx"
214#endif
215
216#endif
Base class for all image extrapolaters.
Evaluates a function of an image at specified position.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Base class for all image interpolators.
Light weight base class for most itk classes.
Compute the signed distance from a N-dimensional PCA Shape.
std::vector< ExtrapolatorPointer > ExtrapolatorPointerVector
std::vector< InterpolatorPointer > InterpolatorPointerVector
typename ExtrapolatorType::Pointer ExtrapolatorPointer
void SetParameters(const ParametersType &) override
void PrintSelf(std::ostream &os, Indent indent) const override
OutputType Evaluate(const PointType &point) const override
void SetNumberOfPrincipalComponents(unsigned int n)
typename InterpolatorType::Pointer InterpolatorPointer
unsigned int GetNumberOfShapeParameters() const override
~PCAShapeSignedDistanceFunction() override=default
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:54
Base class for functions which evaluates the signed distance from a shape.
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:84
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
*par Constraints *The filter image with at least two dimensions and a vector *length of at least The theory supports extension to scalar but *the implementation of the itk vector classes do not **The template parameter TRealType must be floating point(float or double) or *a user-defined "real" numerical type with arithmetic operations defined *sufficient to compute derivatives. **\par Performance *This filter will automatically multithread if run with *SetUsePrincipleComponents