[Insight-users] FW: How to convert VersorRigid3DTransform to
vtkTransform
Stephen R. Aylward
aylward at unc.edu
Thu May 26 08:25:16 EDT 2005
I am guessing that the transform is from the fixed to the moving image,
and so he needs to invert the transform to apply it to the poly data (in
the moving coordinate frame) to get it into the fixed image.
Stephen
Luis Ibanez wrote:
>
> 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 confused 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
>> <file:///C:\Documents%20and%20Settings\Toon%20Huysmans\My%20Documents\Image-Mesh%20Processing\ITK\DoxygenInsightToolkit-2.0.0\a03144.html#a2>,
>> and the translation part using VersorRigid3DTransform::GetOffset
>> <file:///C:\Documents%20and%20Settings\Toon%20Huysmans\My%20Documents\Image-Mesh%20Processing\ITK\DoxygenInsightToolkit-2.0.0\a03144.html#a1>.
>> Then I use vtkTransform::SetMatrix to set the transform for the
>> polydata, and I use
>>
>> vtkTransformPolyDataFilter to transform the polydata. But the result
>> 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.
>>
>>
>>
>>
>>
>> ╔═════════════════════════════════════════════════════╗
>>
>> ║ Postal Address: ║
>>
>> ║ ║
>>
>> ║ Vision Lab, Department of Physics ║
>>
>> ║ University of Antwerp (CMI) ║
>>
>> ║ Groenenborgerlaan 171 (U306) ║
>>
>> ║ B-2020 Antwerp, Belgium ║
>>
>> ╟─────────────────────────────────────────────────────╢
>>
>> ║ Tel: +32 (0) 3 265 32 24 ║
>>
>> ╟─────────────────────────────────────────────────────╢
>>
>> ║ Fax: +32 (0) 3 265 33 18 ║
>>
>> ╟─────────────────────────────────────────────────────╢
>>
>> ║ Email: toon.huysmans at ua.ac.be
>> <mailto:toon.huysmans at ua.ac.be> ║
>>
>> ╟─────────────────────────────────────────────────────╢
>>
>> ║ Web: http://webhost.ua.ac.be/visielab/staff/tohu/ ║
>>
>> ╚═════════════════════════════════════════════════════╝
>>
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> 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
--
===========================================================
Dr. Stephen R. Aylward
Associate Professor of Radiology
Adjunct Associate Professor of Computer Science and Surgery
http://caddlab.rad.unc.edu
aylward at unc.edu
(919) 966-9695
More information about the Insight-users
mailing list