[Insight-users] pb with Versor3DRigidTransform

Vincent Daanen vincent.daanen at imag.fr
Mon Sep 12 11:01:49 EDT 2005


Hi Luis,

In fact, in my first attempts to display the versor, I 'recomposed' it 
from the matrix.
Now, I using a similar code to the one below and it works well.

Thanks for your response

 Vince

Luis Ibanez a écrit :

> Hi Vincent,
>
>
> Something is suspicious in your installation.
>
> I just verified the following code:
>
> -----------------------------------------------------------
> #include <iostream>
> #include "itkVersorRigid3DTransform.h"
>
> int main()
> {
>   typedef itk::VersorRigid3DTransform<double> TransformType;
>   TransformType::Pointer transform = TransformType::New();
>
>   transform->SetIdentity();
>
>   TransformType::OutputVectorType t;
>   t[0] = 5.0;
>   t[1] = 5.0;
>   t[2] = 5.0;
>
>   transform->SetTranslation( t );
>   transform->Print( std::cout );
>
>   std::cout << transform->GetVersor() << std::endl;
>
>   return 0;
> }
> -----------------------------------------------------------
>
> and produces the following output:
>
>
>
> -----------------------------------------------------------
> VersorRigid3DTransform (0x4f02b0)
>   RTTI typeinfo:   itk::VersorRigid3DTransform<double>
>   Reference Count: 1
>   Modified Time: 5
>   Debug: Off
>   Observers:
>     none
>   Matrix:
>     1 0 0
>     0 1 0
>     0 0 1
>   Offset: [5, 5, 5]
>   Center: [0, 0, 0]
>   Translation: [5, 5, 5]
>   Inverse:
>     1 0 0
>     0 1 0
>     0 0 1
>   Singular: 0
>   Versor: [ 0, 0, 0, 1 ]
>
> [ 0, 0, 0, 1 ]
> -----------------------------------------------------------
>
> As you can see, there are no NaN on the final print out.
>
>
>
> Please try the code above in your installation
> and let us know what you find.
>
>
>   Thanks
>
>
>
>      Luis
>
>
> ----------------------
> Vincent Daanen wrote:
>
>> Luis Ibanez a écrit :
>>
>>>
>>> Hi Vincent,
>>>
>>> You can easily solve this problem by invoking the method
>>>
>>>             transform->SetIdentity()
>>>
>> That's what I'm doing
>>
>>> before you initialize the translation of the transform.
>>
>>
>>
>>
>>> I assume that you are setting the translation by invoking
>>> the method "Translate()", is this how you did it ?
>>>
>> No, I'm intializing a Versor3DRigidTransform::OutputVectorType and 
>> then use SetTranslation to set it.
>> but it's working. The resampled volume is a translation of the input 
>> volume
>>
>>> Also... what version of ITK are you using ?
>>
>>
>>
>> I'm using Itk 2.0.1
>>
>> May be it's just a display pb (or with the << operator) because it 
>> works well ...
>>
>> Thanks for your responses
>>
>> Vince
>> _______________________________________________
>> Insight-users mailing list
>> Insight-users at itk.org
>> http://www.itk.org/mailman/listinfo/insight-users
>>
>>
>
>


-- 
Vincent Daanen, PhD
Research Engineer, Post-Doctoral Position
Laboratoire TIMC/IMAG (Univ. Joseph Fourier - CNRS UMR 5525)
Equipe GMCAO
Institut d'Ingénierie de l'Information de Santé (IN3S)
Faculté de Médecine - 38706 La Tronche cedex - France
Tel: +33 (0)4 56 52 00 54 - Fax: +33 (0)4 56 52 00 55
Vincent.Daanen at imag.fr

"Les problèmes ne peuvent être résolus par
ceux dont l'horizon se limite aux réalités 
quotidiennes, mais par ceux qui rêvent de 
choses qui n'ont jamais existées et qui se 
disent : Pourquoi Pas ?"

J-F Kennedy, 1963.



More information about the Insight-users mailing list