ITK  4.9.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 > >
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 
91 
93  typedef typename Superclass::InputType InputType;
94 
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 
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
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()
172  throw ( ExceptionObject ) ITK_OVERRIDE;
173 
174 protected:
176  ~PCAShapeSignedDistanceFunction(){}
177 
178  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
179 
180 private:
181  PCAShapeSignedDistanceFunction(const Self &) ITK_DELETE_FUNCTION;
182  void operator=(const Self &) ITK_DELETE_FUNCTION;
183 
187 
191 
194 
197 
201 };
202 } // end namespace itk
203 
204 #ifndef ITK_MANUAL_INSTANTIATION
205 #include "itkPCAShapeSignedDistanceFunction.hxx"
206 #endif
207 
208 #endif
ShapeSignedDistanceFunction< TCoordRep, VSpaceDimension > Superclass
Light weight base class for most itk classes.
virtual void SetParameters(const ParametersType &) override
InterpolateImageFunction< ImageType, CoordRepType > InterpolatorType
virtual OutputType Evaluate(const PointType &point) const override
Compute the signed distance from a N-dimensional PCA Shape.
virtual unsigned int GetNumberOfShapeParameters(void) const override
virtual void Initialize() override
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
void SetNumberOfPrincipalComponents(unsigned int n)
Standard exception handling object.
void PrintSelf(std::ostream &os, Indent indent) const override
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.