[Insight-users] Initialize VersorRigid3DTransform via SetTranslation and SetMatrix?
Michael Schildt
michael.schildt at ifn-magdeburg.de
Mon Jun 29 09:17:42 EDT 2009
Hello,
>>>>>>>>>>>>>>>>>>>>>>>> small test program <<<<<<<<<<<<<<<<<<<<<<
// Set Center, Translation and Rotation
itk::VersorRigid3DTransform<double>::InputPointType center;
itk::VersorRigid3DTransform<double>::TranslationType translation;
itk::VersorRigid3DTransform<double>::MatrixType matr;
itk::VersorRigid3DTransform<double>::ParametersType params, fix;
center[0] = 2.0;
center[1] = 3.0;
center[2] = 4.0;
transform->SetCenter(center);
params = transform->GetParameters();
fix = transform->GetFixedParameters();
cout << "Params: " << params << " Fixed: " << fix << endl;
translation[0] = 3;
translation[1] = 12;
translation[2] = -1;
transform->SetTranslation(translation);
params = transform->GetParameters();
fix = transform->GetFixedParameters();
cout << "Params: " << params << " Fixed: " << fix << endl;
matr.SetIdentity();
matr(0,0) = matr(1,1) = cos(30/180*M_PI);
matr(0,1) = -sin(30/180*M_PI);
matr(1,0) = sin(30/180*M_PI);
transform->SetMatrix(matr);
params = transform->GetParameters();
fix = transform->GetFixedParameters();
cout << "Params: " << params << " Fixed: " << fix << endl;
>>>>>>>>>>>>>>>>>>>>>>>>>>>> Output is <<<<<<<<<<<<<<<<<<<<<<<<
Params: [0, 0, 0, 0, 0, 0] Fixed: [2, 3, 4]
Params: [0, 0, 0, 3, 12, -1] Fixed: [2, 3, 4]
Params: [0, 0, 0, 3, 12, -1] Fixed: [2, 3, 4]
Should the last SetMatrix() call change the parameters of the versor too?
Reguards,
Michael Schildt
More information about the Insight-users
mailing list