transform2lps: Convert a transformation to LPS world coordinates.

View source: R/transforms_convert.R

transform2lpsR Documentation

Convert a transformation to LPS world coordinates.

Description

The reverse of transform2ras, for transformations that have to be expressed in the world coordinates that ITK and the tools built on it use. A transformation that is already in LPS coordinates is returned unchanged.

Usage

transform2lps(tf)

Arguments

tf

an fs.transform instance whose matrix operates on world coordinates, i.e. space_in and space_out are either 'lps' or 'ras'.

Value

an fs.transform instance whose matrix operates on LPS coordinates.

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(), read.fs.transform.xfm(), sm0to1(), sm1to0(), summary.fs.transform(), 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 <- read.fs.transform(system.file("extdata", "talairach.xfm",
  package = "freesurferformats", mustWork = TRUE
))
# The matrix changes, because the sign of the first two axes changes.
max(abs(transform2lps(tf)$matrix - tf$matrix)) > 0


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