perm_mat | R Documentation |
A permutation matrix defines how the native voxel coordinates can be transformed to standard (LPI) orientation.
perm_mat(x, ...)
x |
the object |
... |
additional arguments |
a permutation matrix can be used to convert between cardinal image orientations. For example, if an image is stored in "RPI" (Right-Posterior-Inferior) format, a coordinate in this space can be converted to LPI (Left-Posterior-Inferior) by multiplying a coordinate vector by the permutation matrix.
an N x N permutation matrix, where N is the dimensionality of the image.
fname <- system.file("extdata", "global_mask.nii", package="neuroim2")
vol <- read_vol(fname)
pmat <- perm_mat(space(vol))
vox <- c(12,12,8)
pvox <- vox %*% perm_mat(space(vol))
stopifnot(all(pvox == c(-12,12,8)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.