[Insight-users] FW: How to convert VersorRigid3DTransform
tovtkTransform
Blezek, Daniel J (Research)
blezek at crd.ge.com
Fri May 27 08:25:17 EDT 2005
Yu,
When moving to Matlab from ITK, remember that Matlab uses row-colum-slice (i,j,k) coordinates for indexing while ITK uses x,y,z directly. Thus X and Y are switched and you'll need to permute your columns in the Rotation matrix and the rows in the Translation column vector. However, I may be a day late and a dollar short on this as I joined the topic late.
-dan
-----Original Message-----
From: insight-users-bounces+blezek=crd.ge.com at itk.org [mailto:insight-users-bounces+blezek=crd.ge.com at itk.org]On Behalf Of Yu Qi
Sent: Thursday, May 26, 2005 5:23 PM
To: insight insight
Subject: Re: [Insight-users] FW: How to convert VersorRigid3DTransform tovtkTransform
Hi Luis,
Thank you!
In SPM, the equations to transform the moving image is as follows
x1=R00*x+R01*y+R02*z+Trans0
y1=R10*x+R11*y+R12*z+Trans1
z1=R20*x+R21*y+R22*z+Trans2
But SPM integrates spacing info into the rotation 3X3 matrix.
I compared the result from ITK and the one from SPM,
I found ITKrotation*ITKspacing is very close to the Ratation matrix in SPM and the translations are also very close.
But I can not obtain a good transform in SPM using ITK result.
Do you think there will be other reasons for this? like the interpolation method (default setting in SPM is linear and I use linear in ITK)?
Best regards,
Yu Qi
Luis Ibanez <luis.ibanez at kitware.com> дµÀ£º
Hi Yu,
I'm not familiar enough with SPM to give you a good advice here.
But in general the part that needs to be transposed is just the
3x3 Matrix containing the rotational part of the transform.
This may or may not be enough for SPM, you may end up needing a
full 4x4 transpose.
Note that you don't necessarily need to transpose the transform.
This is only if you find that the representation of the transform
in ITK uses a different standard from the one present in SPM.
Sorry for not being of much help in this issue,
Luis
--------------------------------------------------------------
Yu Qi wrote:
> Hi Luis,
>
> I am alsoo trying to export the transform in ITK to other applications,
> but to SPM rather tan VTK.
>
> One question I want to ask is
> ca! n I simply use the a 4X4 matrix as follows to transform a image?
> | last translationX |
> | GetRotationMatrix 3X3 last translationY |
> | last translationZ |
> | 0 0 0 1 |
>
> and you mentioned transpose, why do we need transpose?
>
>
> Thank you!
> Best regards,
> Yu Qi
>
>
> */Luis Ibanez /* дµÀ£º
>
>
> Hi Toon,
>
>
> What you are doing seems to be reasonable.
>
> The only thing that can be wrong in your process is
> that the Matrix may need to be transposed.
>
>
> However, before we go there, could you please
> share with us the evidence that lead you to think
> that the transformation is not correct ?
>
>
> If you are obtaining the Versor transform as the
> result of an image registration process in ITK,
> chances are that you are being co! nfused by the
> direction in which Transforms are computed in ITK.
>
>
> Please let us know,
>
>
> Thanks
>
>
> Luis
>
>
> -------------------
> Toon Huysmans wrote:
>
> > Hi,
> >
> >
> >
> >; I have registered two images and I have the result in a
> > VersorRigid3DTransform, now I would like to transform some
> vtkPolyData
> > using this transform. I believe! that VersorRigid3DTransform
> contains a
> > rotation (the versor) and a translation, so I set up a 4x4 matrix,
> > containing the rotation and translation as follows:
> >
> > | R11 R12 R13 Tx |
> >
> > | R21 R22 R23 Ty |
> >
> > | R31 R32 R33 Tz |
> >
> > | 0 0 0 1 |
> >
> >
> >
> > I get the rotation matrix R using
> > VersorRigid3DTransform::GetRotationMatrix
> > ,
> > and the translation part using VersorRigid3DTransform::GetOffset
> > .
> > Then I use vtkTransform::SetMatrix to set the transform for the
> > polydata, and I use
> >
> > vtkTransformPolyDataFilter to transform the polydata. But the
> resul! t is
> > not as expected, i.e. the transformation is not correct.
> >
> >
> >
> > Does anyone have any clues on how to do it the right way?
> >
> >
> >
> > Many thanks,
> >
> >
> >
> > Toon Huysmans.
> >
> >
> >
> >
> >
> > ¥ ?lt;br>>
> > ?Postal Address: ?lt;br>>
> > ? ?lt;br>>
> > ?Vision Lab, Department of Physics ?lt;br>>
> > ?Universit! y of Antwerp (CMI) ?lt;br>>
> > ?Groenenborgerlaan 171 (U306) ?lt;br>>
> > ?B-2020 Antwerp, Belgium ?lt;br>>
> > °EUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUR?lt;br>>
> > ?Tel: +32 (0) 3 265 32 24 ?lt;br>>
> > °EUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUR?lt;br>>
> > ?Fax: +32 (0) 3 265 33 18 ?lt;br>>
> > °EUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUR?lt;br&g! t;>
> > ?Email: toon.huysmans at ua.ac.be
> > ?lt;br>>
> > °EUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUREUR?lt;br>>
> > ?Web: http://webhost.ua.ac.be/visielab/staff/tohu/ ?lt;br>>
> > « ?lt;br>>
> >
> >
> >
> >
> ------------------------------------------------------------------------
> >
> > ________________________________________________
> > Insight-users mailing list
> > Insight-users at itk.org
> > http://www.itk.org/mailman/listinfo/insight-users
>
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
>
> ------------------------------------------------------------------------
&! gt; *Do You Yahoo!?*
> 150ÍòÇúMP3·è¿ñËÑ£¬´øÄú´³ÈëÒôÀÖµîÌÃ
> ÃÀÅ®Ã÷ÐÇÓ¦Óо¡ÓУ¬ËѱéÃÀͼ¡¢ÑÞͼºÍ¿áͼ
> 1G¾ÍÊÇ1000Õ×£¬ÑÅ»¢µçÓÊ×ÔÖúÀ©ÈÝ£¡
>
>
_____
Do You Yahoo!?
150ÍòÇúMP3·è¿ñËÑ£¬´øÄú´³ÈëÒôÀÖµîÌà <http://music.yisou.com>
ÃÀÅ®Ã÷ÐÇÓ¦Óо¡ÓУ¬ËѱéÃÀͼ¡¢ÑÞͼºÍ¿áͼ <http://image.yisou.com>
1G¾ÍÊÇ1000Õ×£¬ÑÅ»¢µçÓÊ×ÔÖúÀ©ÈÝ£¡ <http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20050527/140d3fa5/attachment.html
More information about the Insight-users
mailing list