View source: R/generics-ANTsTransform.R
is_affine3D | R Documentation |
Check if an object is a 3D 'affine' transform matrix
is_affine3D(x, ...)
## Default S3 method:
is_affine3D(x, strict = TRUE, ...)
## S3 method for class 'ants.core.ants_transform.ANTsTransform'
is_affine3D(x, ...)
x |
R or Python object, accepted forms are numeric |
... |
passed to other methods |
strict |
whether the last element should be always 1 |
A logical value whether the object can be loaded as a 4-by-4 matrix.
# not affine
is_affine3D(1)
# 3x3 matrix is not as it is treated as 2D transform
is_affine3D(matrix(rnorm(9), nrow = 3))
# 3x4 matrix
x <- matrix(rnorm(12), nrow = 3)
is_affine3D(x)
# 4x4 matrix
x <- rbind(x, c(0,0,0,1))
is_affine3D(x)
if(interactive() && ants_available()) {
ants <- load_ants()
x <- ants$new_ants_transform(dimension = 3L)
is_affine3D(x)
# save the parameters
f <- tempfile(fileext = ".mat")
ants$write_transform(x, f)
is_affine3D(f)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.