Reputation: 57
I am using Matlab's imregtform() function to register two 3D MRI images to one another. I know that both images are related by a rotation about the center of the image, and am using the 'rigid' transform type to perform the registration. However, the transforms generated have a small but nonzero (less than 0.5 pixel) translational component. Is there any way to specify that translation should be exactly zero? If necessary, I am willing to use other tools outside of Matlab.
Upvotes: 2
Views: 618
Reputation: 36
I assume the transformation is based on fiducial markers right?. The procedure for calculating the least square rigid transformation is as follows: first you calculate the least square rotation matrix (R), then using R the scaling factor (s) and lastly using both R and s the translation vector (t).
Let fid1 and fid2 be the xy-coordinates of the fiducial markers of their respective MRI. Then the translation vector is calculated as:
t = mean(fid1) - s*R*mean(fid2)
Note that you would have to have an absolutely perfect accuracy when choosing the fiducial markers to have a translation of zero.
You are however free to remove the translation after the transformation since the estimation of R and s doesn't depend on t. To remove the translation do as follows:
tform = imregtform(....)
% Set the last row except the last element of the transformation
% matrix to zero. This removes the translation.
tform.T(end,1:end-1) = 0;
% Register the two images
movingRegistered = imwarp(...,tform,...);
hope this helps
Upvotes: 0