[Insight-users] Composing VersorRigid3DTransform

Koning, P.J.H. de (LKEB) P.J.H.de_Koning at lumc.nl
Mon Nov 15 09:37:24 EST 2004


Hello,

While is was working on an image registration problem, I noticed something strange when I was composing several VersorRigid3DTransform together. The following example shows this nicely. I create 3 transforms (trans1, trans2, trans3) and set their contents to some value. You can see in the output that the content of the rotation matrix and the versor are in sync. After composing these 3 transforms into a fresh new transform, you can see that the contents of the rotation matrix and the versor are not in sync anymore.

I don't know if you would call this a bug, but I found it surprising.

Could you tell me if this is the intended functionality, or a bug.

Thanks,

Patrick de Koning

/// Example code
typedef itk::VersorRigid3DTransform<double>	TransformType;
typename TransformType::Pointer trans1, trans2, trans3, transTot;
typename TransformType::VersorType versor;
typename TransformType::OutputVectorType translation;
trans1 = TransformType::New();
trans2 = TransformType::New();
trans3 = TransformType::New();
transTot = TransformType::New();

versor.SetRotationAroundX(0.785);
trans1->SetRotation(versor);

translation[0] = 10;
translation[1] = 20;
translation[2] = 30;
trans2->SetTranslation(translation);

versor.SetRotationAroundZ(0.785);
trans3->SetRotation(versor);

transTot->SetIdentity();
transTot->Compose(trans1, true);
transTot->Compose(trans2, true);
transTot->Compose(trans3, true);

std::cerr << "Transform 1: " << std::endl << trans1 << std::endl;
std::cerr << "Transform 2: " << std::endl << trans2 << std::endl;
std::cerr << "Transform 3: " << std::endl << trans3 << std::endl;
std::cerr << "TotalTransform: " << std::endl << transTot << std::endl;

/////////////////////////////////////////////////////////////
// Output

Transform 1:
VersorRigid3DTransform (032B8940)
   RTTI typeinfo:   class itk::VersorRigid3DTransform<double>
   Reference Count: 2
   Modified Time: 23
   Debug: Off
   Observers:
     none
   Offset: 0  0  0
   RotationMatrix: 1 0 0
0 0.707388 -0.706825
0 0.706825 0.707388

   Versor:      [ 0.382499, 0, 0, 0.923956 ]
   Center:      0  0  0
   Translation: 0  0  0


Transform 2:
VersorRigid3DTransform (126D8298)
   RTTI typeinfo:   class itk::VersorRigid3DTransform<double>
   Reference Count: 2
   Modified Time: 27
   Debug: Off
   Observers:
     none
   Offset: 10  20  30
   RotationMatrix: 1 0 0
0 1 0
0 0 1

   Versor:      [ 0, 0, 0, 1 ]
   Center:      0  0  0
   Translation: 10  20  30


Transform 3:
VersorRigid3DTransform (126CBF40)
   RTTI typeinfo:   class itk::VersorRigid3DTransform<double>
   Reference Count: 2
   Modified Time: 25
   Debug: Off
   Observers:
     none
   Offset: 0  0  0
   RotationMatrix: 0.707388 -0.706825 0
0.706825 0.707388 0
0 0 1

   Versor:      [ 0, 0, 0.382499, 0.923956 ]
   Center:      0  0  0
   Translation: 0  0  0


TotalTransform:
VersorRigid3DTransform (126D7810)
   RTTI typeinfo:   class itk::VersorRigid3DTransform<double>
   Reference Count: 2
   Modified Time: 26
   Debug: Off
   Observers:
     none
   Offset: 10  -7.05699  35.3582
   RotationMatrix: 0.707388 -0.706825 0
0.5 0.500398 -0.706825
0.499602 0.5 0.707388

   Versor:      [ 0, 0, 0, 1 ]
   Center:      0  0  0
   Translation: 0  0  0


More information about the Insight-users mailing list