To whom it may concern,
I am Stefano Zappalą, a second year PhD student at Cardiff University. I would like to use the CVS registration tool of the FreeSurfer software for elastic registration. I was very impressed by its accuracy even in aligning fiber tracts.
My project is based on reading the warp field files as output of elastic registration for estimating displacement fields. I wrote to Lilla Zollei few months ago who kindly shared with me a Matlab script for reading .m3z files, output of cvs_register. I played
with it for several months, without being able to properly read the deformation field. What I obtain does not represent the real warp (that i can extract and compare with, using another software). By checking the output image, I can tell that the registration
was successful, so I am expecting the warp field to be consistent with the real one.
When I use the Matlab function given me by Ms Zollei, I notice a gradient in each of the component (x,y,z) of the vector field, that varies according to the coordinate of each voxel (as you can see in Figure1 attached). I therefore subtracted, for each voxel,
its coordinate to the corresponding component of the vector, using the cycle:
T=zeros(256,256,256,3);
for k=1:256
for j=1:256
for i=1:256
T(i,j,k,:)=squeeze(vol_orig(i,j,k,:))-[i;j;k];
end
end
end
where vol_orig is the output of the function you gave me [vol_orig, vol_dest,
vol_ind0, spacing, exp_k] = mris_read_m3z('FILELOC'). The result is compared to vol_orig in Figure1.
By doing so I obtained something acceptable but still distant from the truth (which comparison is reported in Figure2, where the truth is the right vector field).
In the attachment you can find the function, as well as Figure1 representing a slice of vol_orig on the left and the modified version where the coordinates are subtracted to each component of the vectors. Finally, in Figure2 you can find the warp field estimated
with cvs_register and the corresponding truth. The two warp fields seem different, unfortunately.
I was wondering if you have any suggestion on how to properly read it, or if you could confirm that what I have done is correct.
Thank you for your consideration.
Best regards,
Stefano.