XYZ contains the voxel indices, rather than their mm coordinates.  If you want mm coordinates, you need to multiply these by the appropriate voxel-to-world matrix (SPM.xVol.M). In more recent versions of MATLAB, (I think) this can be done by:

XYZmm = M(1:3,1:3)*XYZ + M(1:3,4);

In older versions, you might need:
XYZmm = bsxfun(@plus,M(1:3,1:3)*XYZ, M(1:3,4));

Best regards,
-John


On Thu, 4 Apr 2019 at 08:24, ?? ? <[log in to unmask]> wrote:
Dear lists,

When I check the SPM.mat from the first level, I found that the coordinates in SPM.xVol.XYZ are positive numbers, the minimum is 6, the maximum is 68, is this strange? Why the coordinates didn't contain a negative number? 

Thanks a lot
wenying


--
Prof John Ashburner
Professor of Imaging Science
UCL Institute of Neurology
Queen Square
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square, London, WC1N 3BG
E: [log in to unmask]  T: +44 (0)20 3448 4365
http://www.fil.ion.ucl.ac.uk/