00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
#ifndef _itkPCAShapeSignedDistanceFunction_h
00018
#define _itkPCAShapeSignedDistanceFunction_h
00019
00020
00021
#include "itkShapeSignedDistanceFunction.h"
00022
#include "itkImage.h"
00023
#include "itkInterpolateImageFunction.h"
00024
#include "itkExtrapolateImageFunction.h"
00025
00026
namespace itk
00027 {
00028
00029
00064
template<
typename TCoordRep,
00065
unsigned int VSpaceDimension,
00066
typename TImage = Image<double,VSpaceDimension> >
00067 class ITK_EXPORT PCAShapeSignedDistanceFunction :
00068
public ShapeSignedDistanceFunction<TCoordRep, VSpaceDimension>
00069 {
00070
00071
public:
00073 typedef PCAShapeSignedDistanceFunction
Self;
00074
typedef ShapeSignedDistanceFunction<
00075 TCoordRep, VSpaceDimension>
Superclass;
00076 typedef SmartPointer<Self> Pointer;
00077 typedef SmartPointer<const Self> ConstPointer;
00078
00079
00081
itkTypeMacro(PCAShapeSignedDistanceFunction, ShapeSignedDistancFunction);
00082
00084
itkNewMacro(
Self);
00085
00087
itkStaticConstMacro(SpaceDimension,
unsigned int,Superclass::SpaceDimension);
00088
00089
00091 typedef typename Superclass::CoordRepType
CoordRepType;
00092
00094 typedef typename Superclass::InputType
InputType;
00095
00097 typedef typename Superclass::OutputType
OutputType;
00098
00100 typedef typename Superclass::PointType
PointType;
00101
00103 typedef typename Superclass::ParametersType
ParametersType;
00104
00105
00107 typedef TImage
ImageType;
00108 typedef typename ImageType::Pointer
ImagePointer;
00109 typedef std::vector<ImagePointer>
ImagePointerVector;
00110
00112
typedef Transform<
CoordRepType,
00113
itkGetStaticConstMacro(SpaceDimension),
00114 itkGetStaticConstMacro(SpaceDimension)>
TransformType;
00115
00117 typedef InterpolateImageFunction<ImageType, CoordRepType> InterpolatorType;
00118 typedef typename InterpolatorType::Pointer
InterpolatorPointer;
00119 typedef std::vector<InterpolatorPointer>
InterpolatorPointerVector;
00120
00122 typedef ExtrapolateImageFunction<ImageType, CoordRepType> ExtrapolatorType;
00123 typedef typename ExtrapolatorType::Pointer
ExtrapolatorPointer;
00124 typedef std::vector<ExtrapolatorPointer>
ExtrapolatorPointerVector;
00125
00127 typedef ImageFunction<ImageType, double, CoordRepType> FunctionType;
00128 typedef typename FunctionType::Pointer
FunctionPointer;
00129 typedef std::vector<FunctionPointer>
FunctionPointerVector;
00130
00131
00134
void SetNumberOfPrincipalComponents(
unsigned int n);
00135
itkGetMacro(NumberOfPrincipalComponents,
unsigned int);
00136
00138
itkSetObjectMacro(MeanImage,
ImageType);
00139
itkGetObjectMacro(MeanImage,
ImageType);
00140
00142
void SetPrincipalComponentImages(
ImagePointerVector v)
00143 { m_PrincipalComponentImages = v; }
00144
00145
00146
00149
itkSetMacro(PrincipalComponentStandardDeviations,
ParametersType);
00150
itkGetMacro(PrincipalComponentStandardDeviations,
ParametersType);
00151
00153
itkSetObjectMacro(
Transform,
TransformType);
00154
itkGetObjectMacro(
Transform,
TransformType);
00155
00156
00158
virtual void SetParameters(
const ParametersType & );
00159
virtual const ParametersType& GetParameters(
void)
const
00160
{
return m_Parameters; }
00161
virtual unsigned int GetNumberOfShapeParameters(
void)
const
00162
{
return m_NumberOfPrincipalComponents; }
00163
virtual unsigned int GetNumberOfPoseParameters(
void)
const
00164 {
return m_Transform ? m_Transform->GetNumberOfParameters() : 0; }
00165
00167
virtual OutputType Evaluate(
const PointType& point)
const;
00168
00171
virtual void Initialize() throw ( ExceptionObject );
00172
00173
00174 protected:
00175 PCAShapeSignedDistanceFunction();
00176 ~PCAShapeSignedDistanceFunction(){};
00177
00178
void PrintSelf(std::ostream& os,
Indent indent)
const;
00179
00180
00181
private:
00182 PCAShapeSignedDistanceFunction(
const Self&);
00183
void operator=(
const Self& );
00184
00185
00187
unsigned int m_NumberOfPrincipalComponents;
00188
unsigned int m_NumberOfTransformParameters;
00189
00190
ImagePointer m_MeanImage;
00191
ImagePointerVector m_PrincipalComponentImages;
00192
ParametersType m_PrincipalComponentStandardDeviations;
00193
00195
typename TransformType::Pointer m_Transform;
00196
InterpolatorPointerVector m_Interpolators;
00197
ExtrapolatorPointerVector m_Extrapolators;
00198
mutable FunctionPointerVector m_Selectors;
00199
00201
ParametersType m_WeightOfPrincipalComponents;
00202
ParametersType m_TransformParameters;
00203
00204 };
00205
00206 }
00207
00208
#ifndef ITK_MANUAL_INSTANTIATION
00209
#include "itkPCAShapeSignedDistanceFunction.txx"
00210
#endif
00211
00212
#endif