ITK
6.0.0
Insight Toolkit
|
#include <itkVersor.h>
A templated class holding a unit quaternion.
Versor is a templated class that holds a unit quaternion. The difference between versors and quaternions is that quaternions can represent rotations and scale changes while versors are limited to rotations.
This class only implements the operations that maintain versors as a group, that is, any operations between versors result in another versor. For this reason, addition is not defined in this class, even though it is a valid operation between quaternions.
Definition at line 52 of file itkVersor.h.
Public Types | |
using | CovariantVectorType = CovariantVector< T, 3 > |
using | MatrixType = Matrix< T, 3, 3 > |
using | PointType = Point< T, 3 > |
using | RealType = typename NumericTraits< ValueType >::RealType |
using | Self = Versor |
using | ValueType = T |
using | VectorType = Vector< T, 3 > |
using | VnlQuaternionType = vnl_quaternion< T > |
using | VnlVectorType = vnl_vector_fixed< T, 3 > |
Static Private Member Functions | |
static ValueType | Epsilon (double *) |
static ValueType | Epsilon (float *) |
static ValueType | Epsilon () |
Private Attributes | |
ValueType | m_W { NumericTraits<T>::OneValue() } |
ValueType | m_X {} |
ValueType | m_Y {} |
ValueType | m_Z {} |
using itk::Versor< T >::CovariantVectorType = CovariantVector<T, 3> |
CovariantVector type.
Definition at line 72 of file itkVersor.h.
using itk::Versor< T >::MatrixType = Matrix<T, 3, 3> |
Type of the rotation matrix equivalent to the Versor
Definition at line 81 of file itkVersor.h.
using itk::Versor< T >::PointType = Point<T, 3> |
Point type.
Definition at line 69 of file itkVersor.h.
using itk::Versor< T >::RealType = typename NumericTraits<ValueType>::RealType |
Type used for computations on the versor components
Definition at line 63 of file itkVersor.h.
using itk::Versor< T >::Self = Versor |
Standard class type aliases.
Definition at line 56 of file itkVersor.h.
using itk::Versor< T >::ValueType = T |
ValueType can be used to declare a variable that is the same type as a data element held in a Versor.
Definition at line 60 of file itkVersor.h.
using itk::Versor< T >::VectorType = Vector<T, 3> |
Vector type used to represent the axis.
Definition at line 66 of file itkVersor.h.
using itk::Versor< T >::VnlQuaternionType = vnl_quaternion<T> |
Vnl Quaternion type.
Definition at line 78 of file itkVersor.h.
using itk::Versor< T >::VnlVectorType = vnl_vector_fixed<T, 3> |
Vnl Vector type.
Definition at line 75 of file itkVersor.h.
|
inlinestaticprivate |
use different epsilon for float and double
Definition at line 315 of file itkVersor.h.
|
inlinestaticprivate |
use different epsilon for float and double
Definition at line 305 of file itkVersor.h.
References itk::Math::e.
|
inlinestaticprivate |
use different epsilon for float and double
Definition at line 310 of file itkVersor.h.
References itk::Math::e.
Self itk::Versor< T >::Exponential | ( | ValueType | exponent | ) | const |
Compute the Exponential of the unit quaternion. Exponentiation by a factor is equivalent to multiplication of the rotation angle of the quaternion.
ValueType itk::Versor< T >::GetAngle | ( | ) | const |
Returns the rotation angle in radians.
VectorType itk::Versor< T >::GetAxis | ( | ) | const |
Returns the axis of the rotation. It is a unit vector parallel to the axis.
Self itk::Versor< T >::GetConjugate | ( | ) | const |
Get Conjugate versor. Returns the versor that produce a rotation by the same angle but in opposite direction.
MatrixType itk::Versor< T >::GetMatrix | ( | ) | const |
Get the matrix representation.
Self itk::Versor< T >::GetReciprocal | ( | ) | const |
Get Reciprocal versor. Returns the versor that composed with this one will result in a scalar operator equals to 1. It is also equivalent to 1/this.
VectorType itk::Versor< T >::GetRight | ( | ) | const |
Returns the Right part It is a vector part of the Versor. It is called Right because it is equivalent to a right angle rotation.
ValueType itk::Versor< T >::GetScalar | ( | ) | const |
Returns the Scalar part.
ValueType itk::Versor< T >::GetTensor | ( | ) | const |
Get Tensor part of the Versor. Given that Versors are normalized quaternions this value is expected to be 1.0 always
vnl_quaternion< T > itk::Versor< T >::GetVnlQuaternion | ( | ) | const |
Get a vnl_quaternion with a copy of the internal memory block.
|
inline |
Returns the W component.
Definition at line 193 of file itkVersor.h.
Referenced by itk::operator<<().
|
inline |
Returns the X component.
Definition at line 172 of file itkVersor.h.
Referenced by itk::operator<<().
|
inline |
Returns the Y component.
Definition at line 179 of file itkVersor.h.
Referenced by itk::operator<<().
|
inline |
Returns the Z component.
Definition at line 186 of file itkVersor.h.
Referenced by itk::operator<<().
itk::Versor< T >::ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION | ( | Self | ) |
void itk::Versor< T >::Normalize | ( | ) |
Normalize the Versor. Given that Versors are normalized quaternions this method is provided only for convenience when it is suspected that a versor could be out of the unit sphere.
Self itk::Versor< T >::operator* | ( | const Self & | v | ) | const |
Versor operator*. Performs the composition of two versors. this operation is NOT commutative.
const Self & itk::Versor< T >::operator*= | ( | const Self & | v | ) |
Composition operator *=. Compose the current versor with the operand and store the result in the current versor.
Self itk::Versor< T >::operator/ | ( | const Self & | v | ) | const |
Versor operator/. Performs the division of two versors.
const Self & itk::Versor< T >::operator/= | ( | const Self & | v | ) |
Division operator /=. Divide the current versor with the operand and store the result in the current versor. This is equivalent to compose the Versor with the reciprocal of the operand
bool itk::Versor< T >::operator== | ( | const Self & | v | ) | const |
Versor operator== Performs the comparison between two versors. this operation uses an arbitrary threshold for the comparison.
void itk::Versor< T >::Set | ( | const MatrixType & | mat | ) |
Set the versor using an orthogonal matrix. Based on code from: https://www.euclideanspace.com/maths/geometry/rotations/ conversions/matrixToQuaternion/index.htm
void itk::Versor< T >::Set | ( | const VectorType & | axis | ) |
Set the versor using the right part. the magnitude of the vector given is assumed to be equal to std::sin(angle/2). This method will compute internally the scalar part that preserve the Versor as a unit quaternion.
void itk::Versor< T >::Set | ( | const VectorType & | axis, |
ValueType | angle | ||
) |
Set the versor using a vector and angle.
The unit vector parallel to the given vector will be used. The angle is expected in radians.
void itk::Versor< T >::Set | ( | const VnlQuaternionType & | ) |
void itk::Versor< T >::Set | ( | T | x, |
T | y, | ||
T | z, | ||
T | w | ||
) |
Set the Versor from Quaternion components.
void itk::Versor< T >::SetIdentity | ( | ) |
Reset the values so the versor is equivalent to an identity transformation. This is equivalent to set a zero angle
void itk::Versor< T >::SetRotationAroundX | ( | ValueType | angle | ) |
Sets a rotation around the X axis using the parameter as angle in radians. This is a method provided for convenience to initialize a rotation. The effect of this methods is not cumulative with any value previously stored in the Versor.
void itk::Versor< T >::SetRotationAroundY | ( | ValueType | angle | ) |
Sets a rotation around the Y axis using the parameter as angle in radians. This is a method provided for convenience to initialize a rotation. The effect of this methods is not cumulative with any value previously stored in the Versor.
void itk::Versor< T >::SetRotationAroundZ | ( | ValueType | angle | ) |
Sets a rotation around the Y axis using the parameter as angle in radians. This is a method provided for convenience to initialize a rotation. The effect of this methods is not cumulative with any value previously stored in the Versor.
Self itk::Versor< T >::SquareRoot | ( | ) | const |
Get the Square root of the unit quaternion.
CovariantVectorType itk::Versor< T >::Transform | ( | const CovariantVectorType & | v | ) | const |
Transform a covariant vector.
Given that this is an orthogonal transformation CovariantVectors are transformed as vectors.
PointType itk::Versor< T >::Transform | ( | const PointType & | v | ) | const |
Transform a point.
VectorType itk::Versor< T >::Transform | ( | const VectorType & | v | ) | const |
Transform a vector.
VnlVectorType itk::Versor< T >::Transform | ( | const VnlVectorType & | v | ) | const |
Transform a vnl_vector.
|
private |
Escalar component of the Versor.
Definition at line 331 of file itkVersor.h.
|
private |
Component parallel to x axis.
Definition at line 322 of file itkVersor.h.
|
private |
Component parallel to y axis.
Definition at line 325 of file itkVersor.h.
|
private |
Component parallel to z axis.
Definition at line 328 of file itkVersor.h.