| as_canonical | R Documentation |
Reorients a neuroimaging volume or vector to the canonical RAS+
(Right-Anterior-Superior) orientation by permuting and flipping axes.
This is equivalent to nibabel's as_closest_canonical().
as_canonical(x, target = c("R", "A", "S"))
x |
A |
target |
Character vector of length 3 giving the desired orientation.
Default is |
The function works by computing the orientation transform from the current axis codes to the target codes, then applying the necessary axis permutations and flips. The affine matrix is updated to reflect the new orientation while preserving world-coordinate mapping.
A reoriented object of the same class as x.
axcodes, reorient
sp <- NeuroSpace(c(10L, 10L, 10L), c(2, 2, 2))
vol <- DenseNeuroVol(array(rnorm(1000), c(10,10,10)), sp)
ras_vol <- as_canonical(vol)
axcodes(ras_vol) # "R" "A" "S"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.