itk几个可以实现rotate的filter

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 

3D transforms

  • All transformations directly extend to 3D
  • Translation:
               | 1 0 0 dx |
T(dx,dy,dz) =  | 0 1 0 dy |
               | 0 0 1 dz |
               | 0 0 0 1  |
  • Scaling:
               | sx  0  0  0 |
S(sx,sy,sz) =  |  0 sy  0  0 |
               |  0  0 sz  0 |
               |  0  0  0  1 |
  • Rotation:
        | 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 |

1.  Versor + ChangeImageInformationFilter

 
 
  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

慎用


A Versor *IS* a rotation. 

A versor is represented using the three first components 
of a Quaternion. 

Please read the tutorial on Quaternions: 

      http://www.itk.org/CourseWare/Training/QuaternionsI.pdf
      http://www.itk.org/CourseWare/Training/QuaternionsII.pdf

and the description of Versors in the Wikipedia: 

        http://en.wikipedia.org/wiki/Versor

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 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值