ITK  5.0.0
Insight Segmentation and Registration 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,
66  unsigned int VSpaceDimension,
67  typename TImage = Image< double, VSpaceDimension > >
68 class ITK_TEMPLATE_EXPORT PCAShapeSignedDistanceFunction:
69  public ShapeSignedDistanceFunction< TCoordRep, VSpaceDimension >
70 {
71 public:
72  ITK_DISALLOW_COPY_AND_ASSIGN(PCAShapeSignedDistanceFunction);
73 
77  TCoordRep, VSpaceDimension >;
78 
81 
83  itkTypeMacro(PCAShapeSignedDistanceFunction, ShapeSignedDistancFunction);
84 
86  itkNewMacro(Self);
87 
89  static constexpr unsigned int SpaceDimension = Superclass::SpaceDimension;
90 
92  using CoordRepType = typename Superclass::CoordRepType;
93 
95  using InputType = typename Superclass::InputType;
96 
98  using OutputType = typename Superclass::OutputType;
99 
102 
105 
107  using ImageType = TImage;
108  using ImagePointer = typename ImageType::Pointer;
109  using ImagePointerVector = std::vector< ImagePointer >;
110 
113  Self::SpaceDimension,
114  Self::SpaceDimension >;
115 
119  using InterpolatorPointerVector = std::vector< InterpolatorPointer >;
120 
124  using ExtrapolatorPointerVector = std::vector< ExtrapolatorPointer >;
125 
129  using FunctionPointerVector = std::vector< FunctionPointer >;
130 
133  void SetNumberOfPrincipalComponents(unsigned int n);
134 
135  itkGetConstMacro(NumberOfPrincipalComponents, unsigned int);
136 
138  itkSetObjectMacro(MeanImage, ImageType);
139  itkGetModifiableObjectMacro(MeanImage, ImageType);
141 
144  { m_PrincipalComponentImages = v; }
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 SetParameters(const ParametersType &) override;
162 
163  unsigned int GetNumberOfShapeParameters() const override
164  { return m_NumberOfPrincipalComponents; }
165  unsigned int GetNumberOfPoseParameters() const override
166  { return m_Transform ? m_Transform->GetNumberOfParameters() : 0; }
167 
169  OutputType Evaluate(const PointType & point) const override;
170 
173  void Initialize() override;
174 
175 protected:
177  ~PCAShapeSignedDistanceFunction() override = default;
178 
179  void PrintSelf(std::ostream & os, Indent indent) const override;
180 
181 private:
185 
189 
192 
195 
199 };
200 } // end namespace itk
201 
202 #ifndef ITK_MANUAL_INSTANTIATION
203 #include "itkPCAShapeSignedDistanceFunction.hxx"
204 #endif
205 
206 #endif
Light weight base class for most itk classes.
unsigned int GetNumberOfShapeParameters() const override
Compute the signed distance from a N-dimensional PCA Shape.
typename ExtrapolatorType::Pointer ExtrapolatorPointer
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:83
typename Superclass::CoordRepType CoordRepType
typename Superclass::ParametersType ParametersType
std::vector< ExtrapolatorPointer > ExtrapolatorPointerVector
Base class for all image interpolaters.
Base class for all image extrapolaters.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename InterpolatorType::Pointer InterpolatorPointer
Evaluates a function of an image at specified position.
std::vector< InterpolatorPointer > InterpolatorPointerVector