read.fs.transform: Load transformation matrix from a file.

View source: R/read_fs_transform.R

read.fs.transformR Documentation

Load transformation matrix from a file.

Description

Load transformation matrix from a file.

Usage

read.fs.transform(filepath, format = "auto")

Arguments

filepath

character string, the full path to the transform file.

format

character string, the file format. Currently 'auto' (guess based on file extension), 'xfm' (for xform format) or 'dat' (for tkregister style, e.g. register.dat) are supported.

Value

named list, the 'matrix field contains a '4x4 numerical matrix, the transformation matrix. Other fields may exist, depending on the parsed format.

Note

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

See Also

Other header coordinate space: mghheader.is.ras.valid(), mghheader.ras2vox.tkreg(), mghheader.ras2vox(), mghheader.scanner2tkreg(), mghheader.tkreg2scanner(), mghheader.vox2ras.tkreg(), mghheader.vox2ras(), read.fs.transform.dat(), read.fs.transform.lta(), read.fs.transform.xfm(), sm0to1(), sm1to0()

Examples

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


freesurferformats documentation built on May 29, 2024, 5:29 a.m.