Mark Jenkinson wrote:
> In matlab all coords start at 1, while in fslview they start at 0.
> Try looking at *voxel* coordinate (34,133,134) in fslview - that
> should be equivalent to (35,134,135) in matlab. Make sure
> you use the voxel and not mm coordinates from fslview though.
Hi, just to add to that, if you are using SPM5, as Andrew mentioned,
then if everything is behaving, you should find that world/mm
coordinates match too. E.g. if you look at voxel (34,133,134) in
fslview and note the mm coords, you should find that:
V = spm_vol('file.nii');
V.mat*[35;134;135;1]
reports the same world coords, as well as getting the same voxel
intensity from e.g.
spm_sample_vol(V, 35,134,135, 1)
spm_sample_vol can be given non-integer voxel indices, that it will
interpolate (last argument of 1 => linear), which means you can easily
read the data at world/mm locations after using vox=V.mat\world.
Best,
Ged.
|