Transformation matrices of the voxel-to-voxel kind can only be interpreted relative to the volumes they relate, so the conversion functions need the geometry of those volumes: their dimensions, voxel sizes and the matrix that maps voxel indices to RAS coordinates.
The voxel indices are zero-based and the origin of the RAS space is the one used by FreeSurfer for MGH
headers and by NIfTI for the sform, i.e. this is the same convention as mghheader.vox2ras.
Arguments
- volume
an
fs.volumeinstance (as returned byread.fs.volumeorread.fs.mgh), aniftiinstance (from theoro.niftipackage), or a named list with the entries 'vox2ras_matrix', 'voldim' and 'voxelsize'.