[Insight-users] Similarity3DTransform

Luis Ibanez luis.ibanez at kitware.com
Wed Jun 4 16:57:58 EDT 2008


Hi Heike,


1) We will discourage you from including the coordinates of the center
    in the list of transform parameters. We have found in the past that
    this make the optimization unstable...   :-/


2) About the Jacobian computation:
    The rotation matrix is the one in page 61 of
    http://www.itk.org/CourseWare/Training/QuaternionsI.pdf


    The important feature to keep in mind when deriving with respect
    to Versor components, as opposed to deriving with respect to
    Quaternion components, is that in the Versor, the "w" component
    is not independent.  That is the four values {x,y,z,w} are
    actually {x,y,z,sqrt(1-xx-yy-zz)} (where xx = x*x).


    Therefore, the derivative with respect to "x" of a term such as

                          2xy - 2wz

    (the x,y term of the Rotation matrix).

    that in the case of a Quaternion will yield:

                          2y

    will instead, in the case of a Versor requires to express W
    in terms of x,y,z as w = sqrt( 1 - x.x - y.y - z.z )

                          2xy - 2wz
                       =  2xy - 2 sqrt(1-x.x-y.y-z.z) z
                       =  2xy - 2z (1/2) ( -2 x ) / w

      deriving this with respect to x will yield:

                          2y - 2xz / w

       which is the same as

                         ( 2wy - 2xz ) / w

       as you will find in the first part of line 214 in


                 itkVersorRigid3DTransform.txx




    Please let us know if you find any flaw in the math,


       Thanks



          Luis



-------------------
Heike Moll wrote:
> Hi,
> 
> I am trying to implement a class named CenteredSimilarity3DTransform. 
> 
> This class is derived from Similarity3DTransform and is suposed to optimize the center of transformation (like CenteredSimilarity2DTransform).
> My problem is the method GetJacobian( const InputPointType & p )!!
> I have to rewrite the Jacobian matrix for 3D, so I tried to understand the calculation in the VersorRigid3DTransform class.
> 
> You used the equation P`=R*P+T.
> 
> But if I recalculate the jacobian matrix (whose elements are the partial derivatives of the output point with respect to the transform parameters) with above equation and the (quaternion) rotation matrix R:
> 
> R=1-2(y²+z²), 2xy-2wz, 2xz+2wy;
>      2xy+2wz, 1-2(x²+z²), 2yz-2wx;
>      2xz-2wy, 2yz+2wx, 1-2(x²+y²),
> 
> I get another result as the one used in VersorRigid3DTransform. The versor differs in all positions accept in the diagonal. 
> Why? Did I use the wrong rotation matrix R? Or have I a logical mistake in my thoughts?
> 
> Thx Heike
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 


More information about the Insight-users mailing list