View source: R/write_fs_transform.R
| write.fs.transform.fslmat | R Documentation |
Write a 4x4 matrix as an FSL matrix file, i.e. as the plain text file that FSL's flirt writes
with the -omat option and that FSL, MRtrix3 and FreeSurfer read as the registration between two images. The
matrix must map voxel coordinates to voxel coordinates (space_in and space_out are 'voxel'), because that
is what an FSL matrix stores: it relates the voxel grid of the image given to flirt -in to the voxel grid of
the image given to flirt -ref, and it does not record which images those were. Use
transform2voxel to convert a transformation in world coordinates into one that can be
written.
write.fs.transform.fslmat(tf, filepath)
tf |
an |
filepath |
character string, the full path of the file to write. |
the fs.transform instance tf, invisibly.
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(),
transform2lps(),
transform2ras(),
transform2voxel(),
transform2world(),
write.fs.transform(),
write.fs.transform.dat(),
write.fs.transform.itk(),
write.fs.transform.lta(),
write.fs.transform.xfm()
tf_file <- system.file("extdata", "talairach.lta", package = "freesurferformats", mustWork = TRUE)
out_file <- tempfile(fileext = ".mat")
write.fs.transform.fslmat(read.fs.transform(tf_file), out_file)
readLines(out_file)
unlink(out_file)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.