Dear Matthieu,
The "Affine" field in the xml-file describes as the name implies the initial affine registration to the template and not the rigid transformation between the scans. The rigid transformation of longitudinal data is estimated in cat_vol_groupwise_ls.m and used for updating the mat-field in the nifti header but not saved. The rigid transformation can be calculated by using the mat-fields before and after transformation:
V0 = spm_vol('image_before_transformation');
V = spm_vol('image_after_transformation');
rigid_transformation = V0.mat\V.mat;
Best,
Christian
On Fri, 24 Mar 2017 15:35:03 +0100, Matthieu Vanhoutte <[log in to unmask]> wrote:
>Dear CAT's experts,
>
>In case of use of longitudinal rigid registration, I would like to obtain
>the rigid registration matrix between longitudinal registered T1 and the
>native T1.
>
>I could see that in "report/cat_rnameT1.xml" and
>"report/cat_avg_nameT1.xml" there were <Affine> field reporting affine
>registration matrix:
>
>* <spm>*
>* <Affine>[1.0097648928011 -0.120584064413658 -0.022672682771548
>-6.05569728824321;0.0976955362221757 1.01509093028107 0.152770051603809
>-16.0043117677131;0.0127274879639641 -0.224421560943184 1.15345223274881
>-20.3503145873529;0 0 0 1]</Affine>*
>* <lkp>[1 1 1 2 2 2 3 3 4 4 4 5 5 5 5 6 6]</lkp>*
>* <mn>[63.1701971468043 49.25806556788 68.4946977871738
>97.3333208803065 88.9974929927054 104.154794150654 30.0499647153375
>12.694106083656 37.2918619533293 18.3719298440545 7.21086060277498
>121.378829628324 62.9309975774298 154.094339015716 96.1921081317645
>11.1328694148689 36.5113890774557]</mn>*
>*
> <vr>[140.206898548899;198.947654014136;115.575856392057;61.242099612924;77.6671635386807;10.9723677830577;121.011486396195;19.240234269844;148.80337714551;38.0738069450925;4.29931939540977;900.402765957102;183.197763197176;310.343249193841;418.304467377853;31.0108989630045;202.252070071663]</vr>*
>* </spm>*
>
>Do those files contain the rigid registration that I want ? In case of yes,
>which on should I use and in which direction were they defined (registered
>-> native or native -> registered) ?
>
>Many thanks for your help.
>
>Best regards,
>Matthieu
>
|