read.fs.transform.xfm: Load transformation matrix from an XFM file.

View source: R/read_fs_transform.R

read.fs.transform.xfmR Documentation

Load transformation matrix from an XFM file.

Description

Load transformation matrix from an XFM file.

Usage

read.fs.transform.xfm(filepath)

Arguments

filepath

character string, the full path to the transform file.

Value

an fs.transform instance. An xfm file stores a linear transformation between two RAS (world) coordinate spaces, typically the scanner space of a subject and the RAS space of an MNI or Talairach template, so space_in and space_out are both 'ras' and voxel_base is NA. The volumes that the transformation relates are not recorded in the file, so src and dst are NULL.

Note

Currently this function has been tested with linear transformation files only, all others are unsupported.

See Also

Other header coordinate space: invert.fs.transform(), is.fs.transform(), mghheader.is.ras.valid(), mghheader.ras2vox(), mghheader.ras2vox.tkreg(), mghheader.scanner2tkreg(), mghheader.tkreg2scanner(), mghheader.vox2ras(), mghheader.vox2ras.tkreg(), print.fs.transform(), read.fs.transform(), read.fs.transform.dat(), read.fs.transform.fslmat(), read.fs.transform.itk(), read.fs.transform.lta(), sm0to1(), sm1to0(), summary.fs.transform(), transform2lps(), transform2ras(), transform2voxel(), transform2world(), write.fs.transform(), write.fs.transform.dat(), write.fs.transform.fslmat(), write.fs.transform.itk(), write.fs.transform.lta(), write.fs.transform.xfm()

Examples

tf_file <- system.file("extdata", "talairach.xfm",
  package = "freesurferformats",
  mustWork = TRUE
)
transform <- read.fs.transform.xfm(tf_file)
transform$matrix


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