Learn R Programming

freesurferformats (version 1.1.0)

transform2lps: 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)

Value

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

Arguments

tf

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

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

Run this code
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

Run the code above in your browser using DataLab