lta_file <- system.file("extdata", "talairach.lta", package = "freesurferformats", mustWork = TRUE)
tf <- read.fs.transform(lta_file)
out_file <- tempfile(fileext = ".lta")
write.fs.transform.lta(tf, out_file)
max(abs(read.fs.transform(out_file)$matrix - tf$matrix)) # 0, the matrix survives the round trip
unlink(out_file)
Run the code above in your browser using DataLab