18 #ifndef itkAffineTransform_h
19 #define itkAffineTransform_h
100 typename TParametersValueType = double,
101 unsigned int NDimensions = 3 >
123 itkStaticConstMacro(InputSpaceDimension,
unsigned int, NDimensions);
124 itkStaticConstMacro(OutputSpaceDimension,
unsigned int, NDimensions);
125 itkStaticConstMacro(SpaceDimension,
unsigned int, NDimensions);
126 itkStaticConstMacro( ParametersDimension,
unsigned int,
127 NDimensions *( NDimensions + 1 ) );
175 void Scale(
const TParametersValueType & factor,
bool pre = 0);
192 void Rotate(
int axis1,
int axis2, TParametersValueType angle,
bool pre = 0);
208 void Rotate2D(TParametersValueType angle,
bool pre = 0);
223 void Rotate3D(
const OutputVectorType & axis, TParametersValueType angle,
bool pre = 0);
236 void Shear(
int axis1,
int axis2, TParametersValueType coef,
bool pre = 0);
239 bool GetInverse(
Self *inverse)
const;
305 void PrintSelf(std::ostream & s,
Indent indent) const ITK_OVERRIDE;
310 const
Self & operator=(const
Self &);
313 #if !defined(ITK_LEGACY_REMOVE)
315 template<
typename TParametersValueType,
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 TParametersValueType,
unsigned int NDimensions>
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 TParametersValueType,
unsigned int NDimensions>
345 typename AffineTransform<TParametersValueType, NDimensions>::InputCovariantVectorType
346 AffineTransform<TParametersValueType, 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 TParametersValueType,
unsigned int NDimensions>
369 typename AffineTransform<TParametersValueType, NDimensions>::InputPointType
370 AffineTransform<TParametersValueType, NDimensions>::BackTransformPoint(
const OutputPointType & point)
const
372 return this->BackTransform(point);
376 template<
typename TParametersValueType,
unsigned int NDimensions>
378 typename AffineTransform<TParametersValueType, NDimensions>::InputPointType
379 AffineTransform<TParametersValueType, 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.
Control indentation during Print() invocation.