I think this will do it:

voxel = spm_XYZreg('findxyz', coord, xSPM.XYZmm)


On 12/10/2013 11:01 AM, Colin Hawco wrote:
[log in to unmask]" type="cite">
Not knowing how to get SPM to do this, or wanting to use a GUI interface for it, I wrote my own code. 

The translation is stored in the xSPM file created when you run results. If you run results for a given study at a very low threshold (like p < 0.99999), it will include almost all voxels in the rbain. 

However the function only works properly for files in 2x2x2mm space. the reason is that it searches for the voxels you specify, but I have set it to go up to the next even number. If you want it to work for 3mm of 4mm data, you will need to edit lines 7-9 to make sure it always gives a multiple of the voxel size. 

If that doesn't help, the data is stored in: 

xSPM.XYZ % voxel space
xSPM.XYZmm %MNI space. 

I hope that helps! 

Colin. 


On 10 December 2013 05:09, Mark <[log in to unmask]> wrote:
Hi,

If I have a MNI coordinate (say, -60 20 20), is there easy and fast method in SPM8 to transform it into voxel coordinates?

Thanks