[Insight-users] Initialize VersorRigid3DTransform via SetTranslation and SetMatrix?

Luis Ibanez luis.ibanez at kitware.com
Tue Jun 30 11:41:15 EDT 2009


Hi Michael,

You seem to be having trouble with the truncation
that is natural in C when dividing two integers.

Your division    30/180    will be equal to zero.

....

Anyways,
it seems that you have found already
the answer to your question.


Please let us know if you find any other problem.


      Thanks


          Luis


-------------------------------------------------------------
On Mon, Jun 29, 2009 at 9:40 AM, Michael Schildt <
michael.schildt at ifn-magdeburg.de> wrote:

> ... 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
>>
>>
>>  _____________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090630/fb2efb09/attachment-0001.htm>


More information about the Insight-users mailing list