[Insight-users] Versor problem

tony hakki tony2007vtk at yahoo.com
Fri Apr 6 11:45:13 EDT 2007


Dear Luis;
I set the Center like the following code. I think it is correct to set center. At the end of the registration I write the transform staffs to the a txt folder. In this folder center is seen [0,0,0],as if I hadn't set it. What might the problem?I apply finalparameters to the TransformMeshfilter as a input like  that
transform->SetParameters( finalParameters );
filter->SetTransform(transform );  
but The pointset goes far away from the image instead of the overlapping
If you like to see my whole code I can add it. 


typedef itk::QuaternionRigidTransform< double > TransformType;
TransformType::Pointer transform = TransformType::New();
TransformType::InputPointType centerFixed;
centerFixed[0] = 15 ;
centerFixed[1] =-20;
centerFixed[2] =0;
transform->SetCenter(centerFixed); 

 here is the Transform staff at the end of the registration : Also here the transformation and the versor variables are too small according to me?Is ITK capable to  registrate STL Polydata(I convert it to ITK mesh then to a  pointset) and .raw extension 3D image?

VersorRigid3DTransform (04D73558)
  RTTI typeinfo:   class itk::VersorRigid3DTransform<double>
  Reference Count: 4
  Modified Time: 1221
  Debug: Off
  Observers: 
    none
  Matrix: 
    0.999912 -0.00431884 0.0125821 
    0.00426851 0.999983 0.00402404 
    -0.0125992 -0.00396998 0.999913 
  Offset: [1.00003, -0.73264, -1.39039]
  Center: [0, 0, 0]
  Translation: [1.00003, -0.73264, -1.39039]
  Inverse: 
    0.999912 0.00426851 -0.0125992 
    -0.00431884 0.999983 -0.00396998 
    0.0125821 0.00402404 0.999913 
  Singular: 0
  Versor: [ -0.00199855, 0.00629548, 0.00214689, 0.999976 ]


----- Original Message ----
From: Luis Ibanez <luis.ibanez at kitware.com>
To: tony hakki <tony2007vtk at yahoo.com>
Cc: insight-users at itk.org
Sent: Friday, April 6, 2007 4:15:48 PM
Subject: Re: [Insight-users] Versor problem


Hi Tony,


1) The center of the Transform should be set to the Center of the
    Fixed object. In your case, that will be the Fixed Point Set.



2)                  FORGET EULER ANGLES !!



      They are a *BAD* representation of 3D rotations


                   Versors ARE NOT EULER ANGLES
                   Versors are unit Quaternions


      The methods SetRotationAroundX,Y,Z, *ARE NOT* cumulative.

      The rotation that you set with SetRotationAroundY is
      overriding the rotation that you set around X previously.

      The correct way of setting a versor is via an Axis and an Angle.

      You should provide the three components (x,y,z) of the axis
      of rotation, as a unit vector.  And you should provide the
      angle of rotation in radians. Note that the component of the
      axis *ARE NOT* the Euler angles either.



Please read the tutorial on Quaternions:

    http://www.itk.org/CourseWare/Training/QuaternionsI.pdf
    http://www.itk.org/CourseWare/Training/QuaternionsII.pdf

and the description of Versors in the Wikipedia:

      http://en.wikipedia.org/wiki/Versor

The four components of a Quaternion correspond to:


      q0 = Ax * sin( T / 2 )
      q0 = Ay * sin( T / 2 )
      q0 = Az * sin( T / 2 )
      q0 =      cos( T / 2 )


where (Ax,Ay,Az) are the components of the axis
of rotation and T is the angle of rotation.



    Regards,


       Luis


------------------------
tony hakki wrote:
> hello;
> I have 2 questions:
>  1- When we implement pointSetToImageRegistration Should we Set the 
> center of transform like SetTransform(Center) ,if yes which data's 
> center should it be,PointSet center or image center?
>  
> 2- I use VersorRigid3DTransform,and I want to set Versor by my self and 
> see the effect of Versor. But I set the versor type like the following 
> then I get the transform parameters to confirm the versor variables it 
> says that *versor[0,    0,    -0.26745,   0.963572]  Why do the versor 
> variables not   same what I set at the beginning?and What does the 
> fourth one(  0.963572) indicate?*
> ** 
> ** 
> 
> *TransformType::VersorType versor;*
> 
> *versor.SetRotationAroundX( 0.276538 );*
> 
> *versor.SetRotationAroundY( 1.595315);*
> 
> *versor.SetRotationAroundZ( -0.5414906);*
> 
> *transform->SetRotation( versor );*
> 
> 
> ------------------------------------------------------------------------
> Expecting? Get great news right away with email Auto-Check. 
> <http://us.rd.yahoo.com/evt=49982/*http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html>
> Try the Yahoo! Mail Beta. 
> <http://us.rd.yahoo.com/evt=49982/*http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html>
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users


 
____________________________________________________________________________________
Get your own web address.  
Have a HUGE year through Yahoo! Small Business.
http://smallbusiness.yahoo.com/domains/?p=BESTDEAL
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20070406/3115998a/attachment.htm


More information about the Insight-users mailing list