[Insight-users] VersorRigid3dTransform

Martin Urschler martin at urschler.info
Mon Jun 27 14:05:21 EDT 2005


hi all,

Can anyone explain to me why the following code does what it does?

   typedef itk::VersorRigid3DTransform< double > TransformType;
   TransformType::Pointer transform = TransformType::New();
   TransformType::OutputVectorType translation;
   translation[0] = 16.0;
   translation[1] = -12.0;
   translation[2] = 11.5;
   transform->SetTranslation( translation );

   typedef TransformType::VersorType  VersorType;
   typedef VersorType::VectorType     VectorType;

   VersorType     rotation;
   VectorType     axis;

   axis[0] = 0.0;
   axis[1] = 0.0;
   axis[2] = 1.0;

   const double angle = 3.14 / 4.0;
   rotation.Set(  axis, angle  );
   transform->SetRotation( rotation );

   std::cout << transform << std::endl;
   std::cout << transform->GetParameters() << std::endl;

   TransformType::InputPointType center;
   center[0] = 64 * fixedImage->GetSpacing()[0];
   center[1] = 64 * fixedImage->GetSpacing()[1];
   center[2] = 64 * fixedImage->GetSpacing()[2];

   transform->SetCenter( center );

   std::cout << transform << std::endl;
   std::cout << transform->GetParameters() << std::endl;


In both cases I get the same values for the transform->GetParameters 
call. Despite the fact that two different rotation centers are used. I'm 
not sure but I think a different rotation center should have an effect 
on the transform parameters, or did I misunderstand something? It should 
provide us with a different point to start in the optimization of the 
registration.

I read the chapters of the software guide that deal with these things... 
I guess I lack some understanding...

thanks,
Martin




More information about the Insight-users mailing list