# 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)
}
Run the code above in your browser using DataLab