ITK  5.2.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  * 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 itkPCAShapeSignedDistanceFunction_h
19 #define itkPCAShapeSignedDistanceFunction_h
20 
22 #include "itkImage.h"
25 #include "itkTransform.h"
26 
27 namespace itk
28 {
66 template <typename TCoordRep, unsigned int VSpaceDimension, typename TImage = Image<double, VSpaceDimension>>
67 class ITK_TEMPLATE_EXPORT PCAShapeSignedDistanceFunction
68  : public ShapeSignedDistanceFunction<TCoordRep, VSpaceDimension>
69 {
70 public:
71  ITK_DISALLOW_COPY_AND_ASSIGN(PCAShapeSignedDistanceFunction);
72 
76 
79 
81  itkTypeMacro(PCAShapeSignedDistanceFunction, ShapeSignedDistancFunction);
82 
84  itkNewMacro(Self);
85 
87  static constexpr unsigned int SpaceDimension = Superclass::SpaceDimension;
88 
90  using CoordRepType = typename Superclass::CoordRepType;
91 
93  using InputType = typename Superclass::InputType;
94 
96  using OutputType = typename Superclass::OutputType;
97 
99  using PointType = typename Superclass::PointType;
100 
102  using ParametersType = typename Superclass::ParametersType;
103 
105  using ImageType = TImage;
106  using ImagePointer = typename ImageType::Pointer;
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
130  SetNumberOfPrincipalComponents(unsigned int n);
131 
132  itkGetConstMacro(NumberOfPrincipalComponents, unsigned int);
133 
135  itkSetObjectMacro(MeanImage, ImageType);
136  itkGetModifiableObjectMacro(MeanImage, ImageType);
138 
140  void
142  {
143  m_PrincipalComponentImages = v;
144  }
145  // ImagePointerVector & GetPrincipalComponentImages()
146  // { return m_PrincipalComponentImages; }
148 
151  itkSetMacro(PrincipalComponentStandardDeviations, ParametersType);
152  itkGetConstMacro(PrincipalComponentStandardDeviations, ParametersType);
154 
156  itkSetObjectMacro(Transform, TransformType);
157  itkGetModifiableObjectMacro(Transform, TransformType);
159 
161  void
162  SetParameters(const ParametersType &) override;
163 
164  unsigned int
165  GetNumberOfShapeParameters() const override
166  {
167  return m_NumberOfPrincipalComponents;
168  }
169  unsigned int
170  GetNumberOfPoseParameters() const override
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 
184 protected:
186  ~PCAShapeSignedDistanceFunction() override = default;
187 
188  void
189  PrintSelf(std::ostream & os, Indent indent) const override;
190 
191 private:
195 
199 
202 
205 
209 };
210 } // end namespace itk
211 
212 #ifndef ITK_MANUAL_INSTANTIATION
213 # include "itkPCAShapeSignedDistanceFunction.hxx"
214 #endif
215 
216 #endif
itk::ExtrapolateImageFunction
Base class for all image extrapolaters.
Definition: itkExtrapolateImageFunction.h:44
itk::PCAShapeSignedDistanceFunction::m_TransformParameters
ParametersType m_TransformParameters
Definition: itkPCAShapeSignedDistanceFunction.h:208
itk::PCAShapeSignedDistanceFunction::FunctionPointerVector
std::vector< FunctionPointer > FunctionPointerVector
Definition: itkPCAShapeSignedDistanceFunction.h:125
itk::PCAShapeSignedDistanceFunction
Compute the signed distance from a N-dimensional PCA Shape.
Definition: itkPCAShapeSignedDistanceFunction.h:67
itk::PCAShapeSignedDistanceFunction::CoordRepType
typename Superclass::CoordRepType CoordRepType
Definition: itkPCAShapeSignedDistanceFunction.h:90
itk::PCAShapeSignedDistanceFunction::FunctionPointer
typename FunctionType::Pointer FunctionPointer
Definition: itkPCAShapeSignedDistanceFunction.h:124
itk::PCAShapeSignedDistanceFunction::ImageType
TImage ImageType
Definition: itkPCAShapeSignedDistanceFunction.h:105
itk::PCAShapeSignedDistanceFunction::ExtrapolatorPointerVector
std::vector< ExtrapolatorPointer > ExtrapolatorPointerVector
Definition: itkPCAShapeSignedDistanceFunction.h:120
itk::PCAShapeSignedDistanceFunction::m_Transform
TransformType::Pointer m_Transform
Definition: itkPCAShapeSignedDistanceFunction.h:201
itk::PCAShapeSignedDistanceFunction::m_NumberOfTransformParameters
unsigned int m_NumberOfTransformParameters
Definition: itkPCAShapeSignedDistanceFunction.h:194
itkShapeSignedDistanceFunction.h
itk::PCAShapeSignedDistanceFunction::m_Extrapolators
ExtrapolatorPointerVector m_Extrapolators
Definition: itkPCAShapeSignedDistanceFunction.h:204
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::PCAShapeSignedDistanceFunction::m_NumberOfPrincipalComponents
unsigned int m_NumberOfPrincipalComponents
Definition: itkPCAShapeSignedDistanceFunction.h:193
itk::PCAShapeSignedDistanceFunction::InputType
typename Superclass::InputType InputType
Definition: itkPCAShapeSignedDistanceFunction.h:93
itkImage.h
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::PCAShapeSignedDistanceFunction::m_WeightOfPrincipalComponents
ParametersType m_WeightOfPrincipalComponents
Definition: itkPCAShapeSignedDistanceFunction.h:207
itk::PCAShapeSignedDistanceFunction::m_MeanImage
ImagePointer m_MeanImage
Definition: itkPCAShapeSignedDistanceFunction.h:196
itk::PCAShapeSignedDistanceFunction::InterpolatorPointerVector
std::vector< InterpolatorPointer > InterpolatorPointerVector
Definition: itkPCAShapeSignedDistanceFunction.h:115
itk::PCAShapeSignedDistanceFunction::InterpolatorPointer
typename InterpolatorType::Pointer InterpolatorPointer
Definition: itkPCAShapeSignedDistanceFunction.h:114
itk::PCAShapeSignedDistanceFunction::m_PrincipalComponentStandardDeviations
ParametersType m_PrincipalComponentStandardDeviations
Definition: itkPCAShapeSignedDistanceFunction.h:198
itk::ImageFunction
Evaluates a function of an image at specified position.
Definition: itkImageFunction.h:55
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::ShapeSignedDistanceFunction
Base class for functions which evaluates the signed distance from a shape.
Definition: itkShapeSignedDistanceFunction.h:53
itk::PCAShapeSignedDistanceFunction::ExtrapolatorPointer
typename ExtrapolatorType::Pointer ExtrapolatorPointer
Definition: itkPCAShapeSignedDistanceFunction.h:119
itk::PCAShapeSignedDistanceFunction::SetPrincipalComponentImages
void SetPrincipalComponentImages(ImagePointerVector v)
Definition: itkPCAShapeSignedDistanceFunction.h:141
itkExtrapolateImageFunction.h
itk::PCAShapeSignedDistanceFunction::OutputType
typename Superclass::OutputType OutputType
Definition: itkPCAShapeSignedDistanceFunction.h:96
itk::PCAShapeSignedDistanceFunction::ParametersType
typename Superclass::ParametersType ParametersType
Definition: itkPCAShapeSignedDistanceFunction.h:102
itk::PCAShapeSignedDistanceFunction::GetNumberOfShapeParameters
unsigned int GetNumberOfShapeParameters() const override
Definition: itkPCAShapeSignedDistanceFunction.h:165
itk::PCAShapeSignedDistanceFunction::m_PrincipalComponentImages
ImagePointerVector m_PrincipalComponentImages
Definition: itkPCAShapeSignedDistanceFunction.h:197
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::Transform
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:82
itkTransform.h
itk::PCAShapeSignedDistanceFunction::ImagePointer
typename ImageType::Pointer ImagePointer
Definition: itkPCAShapeSignedDistanceFunction.h:106
itkInterpolateImageFunction.h
itk::PCAShapeSignedDistanceFunction::m_Interpolators
InterpolatorPointerVector m_Interpolators
Definition: itkPCAShapeSignedDistanceFunction.h:203
itk::PCAShapeSignedDistanceFunction::GetNumberOfPoseParameters
unsigned int GetNumberOfPoseParameters() const override
Definition: itkPCAShapeSignedDistanceFunction.h:170
itk::InterpolateImageFunction
Base class for all image interpolators.
Definition: itkInterpolateImageFunction.h:45
itk::PCAShapeSignedDistanceFunction::ImagePointerVector
std::vector< ImagePointer > ImagePointerVector
Definition: itkPCAShapeSignedDistanceFunction.h:107
itk::PCAShapeSignedDistanceFunction::PointType
typename Superclass::PointType PointType
Definition: itkPCAShapeSignedDistanceFunction.h:99