Convert to 'ANTsTransform'
Usage
as_ANTsTransform(x, ...)
# Default S3 method
as_ANTsTransform(x, dimension = 3, ...)
# S3 method for class 'ants.core.ants_transform.ANTsTransform'
as_ANTsTransform(x, ...)
# S3 method for class 'ants.core.ants_image.ANTsImage'
as_ANTsTransform(x, ...)
# S3 method for class 'numpy.ndarray'
as_ANTsTransform(x, ...)
# S3 method for class 'character'
as_ANTsTransform(x, ...)
Examples
if(interactive() && ants_available()) {
mat <- matrix(c(
0, -1, 0, 128,
1, 0, 0, -128,
0, 0, -1, 128,
0, 0, 0, 1
), ncol = 4, byrow = TRUE)
trans <- as_ANTsTransform(mat)
trans
# apply transform
trans$apply_to_point(c(120, 400, 1))
# same results
mat %*% c(120, 400, 1, 1)
trans[] == mat
}