15 #ifndef itkAffineTransform2D3D_h
16 #define itkAffineTransform2D3D_h
20 #include <itkMatrix.h>
21 #include <itkMatrixOffsetTransformBase.h>
22 #include <itkExceptionObject.h>
29 class TScalarType=double,
31 unsigned int NDimensions=3>
33 :
public MatrixOffsetTransformBase< TScalarType, NDimensions, NDimensions >
38 typedef MatrixOffsetTransformBase< TScalarType,
51 itkStaticConstMacro(InputSpaceDimension,
unsigned int, NDimensions);
52 itkStaticConstMacro(OutputSpaceDimension,
unsigned int, NDimensions);
53 itkStaticConstMacro(SpaceDimension,
unsigned int, NDimensions);
54 itkStaticConstMacro(ParametersDimension,
unsigned int,
55 NDimensions*(NDimensions+1));
68 typedef typename Superclass::InputCovariantVectorType
70 typedef typename Superclass::OutputCovariantVectorType
84 virtual void SetParameters(
const ParametersType & parameters );
87 virtual const ParametersType& GetParameters(
void)
const;
89 void Translate(
const OutputVectorType &trans);
91 void Scale(
const OutputVectorType &factor);
93 void Rotate(
const OutputVectorType &
angle);
95 void Shear(
const OutputVectorType &coef);
98 bool GetInverse(Self* inverse)
const;
101 virtual InverseTransformBasePointer GetInverseTransform()
const;
111 inline InputPointType BackTransform(
const OutputPointType &point )
const;
112 inline InputVectorType BackTransform(
const OutputVectorType &vector)
const;
113 inline InputVnlVectorType BackTransform(
114 const OutputVnlVectorType &vector)
const;
127 inline InputPointType BackTransformPoint(
const OutputPointType &point)
const;
140 ScalarType Metric(
const Self * other)
const;
145 ScalarType Metric(
void)
const;
156 const OutputVectorType &
offset);
158 unsigned int paramDims);
162 virtual void ComputeMatrixParameters(
void);
165 virtual void ComputeMatrix(
void);
171 void PrintSelf(std::ostream &
s, Indent indent)
const;
174 Matrix<TScalarType,NDimensions+1,NDimensions+1>
m_Scales;
175 Matrix<TScalarType,NDimensions+1,NDimensions+1>
m_Shears;
183 const Self & operator=(
const Self & );
188 template<
class TScalarType,
unsigned int NDimensions>
194 return this->GetInverseMatrix() * vect;
199 template<
class TScalarType,
unsigned int NDimensions>
205 return this->GetInverseMatrix() * vect;
210 template<
class TScalarType,
unsigned int NDimensions>
218 for (
unsigned int i = 0; i < NDimensions; i++)
220 result[i] = NumericTraits<ScalarType>::Zero;
221 for (
unsigned int j = 0; j < NDimensions; j++)
223 result[i] += this->GetMatrix()[j][i]*vec[j];
231 template<
class TScalarType,
unsigned int NDimensions>
237 return this->BackTransform(point);
241 template<
class TScalarType,
unsigned int NDimensions>
251 for (j = 0; j < NDimensions; j++)
253 temp[j] = point[j] - this->GetOffset()[j];
256 for (i = 0; i < NDimensions; i++)
259 for (j = 0; j < NDimensions; j++)
261 result[i] += this->GetInverseMatrix()[i][j]*temp[j];
270 #define ITK_TEMPLATE_AffineTransform2D3D(_, EXPORT, x, y) namespace itk { \
271 _(2(class EXPORT AffineTransform2D3D< ITK_TEMPLATE_2 x >)) \
272 namespace Templates { typedef AffineTransform2D3D< ITK_TEMPLATE_2 x > \
273 AffineTransform2D3D##y; } \
276 #if ITK_TEMPLATE_EXPLICIT
277 # include "Templates/itkAffineTransform2D3D+-.h"
281 # include "itkAffineTransform2D3D.txx"
Definition: niftkITKAffineResampleImage.cxx:74
itk::Point< double, 2 > InputPointType
Definition: EulerAffine2DJacobianTest.cxx:34
vnl_matrix< double > MatrixType
Definition: itkSuperEllipseFit.h:32
GLintptr offset
Definition: glew.h:1666
GLuint64EXT * result
Definition: glew.h:12084
itk::Array< double > TranslationType
Definition: EulerAffine2DJacobianTest.cxx:30
GLuint GLenum matrix
Definition: glew.h:12775
GLdouble angle
Definition: glew.h:7898
GLdouble s
Definition: glew.h:1374
itk::Point< double, 2 > OutputPointType
Definition: EulerAffine2DJacobianTest.cxx:35
itk::Array2D< double > JacobianType
Definition: EulerAffine2DJacobianTest.cxx:28