[Insight-users] Initialize VersorRigid3DTransform via SetTranslation and SetMatrix?
Michael Schildt
michael.schildt at ifn-magdeburg.de
Mon Jun 29 09:40:58 EDT 2009
... it actually does when using 30.0 instead of 30 for sin() and cos() ...
Michael Schildt schrieb:
> 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
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>
More information about the Insight-users
mailing list