antsImageGetSet | R Documentation |
Get and set methods for image header information
antsGetSpacing(x)
antsSetSpacing(x, spacing)
antsGetOrigin(x)
antsSetOrigin(x, origin)
antsGetDirection(x)
antsSetDirection(x, direction)
x |
antsImage to access, of dimensionality |
spacing |
numeric vector of length |
origin |
numeric vector of length |
direction |
matrix of size |
For get
methods, vector of length d
(origin, spacing) or matrix of size d * d
(direction).
For set
methods, 0 to indicate success.
img <- makeImage(c(5, 5), rnorm(25))
antsGetSpacing(img)
antsSetSpacing(img, c(2.0, 2.0))
antsGetOrigin(img)
antsSetOrigin(img, c(0.5, 0.5))
img <- makeImage(c(5, 5), rnorm(25))
antsGetDirection(img)
testthat::expect_error(antsGetDirection(as.array(img)))
outimg <- makeImage(c(5, 5), rnorm(25))
antsGetDirection(outimg)
direct <- antsGetDirection(outimg)
antsSetDirection(outimg, direct)
testthat::expect_error(antsSetDirection(as.array(outimg), direct))
testthat::expect_error(antsSetDirection(outimg, as.numeric(direct)))
testthat::expect_error(antsSetDirection(outimg, diag(length(dim(outimg)) + 1)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.