[Insight-users] Euler3DTransform, Rotation Matrix & Initial Parameters - Continued

Luis Ibanez luis.ibanez at kitware.com
Wed Jul 14 13:21:11 EDT 2004


Hi Neilson,

The class Euler3DTransform has a method for converting
a 3X3 rotation matrix into the 3 rotaion angles.
Note that from your 4x4 matrix, only the upper left
3x3 submatrix contains information about rotations.

http://www.itk.org/Insight/Doxygen/html/classitk_1_1Euler3DTransform.html

it is the method

    ComputeAnglesFromMatrix()

This is a protected method because you don't really need
to use it. But if you are curious about the implementation
you may want to take a look at the .txx file.


Note also that you don't need to do this angle computation
since you can initialize the transform with the 3X3 rotation
matrix and a translation, then call  GetParamters() on the
transform, and finally pass that array of parameters to the
ImageRegistrationMethod.


The code will look like:


    MatrixType rotation = Extract3by3MatrixFromYours();
    OffsetType translat = Extract3VectorFromYours();

    euler3DTransform->SetRotationMatrix( rotation );
    euler3DTransform->SetOffset( translat );

    TransformType::ParametersType parameters =
                         euler3DTransform->GetParameters();


    registrationMethod->SetInitialParameters( parameters );





Please let us know if you have further questions



   Thanks,



      Luis



-------------------------------
N.E. Mackenzie Mackay wrote:

> I am trying to initialize Euler3DTransform in order to perform a rigid  
> registration.  I have a rotation matrix that I wish to use to  
> initialize the transformation.  After reading  
> http://public.kitware.com/pipermail/insight-users/2003-November/ 
> 005506.html it looks like this is impossible, the only way to  
> initialize the transformation is to set angles and translation  explicitly.
> 
> If this is the case I was wondering if anyone knew a way to extract the  
> 3 angles from a 4x4 homogenous matrix?
> 
> Thanks
> Neilson
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 





More information about the Insight-users mailing list