> From what I understand, the linear and non-linear transforms saved in
> *sn3d.mat are actually the mappings from the spacially normalized image
> back to the template. How can I get the transforms mapping the template to
> the normalised image?
The contents of the sn3d.mat file maps from the space of the template to the
un-normalised image. The affine mapping between a template and a spatially
normalised image is achieved by:
VT = spm_vol(spm_get(1,'*.img','Select template'));
VN = spm_vol(spm_get(1,'*.img','Select normalised image'));
M = VN.mat\VT.mat
x = [20 20 20]; % voxel in template, where first is [1 1 1]
y = M(1:3,:)*[x' ; 1] % corresponding voxel in normalised image
Best regards,
-John
--
Dr John Ashburner.
Wellcome Department of Cognitive Neurology.
12 Queen Square, London WC1N 3BG, UK.
tel: +44 (0)20 78337491 or +44 (0)20 78373611 x4381
fax: +44 (0)20 78131420
http://www.fil.ion.ucl.ac.uk/~john
mail: [log in to unmask]
|