[Insight-users] Volume not perfectly rotated

Nic itk at fete.ch
Thu Oct 11 10:54:03 EDT 2007


Hi all,
    I have a strange behaviour I would like to correct in my initialisation.
What I do is simply initialize the versorRigid3dTransform with a 180° 
rotation around y-axis and -94.55 rotation around z-axis.
I used quaternion for rotation initialisation like this, as previously 
adviced :

*******************************************************
double RotX = angleX * vnl_math::pi / 180.0;
double RotY = angleY * vnl_math::pi / 180.0;
double RotZ = angleZ * vnl_math::pi / 180.0;
vnl_quaternion<double> RR(RotX,RotY,RotZ);
rotation.Set(RR);
transform->SetRotation( rotation );

[...]
// Checking
VersorType rotationInitiale = transform->GetVersor();
vnl_vector_fixed<double,3> anglesEuleriensInitiaux = (rotationInitiale.GetVnlQuaternion()).rotation_euler_angles();
cout << "Angles d'Euler (initiaux): " << (anglesEuleriensInitiaux*180.0/vnl_math::pi) << endl;

********************************************************

What I doesn't understand actually is why by flipping around X or Y axis by 180°, I get an "half image" at the beginning of the stack
Is this behavious linked to the Quaternions ? Is there a special case for a pi angle ? Is there a way to avoid this behaviour ?

Images:
http://itk.fete.ch/perso/Rot_0_0_0.jpg
http://itk.fete.ch/perso/Rot_0_180_0.jpg
http://itk.fete.ch/perso/Rot_180_0_0.jpg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20071011/272b2720/attachment.html


More information about the Insight-users mailing list