[Insight-users] [ITK Community] coordinate system

Luis Ibanez luis.ibanez at kitware.com
Wed Feb 19 00:41:21 EST 2014


Hi Wang,

Please note that in ITK, the resampling of an image is done in physical
coordiantes, not in pixel space (the image grid).

That is, ITK will actually take into account the pixel spacing of your
images, as well as the Direction matrix of the images themselves.

This may account for some of the differences that you see when comparing to
Matlab operations.


Note also that the ITK transforms have a "Center" of rotation parameter,
that play into the calculation.


    Thanks

       Luis



On Tue, Feb 18, 2014 at 10:41 PM, WANG Chengjia
<wangchengjia1986 at gmail.com>wrote:

> More generally, I have a transformation matrix calculated, anyone know how
> to transform a volume using this matrix?
>
> It is just a simple Rigid 3D transformation. In Matlab, I just use "tform
> = maketform('affine', transM');" to make up the transformation and apply it
> using " tformarray " then the images are perfectly aligned. But in ITK, I
> find I have to switch the x, y coordinate of translation when doing
> "targetTransform->SetTranslation(trans)". The result was still wrong,
> although quite close to the one I got in Matlab.
>
> Can anyone help? Thanks in advance!
>
> Best,
>
>
>
> On Tue, Feb 18, 2014 at 7:39 PM, WANG Chengjia <wangchengjia1986 at gmail.com
> > wrote:
>
>> Hello,
>>
>> I'm now working on a machine learning based 3D image registration work.
>> To create the ground truth registration, I need to firstly using simple
>> least square method to calculate a transformation from the corresponding
>> point (I'm using RIRE datasets).
>>
>> The same working flow in matlab and itk produced the same transformation
>> matrix, but different transformed volume! In matlab, it's well aligned
>> using the coordinates of control points given by RIRE dataset. But in ITK I
>> have to inverse and switch the translation parameters. Then I realized it's
>> because of the different coordinate system in itk and Matlab.
>>
>> Can anyone tell me a method to convert transformation matrix calculated
>> from the common coordinate system into the ITK one?
>>
>> Thank you very much!
>>
>> Best,
>>
>> --
>> Chengjia Wang
>> Phd Student,
>> University of Edinburgh
>> Clinical Research Imaging Center (CRIC)
>> Toshiba Medical Visualization Systems Europe, Ltd
>> Email: wangchengjia1986 at gmail.com
>>
>
>
>
> --
> Chengjia Wang
> Phd Student,
> University of Edinburgh
> Clinical Research Imaging Center (CRIC)
> Toshiba Medical Visualization Systems Europe, Ltd
> Email: wangchengjia1986 at gmail.com
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/cgi-bin/mailman/listinfo/community
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20140219/c9b88848/attachment.html>


More information about the Insight-users mailing list