Transform representing relative positions and orientations in 3D space. More...
#include <igstkTransform.h>
Public Types | |
typedef ::itk::Vector< double, 3 > | VectorType |
typedef ::itk::Point< double, 3 > | PointType |
typedef ::itk::Versor< double > | VersorType |
typedef double | ErrorType |
typedef TimeStamp::TimePeriodType | TimePeriodType |
Public Member Functions | |
Transform () | |
Constructor and destructor. | |
Transform (const Transform &t) | |
virtual | ~Transform () |
const Transform & | operator= (const Transform &inputTransform) |
Assign the values of one transform to another. | |
void | SetTranslationAndRotation (const VectorType &translation, const VersorType &rotation, ErrorType errorValue, TimePeriodType millisecondsToExpiration) |
Set Translation and Rotation simultaneously. | |
void | SetRotation (const VersorType &rotation, ErrorType errorValue, TimePeriodType millisecondsToExpiration) |
Set only Rotation. | |
void | SetTranslation (const VectorType &translation, ErrorType errorValue, TimePeriodType millisecondsToExpiration) |
Set only Translation. | |
virtual VectorType | GetTranslation () |
Returns the translational component. | |
virtual VersorType | GetRotation () |
Returns the rotational component. | |
virtual ErrorType | GetError () |
Returns the translational error of this transform. | |
TimePeriodType | GetStartTime () const |
Returns the time at which the validity of this information starts. | |
TimePeriodType | GetExpirationTime () const |
Returns the time at which the validity of this information expires. | |
bool | IsValidAtTime (TimePeriodType timeToTestInMilliseconds) const |
Returns the validity status of the transform at the time passed as argument. | |
bool | IsValidNow () const |
Returns the validity status of the transform when it is called. | |
void | ExportTransform (vtkMatrix4x4 &matrix) const |
Export the content of the transformation in the format of a vtkMatrix4x4. | |
bool | operator== (const Transform &inputTransform) |
Compare two transforms for equivalence, in the sense that these are the same objects in memory. | |
bool | operator!= (const Transform &inputTransform) |
bool | IsNumericallyEquivalent (const Transform &inputTransform, double tol=vnl_math::eps) const |
Compare two transforms for equivalence. | |
bool | IsIdentity (double tol=vnl_math::eps) const |
Evaluate if the Transform is an Identity upto a given tolerance. | |
void | SetToIdentity (TimePeriodType validityPeriodInMilliseconds) |
Resets the Transform to an Identity Transform. | |
void | Print (std::ostream &os, itk::Indent indent) const |
Method for printing the member variables of this class to an ostream. | |
Transform | GetInverse () const |
Returns the Inverse Transform of the current one. | |
Static Public Member Functions | |
static Transform | TransformCompose (Transform leftTransform, Transform rightTransform) |
Transform composition method. | |
Protected Member Functions | |
void | PrintHeader (std::ostream &os, itk::Indent indent) const |
void | PrintTrailer (std::ostream &itkNotUsed(os), itk::Indent itkNotUsed(indent)) const |
virtual void | PrintSelf (std::ostream &os, itk::Indent indent) const |
Print the object information in a stream. |
Transform representing relative positions and orientations in 3D space.
This class represents relative positions and orientations in 3D space. It is intended to be used for positioning objects in the scene and as a communication vehicle between trackers and spatial objects. The class contains a TimeStamp defining the validity period for the information in the transform.
This class can be used for storing Translation and Rotation simultaneously, or only Translation, or only Rotation. When only Translation or only Rotation are used, the other component of the transform is set to an identity. If the user intends to use both rotations and translation, she must invoke the SetTranslationAndRotation() method.
All the set methods require an argument that defines the number of milliseconds for which the stored information is considered to be valid. The validity period will be counted from the moment the Set method was invoked.
Definition at line 56 of file igstkTransform.h.
typedef ::itk::Vector<double, 3> igstk::Transform::VectorType |
Definition at line 60 of file igstkTransform.h.
typedef ::itk::Point<double, 3> igstk::Transform::PointType |
Definition at line 61 of file igstkTransform.h.
typedef ::itk::Versor<double> igstk::Transform::VersorType |
Definition at line 62 of file igstkTransform.h.
typedef double igstk::Transform::ErrorType |
Definition at line 63 of file igstkTransform.h.
Definition at line 64 of file igstkTransform.h.
igstk::Transform::Transform | ( | ) |
Constructor and destructor.
igstk::Transform::Transform | ( | const Transform & | t | ) |
virtual igstk::Transform::~Transform | ( | ) | [virtual] |
static Transform igstk::Transform::TransformCompose | ( | Transform | leftTransform, | |
Transform | rightTransform | |||
) | [static] |
Transform composition method.
Assign the values of one transform to another.
void igstk::Transform::SetTranslationAndRotation | ( | const VectorType & | translation, | |
const VersorType & | rotation, | |||
ErrorType | errorValue, | |||
TimePeriodType | millisecondsToExpiration | |||
) |
Set Translation and Rotation simultaneously.
This values will override any previously set rotation and translation. The information will be considered valid from the time of invokation of the method until that time plus the millisecondsToExpiration value.
void igstk::Transform::SetRotation | ( | const VersorType & | rotation, | |
ErrorType | errorValue, | |||
TimePeriodType | millisecondsToExpiration | |||
) |
Set only Rotation.
This method should be used when the transform represents only a rotation. Internally the translational part of the transform will be set to zero. The assigned rotation will override any previously set rotation and will set to zero any previous translation. The information will be considered valid from the time of invokation of the method until that time plus the millisecondsToExpiration value.
void igstk::Transform::SetTranslation | ( | const VectorType & | translation, | |
ErrorType | errorValue, | |||
TimePeriodType | millisecondsToExpiration | |||
) |
Set only Translation.
This method should be used when the transform represents only a translation. Internally the rotational part of the transform will be set to zero. The assigned translation will override any previously set translation and will set to zero any previous rotation. The information will be considered valid from the time of invokation of the method until that time plus the millisecondsToExpiration value.
virtual VectorType igstk::Transform::GetTranslation | ( | ) | [virtual] |
Returns the translational component.
Users MUST check the validity time of the transform before attempting to use this returned value. The content of the transform may have expired.
virtual VersorType igstk::Transform::GetRotation | ( | ) | [virtual] |
Returns the rotational component.
Users MUST check the validity time of the transform before attempting to use this returned value. The content of the transform may have expired.
virtual ErrorType igstk::Transform::GetError | ( | ) | [virtual] |
Returns the translational error of this transform.
The correct interpretation of this error my be tracker dependent and therefore must be analyzed carefully.
TimePeriodType igstk::Transform::GetStartTime | ( | ) | const |
Returns the time at which the validity of this information starts.
The data in this transform should not be used for scenes to be rendered before that validity time. The time is returned in milliseconds.
TimePeriodType igstk::Transform::GetExpirationTime | ( | ) | const |
Returns the time at which the validity of this information expires.
The data in this transform should not be used for scenes to be rendered after that validity time. The time is returned in milliseconds.
bool igstk::Transform::IsValidAtTime | ( | TimePeriodType | timeToTestInMilliseconds | ) | const |
Returns the validity status of the transform at the time passed as argument.
The transform values should not be used in a scene if the time when the scene is to be rendered returned 'false' when passed to this IsValid() function. The time is passed in milliseconds.
bool igstk::Transform::IsValidNow | ( | ) | const |
Returns the validity status of the transform when it is called.
void igstk::Transform::ExportTransform | ( | vtkMatrix4x4 & | matrix | ) | const |
Export the content of the transformation in the format of a vtkMatrix4x4.
Users must allocate the matrix first and then pass it by reference to this method. The current method will simply fill in the transform using the current information of translation and rotation.
bool igstk::Transform::operator== | ( | const Transform & | inputTransform | ) |
Compare two transforms for equivalence, in the sense that these are the same objects in memory.
bool igstk::Transform::operator!= | ( | const Transform & | inputTransform | ) |
bool igstk::Transform::IsNumericallyEquivalent | ( | const Transform & | inputTransform, | |
double | tol = vnl_math::eps | |||
) | const |
Compare two transforms for equivalence.
bool igstk::Transform::IsIdentity | ( | double | tol = vnl_math::eps |
) | const |
Evaluate if the Transform is an Identity upto a given tolerance.
void igstk::Transform::SetToIdentity | ( | TimePeriodType | validityPeriodInMilliseconds | ) |
void igstk::Transform::Print | ( | std::ostream & | os, | |
itk::Indent | indent | |||
) | const |
Method for printing the member variables of this class to an ostream.
void igstk::Transform::PrintHeader | ( | std::ostream & | os, | |
itk::Indent | indent | |||
) | const [protected] |
void igstk::Transform::PrintTrailer | ( | std::ostream & | itkNotUsedos, | |
itk::Indent | itkNotUsedindent | |||
) | const [protected] |
virtual void igstk::Transform::PrintSelf | ( | std::ostream & | os, | |
itk::Indent | indent | |||
) | const [protected, virtual] |
Print the object information in a stream.