38 #ifndef __ItkStatisticalDeformationModelTransform
39 #define __ItkStatisticalDeformationModelTransform
44 #include <itkVector.h>
46 #include "itkStandardImageRepresenter.h"
47 #include "itkStatisticalModel.h"
48 #include "itkStatisticalModelTransformBase.h"
59 template <
class TDataSet,
class TScalarType,
unsigned int TDimension >
67 typedef SmartPointer<Self> Pointer;
68 typedef SmartPointer<const Self> ConstPointer;
70 itkSimpleNewMacro(
Self );
75 typedef typename Superclass::InputPointType InputPointType;
76 typedef typename Superclass::OutputPointType OutputPointType;
77 typedef typename Superclass::RepresenterType RepresenterType;
83 ::itk::LightObject::Pointer smartPtr;
84 Pointer another = Self::New().GetPointer();
85 this->CopyBaseMembers(another);
87 smartPtr =
static_cast<Pointer
>(another);
100 typename RepresenterType::ValueType d;
102 d = this->m_StatisticalModel->DrawSampleAtPoint(this->m_coeff_vector, pt);
103 }
catch (ExceptionObject &e) {
104 std::cout <<
"exception occured at point " << pt << std::endl;
105 std::cout <<
"message " << e.what() << std::endl;
107 OutputPointType transformedPoint;
108 for (
unsigned i = 0; i < pt.GetPointDimension(); i++) {
109 transformedPoint[i] = pt[i] + d[i];
111 return transformedPoint;
116 StatisticalDeformationModelTransform() {}
121 StatisticalDeformationModelTransform(
const StatisticalDeformationModelTransform& orig);
122 StatisticalDeformationModelTransform& operator=(
const StatisticalDeformationModelTransform& rhs);
128 #endif // __ItkStatisticalDeformationModelTransform