18 #ifndef __itkAffineTransform_h
19 #define __itkAffineTransform_h
100 typename TScalar = double,
102 unsigned int NDimensions = 3 >
128 NDimensions *( NDimensions + 1 ) );
175 void Scale(
const TScalar & factor,
bool pre = 0);
192 void Rotate(
int axis1,
int axis2, TScalar angle,
bool pre = 0);
208 void Rotate2D(TScalar angle,
bool pre = 0);
236 void Shear(
int axis1,
int axis2, TScalar coef,
bool pre = 0);
313 #if !defined(ITK_LEGACY_REMOVE)
315 template<
typename TScalar,
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<
typename TScalar,
unsigned int NDimensions >
331 typename AffineTransform< TScalar, NDimensions >::InputVnlVectorType
332 AffineTransform< TScalar, 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<
typename TScalar,
unsigned int NDimensions >
345 typename AffineTransform< TScalar, NDimensions >::InputCovariantVectorType
346 AffineTransform< TScalar, 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<
typename TScalar,
unsigned int NDimensions >
369 typename AffineTransform< TScalar, NDimensions >::InputPointType
370 AffineTransform< TScalar, NDimensions >::BackTransformPoint(
const OutputPointType & point)
const
372 return this->BackTransform(point);
376 template<
typename TScalar,
unsigned int NDimensions >
378 typename AffineTransform< TScalar, NDimensions >::InputPointType
379 AffineTransform< TScalar, 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"
Light weight base class for most itk classes.
static const ScalarType Zero
Control indentation during Print() invocation.