<br>Hi Michael,<br><br>You seem to be having trouble with the truncation<br>that is natural in C when dividing two integers.<br><br>Your division 30/180 will be equal to zero.<br><br>....<br><br>Anyways, <br>it seems that you have found already<br>
the answer to your question.<br><br><br>Please let us know if you find any other problem.<br><br><br> Thanks<br><br><br> Luis<br><br><br>-------------------------------------------------------------<br><div class="gmail_quote">
On Mon, Jun 29, 2009 at 9:40 AM, Michael Schildt <span dir="ltr"><<a href="mailto:michael.schildt@ifn-magdeburg.de">michael.schildt@ifn-magdeburg.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
... it actually does when using 30.0 instead of 30 for sin() and cos() ...<br><font color="#888888">
<br>
Michael Schildt schrieb:</font><div><div></div><div class="h5"><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br>
<br>
>>>>>>>>>>>>>>>>>>>>>>>> small test program <<<<<<<<<<<<<<<<<<<<<<<br>
// Set Center, Translation and Rotation<br>
itk::VersorRigid3DTransform<double>::InputPointType center; itk::VersorRigid3DTransform<double>::TranslationType translation;<br>
itk::VersorRigid3DTransform<double>::MatrixType matr;<br>
itk::VersorRigid3DTransform<double>::ParametersType params, fix;<br>
center[0] = 2.0;<br>
center[1] = 3.0;<br>
center[2] = 4.0;<br>
transform->SetCenter(center); params = transform->GetParameters();<br>
fix = transform->GetFixedParameters();<br>
cout << "Params: " << params << " Fixed: " << fix << endl;<br>
translation[0] = 3;<br>
translation[1] = 12;<br>
translation[2] = -1;<br>
transform->SetTranslation(translation);<br>
params = transform->GetParameters();<br>
fix = transform->GetFixedParameters();<br>
cout << "Params: " << params << " Fixed: " << fix << endl;<br>
matr.SetIdentity();<br>
matr(0,0) = matr(1,1) = cos(30/180*M_PI);<br>
matr(0,1) = -sin(30/180*M_PI);<br>
matr(1,0) = sin(30/180*M_PI);<br>
transform->SetMatrix(matr);<br>
params = transform->GetParameters();<br>
fix = transform->GetFixedParameters();<br>
cout << "Params: " << params << " Fixed: " << fix << endl;<br>
<br>
>>>>>>>>>>>>>>>>>>>>>>>>>>>> Output is <<<<<<<<<<<<<<<<<<<<<<<<<br>
<br>
Params: [0, 0, 0, 0, 0, 0] Fixed: [2, 3, 4]<br>
Params: [0, 0, 0, 3, 12, -1] Fixed: [2, 3, 4]<br>
Params: [0, 0, 0, 3, 12, -1] Fixed: [2, 3, 4]<br>
<br>
Should the last SetMatrix() call change the parameters of the versor too?<br>
<br>
Reguards, Michael Schildt<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at: <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br>
<br>
</blockquote>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at: <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</div></div></blockquote></div><br>