Skip to contents

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.

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
#> [1] TRUE