ITK  4.13.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:
75  TCoordRep, VSpaceDimension > Superclass;
76 
79 
81  itkTypeMacro(PCAShapeSignedDistanceFunction, ShapeSignedDistancFunction);
82 
84  itkNewMacro(Self);
85 
87  itkStaticConstMacro(SpaceDimension, unsigned int, Superclass::SpaceDimension);
88 
90  typedef typename Superclass::CoordRepType CoordRepType;
91 
93  typedef typename Superclass::InputType InputType;
94 
96  typedef typename Superclass::OutputType OutputType;
97 
99  typedef typename Superclass::PointType PointType;
100 
103 
105  typedef TImage ImageType;
106  typedef typename ImageType::Pointer ImagePointer;
107  typedef std::vector< ImagePointer > ImagePointerVector;
108 
110  typedef Transform< CoordRepType,
111  itkGetStaticConstMacro(SpaceDimension),
112  itkGetStaticConstMacro(SpaceDimension) > TransformType;
113 
117  typedef std::vector< InterpolatorPointer > InterpolatorPointerVector;
118 
122  typedef std::vector< ExtrapolatorPointer > ExtrapolatorPointerVector;
123 
127  typedef std::vector< FunctionPointer > FunctionPointerVector;
128 
131  void SetNumberOfPrincipalComponents(unsigned int n);
132 
133  itkGetConstMacro(NumberOfPrincipalComponents, unsigned int);
134 
136  itkSetObjectMacro(MeanImage, ImageType);
137  itkGetModifiableObjectMacro(MeanImage, ImageType);
139 
142  { m_PrincipalComponentImages = v; }
143 // ImagePointerVector & GetPrincipalComponentImages()
144 // { return m_PrincipalComponentImages; }
146 
149  itkSetMacro(PrincipalComponentStandardDeviations, ParametersType);
150  itkGetConstMacro(PrincipalComponentStandardDeviations, ParametersType);
152 
154  itkSetObjectMacro(Transform, TransformType);
155  itkGetModifiableObjectMacro(Transform, TransformType);
157 
159  virtual void SetParameters(const ParametersType &) ITK_OVERRIDE;
160 
161  virtual unsigned int GetNumberOfShapeParameters(void) const ITK_OVERRIDE
162  { return m_NumberOfPrincipalComponents; }
163  virtual unsigned int GetNumberOfPoseParameters(void) const ITK_OVERRIDE
164  { return m_Transform ? m_Transform->GetNumberOfParameters() : 0; }
165 
167  virtual OutputType Evaluate(const PointType & point) const ITK_OVERRIDE;
168 
171  virtual void Initialize() ITK_OVERRIDE;
172 
173 protected:
175  ~PCAShapeSignedDistanceFunction() ITK_OVERRIDE {}
176 
177  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
178 
179 private:
180  ITK_DISALLOW_COPY_AND_ASSIGN(PCAShapeSignedDistanceFunction);
181 
183  unsigned int m_NumberOfPrincipalComponents;
185 
189 
192 
195 
199 };
200 } // end namespace itk
201 
202 #ifndef ITK_MANUAL_INSTANTIATION
203 #include "itkPCAShapeSignedDistanceFunction.hxx"
204 #endif
205 
206 #endif
ShapeSignedDistanceFunction< TCoordRep, VSpaceDimension > Superclass
Light weight base class for most itk classes.
InterpolateImageFunction< ImageType, CoordRepType > InterpolatorType
Compute the signed distance from a N-dimensional PCA Shape.
Base class for functions which evaluates the signed distance from a shape.
ImageFunction< ImageType, double, CoordRepType > FunctionType
Transform< CoordRepType, itkGetStaticConstMacro(SpaceDimension), itkGetStaticConstMacro(SpaceDimension) > TransformType
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:82
std::vector< InterpolatorPointer > InterpolatorPointerVector
virtual unsigned int GetNumberOfPoseParameters(void) const override
ExtrapolateImageFunction< ImageType, CoordRepType > ExtrapolatorType
Base class for all image interpolaters.
Base class for all image extrapolaters.
std::vector< ExtrapolatorPointer > ExtrapolatorPointerVector
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Evaluates a function of an image at specified position.