View source: R/transforms_common.R
| invert.fs.transform | R Documentation |
Compute the transformation that undoes the given one, i.e. the one that maps the target coordinates back to the source coordinates. The source and target of the result are swapped, along with the coordinate spaces, and the matrix is inverted. A transformation is never stored inverted, use this function when you need the reverse mapping.
invert.fs.transform(tf)
tf |
an |
an fs.transform instance that maps from the target of tf back to its source.
The format-specific fields of tf (e.g. the parsed header and the volume info of an LTA file, or the
intensity of a register.dat file) describe the file that tf was read from and are therefore copied to the
result unchanged. They are metadata, not part of the mapping.
Other header coordinate space:
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(),
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()
tf <- read.fs.transform(system.file("extdata", "talairach.xfm",
package = "freesurferformats", mustWork = TRUE
))
tf_back <- invert.fs.transform(tf)
tf_back$space_in # the spaces are swapped
max(abs(tf_back$matrix %*% tf$matrix - diag(4))) # the identity
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.