View source: R/imaging-ants-io.R
| write_ants_transform | R Documentation |
'ITK'/'ANTs' affine transformwrite_ants_transform stores a 4\times 4 RAS-to-RAS
affine (such as the transform returned by
register_volume3d) as an 'ITK' .mat file (a
'MATLAB' level-5 binary, LPS convention) compatible with
antsApplyTransforms. read_ants_transform reads such a file back
into a 4\times 4 RAS matrix. The reader folds a non-zero
ITK center of rotation into the translation, so transforms written by
'ANTs' are read correctly.
write_ants_transform(transform, file)
read_ants_transform(file)
transform |
a |
file |
path to the |
write_ants_transform returns file invisibly;
read_ants_transform returns a 4\times 4 RAS matrix.
register_volume3d, save_registration
tf <- tempfile(fileext = ".mat")
m <- diag(4); m[1:3, 4] <- c(3, -2, 1)
write_ants_transform(m, tf)
read_ants_transform(tf)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.