[FieldTrip] obtaining voxel locations

Robin robince at gmail.com
Tue Jul 9 18:14:40 CEST 2013

I was wondering how to get the voxel positions (or origin and voxel size)
for a fieltrip mri structure.

I have an anatomical scan which I have normalised to the T1 brain:

>> mrin

mrin =

      anatomy: [181x217x181 double]
    transform: [4x4 double]
          dim: [181 217 181]
       params: [1x1 struct]
      initial: [4x4 double]
     coordsys: 'spm'
          cfg: [1x1 struct]

I can I obtain the location of any voxel in MNI coordinates (mm or cm)?
When loading a Nifti file (with load_nii) I can find origin and voxel_size

voxel_size = abs(nii.hdr.dime.pixdim(2:4));        % vol in mm
origin = round(abs(nii.hdr.hist.originator(1:3)));

and then posmm = (vox-origin) .* voxel_size. Is there any way to do the
same from the fieldtrip structure? I can't find the corresponding header


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130709/3e978d38/attachment-0001.html>

More information about the fieldtrip mailing list