ITK  4.3.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 
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 
102  typedef typename Superclass::ParametersType ParametersType;
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  itkGetObjectMacro(MeanImage, ImageType);
139 
141  void SetPrincipalComponentImages(ImagePointerVector v)
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  itkGetObjectMacro(Transform, TransformType);
157 
159  virtual void SetParameters(const ParametersType &);
160 
161  virtual unsigned int GetNumberOfShapeParameters(void) const
162  { return m_NumberOfPrincipalComponents; }
163  virtual unsigned int GetNumberOfPoseParameters(void) const
164  { return m_Transform ? m_Transform->GetNumberOfParameters() : 0; }
165 
167  virtual OutputType Evaluate(const PointType & point) const;
168 
171  virtual void Initialize()
172  throw ( ExceptionObject );
173 
174 protected:
176  ~PCAShapeSignedDistanceFunction(){}
177 
178  void PrintSelf(std::ostream & os, Indent indent) const;
179 
180 private:
181  PCAShapeSignedDistanceFunction(const Self &); //purposely not implemented
182  void operator=(const Self &); //purposely not implemented
183 
187 
191 
194 
198 
202 };
203 } // end namespace itk
204 
205 #ifndef ITK_MANUAL_INSTANTIATION
206 #include "itkPCAShapeSignedDistanceFunction.hxx"
207 #endif
208 
209 #endif
210