18 #ifndef __itkAffineTransform_h
19 #define __itkAffineTransform_h
100 class TScalarType = double,
102 unsigned int NDimensions = 3 >
128 NDimensions *( NDimensions + 1 ) );
175 void Scale(
const TScalarType & factor,
bool pre = 0);
192 void Rotate(
int axis1,
int axis2, TScalarType angle,
bool pre = 0);
208 void Rotate2D(TScalarType angle,
bool pre = 0);
236 void Shear(
int axis1,
int axis2, TScalarType coef,
bool pre = 0);
313 #if !defined(ITK_LEGACY_REMOVE)
315 template<
class TScalarType,
unsigned int NDimensions >
321 <<
"BackTransform(): This method is slated to be removed "
322 <<
"from ITK. Instead, please use GetInverse() to generate an inverse "
323 <<
"transform and then perform the transform using that inverted transform.");
324 return this->GetInverseMatrix() * vect;
329 template<
class TScalarType,
unsigned int NDimensions >
331 typename AffineTransform< TScalarType, NDimensions >::InputVnlVectorType
332 AffineTransform< TScalarType, NDimensions >::BackTransform(
const OutputVnlVectorType & vect)
const
335 <<
"BackTransform(): This method is slated to be removed "
336 <<
"from ITK. Instead, please use GetInverse() to generate an inverse "
337 <<
"transform and then perform the transform using that inverted transform.");
338 return this->GetInverseMatrix() * vect;
343 template<
class TScalarType,
unsigned int NDimensions >
345 typename AffineTransform< TScalarType, NDimensions >::InputCovariantVectorType
346 AffineTransform< TScalarType, NDimensions >::BackTransform(
const OutputCovariantVectorType & vec)
const
349 <<
"BackTransform(): This method is slated to be removed "
350 <<
"from ITK. Instead, please use GetInverse() to generate an inverse "
351 <<
"transform and then perform the transform using that inverted transform.");
353 InputCovariantVectorType result;
355 for (
unsigned int i = 0; i < NDimensions; i++ )
358 for (
unsigned int j = 0; j < NDimensions; j++ )
360 result[i] += this->GetMatrix()[j][i] * vec[j];
367 template<
class TScalarType,
unsigned int NDimensions >
369 typename AffineTransform< TScalarType, NDimensions >::InputPointType
370 AffineTransform< TScalarType, NDimensions >::BackTransformPoint(
const OutputPointType & point)
const
372 return this->BackTransform(point);
376 template<
class TScalarType,
unsigned int NDimensions >
378 typename AffineTransform< TScalarType, NDimensions >::InputPointType
379 AffineTransform< TScalarType, NDimensions >::BackTransform(
const OutputPointType & point)
const
382 <<
"BackTransform(): This method is slated to be removed "
383 <<
"from ITK. Instead, please use GetInverse() to generate an inverse "
384 <<
"transform and then perform the transform using that inverted transform.");
385 InputPointType result;
386 ScalarType temp[NDimensions];
390 for ( j = 0; j < NDimensions; j++ )
392 temp[j] = point[j] - this->GetOffset()[j];
395 for ( i = 0; i < NDimensions; i++ )
398 for ( j = 0; j < NDimensions; j++ )
400 result[i] += this->GetInverseMatrix()[i][j] * temp[j];
408 #ifndef ITK_MANUAL_INSTANTIATION
409 #include "itkAffineTransform.hxx"