ITK  5.1.0
Insight Toolkit
itkPCAShapeSignedDistanceFunction.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 {
65 template <typename TCoordRep, unsigned int VSpaceDimension, typename TImage = Image<double, VSpaceDimension>>
66 class ITK_TEMPLATE_EXPORT PCAShapeSignedDistanceFunction
67  : public ShapeSignedDistanceFunction<TCoordRep, VSpaceDimension>
68 {
69 public:
70  ITK_DISALLOW_COPY_AND_ASSIGN(PCAShapeSignedDistanceFunction);
71 
75 
78 
80  itkTypeMacro(PCAShapeSignedDistanceFunction, ShapeSignedDistancFunction);
81 
83  itkNewMacro(Self);
84 
86  static constexpr unsigned int SpaceDimension = Superclass::SpaceDimension;
87 
89  using CoordRepType = typename Superclass::CoordRepType;
90 
92  using InputType = typename Superclass::InputType;
93 
95  using OutputType = typename Superclass::OutputType;
96 
98  using PointType = typename Superclass::PointType;
99 
101  using ParametersType = typename Superclass::ParametersType;
102 
104  using ImageType = TImage;
105  using ImagePointer = typename ImageType::Pointer;
106  using ImagePointerVector = std::vector<ImagePointer>;
107 
110 
114  using InterpolatorPointerVector = std::vector<InterpolatorPointer>;
115 
119  using ExtrapolatorPointerVector = std::vector<ExtrapolatorPointer>;
120 
124  using FunctionPointerVector = std::vector<FunctionPointer>;
125 
128  void
129  SetNumberOfPrincipalComponents(unsigned int n);
130 
131  itkGetConstMacro(NumberOfPrincipalComponents, unsigned int);
132 
134  itkSetObjectMacro(MeanImage, ImageType);
135  itkGetModifiableObjectMacro(MeanImage, ImageType);
137 
139  void
141  {
142  m_PrincipalComponentImages = v;
143  }
144  // ImagePointerVector & GetPrincipalComponentImages()
145  // { return m_PrincipalComponentImages; }
147 
150  itkSetMacro(PrincipalComponentStandardDeviations, ParametersType);
151  itkGetConstMacro(PrincipalComponentStandardDeviations, ParametersType);
153 
155  itkSetObjectMacro(Transform, TransformType);
156  itkGetModifiableObjectMacro(Transform, TransformType);
158 
160  void
161  SetParameters(const ParametersType &) override;
162 
163  unsigned int
164  GetNumberOfShapeParameters() const override
165  {
166  return m_NumberOfPrincipalComponents;
167  }
168  unsigned int
169  GetNumberOfPoseParameters() const override
170  {
171  return m_Transform ? m_Transform->GetNumberOfParameters() : 0;
172  }
173 
175  OutputType
176  Evaluate(const PointType & point) const override;
177 
180  void
181  Initialize() override;
182 
183 protected:
185  ~PCAShapeSignedDistanceFunction() override = default;
186 
187  void
188  PrintSelf(std::ostream & os, Indent indent) const override;
189 
190 private:
194 
198 
201 
204 
208 };
209 } // end namespace itk
210 
211 #ifndef ITK_MANUAL_INSTANTIATION
212 # include "itkPCAShapeSignedDistanceFunction.hxx"
213 #endif
214 
215 #endif
itk::ExtrapolateImageFunction
Base class for all image extrapolaters.
Definition: itkExtrapolateImageFunction.h:43
itk::PCAShapeSignedDistanceFunction::m_TransformParameters
ParametersType m_TransformParameters
Definition: itkPCAShapeSignedDistanceFunction.h:207
itk::PCAShapeSignedDistanceFunction::FunctionPointerVector
std::vector< FunctionPointer > FunctionPointerVector
Definition: itkPCAShapeSignedDistanceFunction.h:124
itk::PCAShapeSignedDistanceFunction
Compute the signed distance from a N-dimensional PCA Shape.
Definition: itkPCAShapeSignedDistanceFunction.h:66
itk::PCAShapeSignedDistanceFunction::CoordRepType
typename Superclass::CoordRepType CoordRepType
Definition: itkPCAShapeSignedDistanceFunction.h:89
itk::PCAShapeSignedDistanceFunction::FunctionPointer
typename FunctionType::Pointer FunctionPointer
Definition: itkPCAShapeSignedDistanceFunction.h:123
itk::PCAShapeSignedDistanceFunction::ImageType
TImage ImageType
Definition: itkPCAShapeSignedDistanceFunction.h:104
itk::PCAShapeSignedDistanceFunction::ExtrapolatorPointerVector
std::vector< ExtrapolatorPointer > ExtrapolatorPointerVector
Definition: itkPCAShapeSignedDistanceFunction.h:119
itk::PCAShapeSignedDistanceFunction::m_Transform
TransformType::Pointer m_Transform
Definition: itkPCAShapeSignedDistanceFunction.h:200
itk::PCAShapeSignedDistanceFunction::m_NumberOfTransformParameters
unsigned int m_NumberOfTransformParameters
Definition: itkPCAShapeSignedDistanceFunction.h:193
itkShapeSignedDistanceFunction.h
itk::PCAShapeSignedDistanceFunction::m_Extrapolators
ExtrapolatorPointerVector m_Extrapolators
Definition: itkPCAShapeSignedDistanceFunction.h:203
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::PCAShapeSignedDistanceFunction::m_NumberOfPrincipalComponents
unsigned int m_NumberOfPrincipalComponents
Definition: itkPCAShapeSignedDistanceFunction.h:192
itk::PCAShapeSignedDistanceFunction::InputType
typename Superclass::InputType InputType
Definition: itkPCAShapeSignedDistanceFunction.h:92
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:206
itk::PCAShapeSignedDistanceFunction::m_MeanImage
ImagePointer m_MeanImage
Definition: itkPCAShapeSignedDistanceFunction.h:195
itk::PCAShapeSignedDistanceFunction::InterpolatorPointerVector
std::vector< InterpolatorPointer > InterpolatorPointerVector
Definition: itkPCAShapeSignedDistanceFunction.h:114
itk::PCAShapeSignedDistanceFunction::InterpolatorPointer
typename InterpolatorType::Pointer InterpolatorPointer
Definition: itkPCAShapeSignedDistanceFunction.h:113
itk::PCAShapeSignedDistanceFunction::m_PrincipalComponentStandardDeviations
ParametersType m_PrincipalComponentStandardDeviations
Definition: itkPCAShapeSignedDistanceFunction.h:197
itk::ImageFunction
Evaluates a function of an image at specified position.
Definition: itkImageFunction.h:54
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:52
itk::PCAShapeSignedDistanceFunction::ExtrapolatorPointer
typename ExtrapolatorType::Pointer ExtrapolatorPointer
Definition: itkPCAShapeSignedDistanceFunction.h:118
itk::PCAShapeSignedDistanceFunction::SetPrincipalComponentImages
void SetPrincipalComponentImages(ImagePointerVector v)
Definition: itkPCAShapeSignedDistanceFunction.h:140
itkExtrapolateImageFunction.h
itk::PCAShapeSignedDistanceFunction::OutputType
typename Superclass::OutputType OutputType
Definition: itkPCAShapeSignedDistanceFunction.h:95
itk::PCAShapeSignedDistanceFunction::ParametersType
typename Superclass::ParametersType ParametersType
Definition: itkPCAShapeSignedDistanceFunction.h:101
itk::PCAShapeSignedDistanceFunction::GetNumberOfShapeParameters
unsigned int GetNumberOfShapeParameters() const override
Definition: itkPCAShapeSignedDistanceFunction.h:164
itk::PCAShapeSignedDistanceFunction::m_PrincipalComponentImages
ImagePointerVector m_PrincipalComponentImages
Definition: itkPCAShapeSignedDistanceFunction.h:196
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkArray.h:26
itk::Transform
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:81
itkTransform.h
itk::PCAShapeSignedDistanceFunction::ImagePointer
typename ImageType::Pointer ImagePointer
Definition: itkPCAShapeSignedDistanceFunction.h:105
itkInterpolateImageFunction.h
itk::PCAShapeSignedDistanceFunction::m_Interpolators
InterpolatorPointerVector m_Interpolators
Definition: itkPCAShapeSignedDistanceFunction.h:202
itk::PCAShapeSignedDistanceFunction::GetNumberOfPoseParameters
unsigned int GetNumberOfPoseParameters() const override
Definition: itkPCAShapeSignedDistanceFunction.h:169
itk::InterpolateImageFunction
Base class for all image interpolators.
Definition: itkInterpolateImageFunction.h:44
itk::PCAShapeSignedDistanceFunction::ImagePointerVector
std::vector< ImagePointer > ImagePointerVector
Definition: itkPCAShapeSignedDistanceFunction.h:106
itk::PCAShapeSignedDistanceFunction::PointType
typename Superclass::PointType PointType
Definition: itkPCAShapeSignedDistanceFunction.h:98