A Versor *IS* a rotation.
A versor is represented using the three first components
of a Quaternion.
The four components of a Quaternion correspond to:
q0 = Ax * sin( T / 2 )
q1 = Ay * sin( T / 2 )
q2 = Az * sin( T / 2 )
q3 = cos( T / 2 )
where (Ax,Ay,Az) are the components of the axis
of rotation and T is the angle of rotation.
Versors are composed of only the components
q0,q1,q2
| 1 0 0 dx | T(dx,dy,dz) = | 0 1 0 dy | | 0 0 1 dz | | 0 0 0 1 |
| sx 0 0 0 | S(sx,sy,sz) = | 0 sy 0 0 | | 0 0 sz 0 | | 0 0 0 1 |
1. Versor + ChangeImageInformationFilter| 1 0 0 0 | Rx(A) = | 0 cos A -sin A 0 | | 0 sin A cos A 0 | | 0 0 0 1 | | cos A 0 sin A 0 | Ry(A) = | 0 1 0 0 | | -sin A 0 cos A 0 | | 0 0 0 1 | | cos A -sin A 0 0 | Rz(A) = | sin A cos A 0 0 | | 0 0 1 0 | | 0 0 0 1 |
itk :: Versor < double > rotation ;double angleInRadians = additionalAngle * vnl_math :: pi / 180.0 ;rotation . SetRotationAroundZ ( angleInRadians );ImageType :: DirectionType newDirection = direction * rotation . GetMatrix ();filter -> SetOutputDirection ( newDirection );filter -> ChangeDirectionOn ();
只需决定A, 及寻转轴
2. Euler3DTransform + ResampleImageFilter
of a vector space (e.g. space coordinates)
This transform applies a rotation and translation to the space given 3 euler angles and a 3D translation. Rotation is about a user specified center.
The parameters for this transform can be set either using individual Set methods or in serialized form using SetParameters() and SetFixedParameters().
The serialization of the optimizable parameters is an array of 6 elements. The first 3 represents three euler angle of rotation respectively about the X, Y and Z axis. The last 3 parameters defines the translation in each dimension.
The serialization of the fixed parameters is an array of 3 elements defining the center of rotation.
需决定三个euler角
3. Quaternion + ChangeImageInformationFilter
需决定A, 及旋转轴
只是多了 translation的功能, 用versor即可
4. Rigid3DTransform + ResampleImageFilter
of a vector space (e.g. space coordinates)
This transform applies a rotation and translation in 3D space. The transform is specified as a rotation matrix around a arbitrary center and is followed by a translation.
The parameters for this transform can be set either using individual Set methods or in serialized form using SetParameters() and SetFixedParameters().
The serialization of the optimizable parameters is an array of 12 elements. The first 9 parameters represents the rotation matrix in row-major order (where the column index varies the fastest). The last 3 parameters defines the translation in each dimension.
The serialization of the fixed parameters is an array of 3 elements defining the center of rotation in each dimension.
要制定 3*3旋转矩阵, 一列大小为 3的列向量
5. AffineTransform 的 Rotate3D + ResampleImageFilter
慎用