analyze.mat.sidecar.to.vox2ras: Compute the voxel-to-RAS matrix from the MATLAB sidecar file...

View source: R/read_analyze.R

analyze.mat.sidecar.to.vox2rasR Documentation

Compute the voxel-to-RAS matrix from the MATLAB sidecar file of an ANALYZE image.

Description

Read the transformation matrix that SPM and FreeSurfer write into the .mat file next to an ANALYZE image, and convert it to the convention used by this package (0-based voxel indices, right-anterior-superior world coordinates). See the geometry section of read.fs.volume.analyze for the details.

Usage

analyze.mat.sidecar.to.vox2ras(matfile)

Arguments

matfile

character string, the path of the .mat file.

Value

named list with the entries vox2ras (a 4x4 numeric matrix, or NULL if the file could not be read or contains no usable matrix) and reason (a character string describing the problem, or NULL on success).


freesurferformats documentation built on Sept. 25, 2026, 1:07 a.m.