Description Usage Arguments Value Examples
Get and set methods for image header information
1 2 3 4 5 6 7 8 9 10 11 | 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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 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))
testthat::expect_error(antsGetSpacing(as.array(img) ) )
testthat::expect_error(antsSetSpacing(as.array(img), c(2,2) ), "class" )
testthat::expect_error(antsSetSpacing(img, c("2",2) ), "numeric" )
testthat::expect_error(antsSetSpacing(img, c(3,3,3) ), "dimensions" )
testthat::expect_error(antsGetOrigin(as.array(img) ) )
testthat::expect_error(antsSetOrigin(as.array(img), c(0.5, 0.5) ) )
testthat::expect_error(antsSetOrigin(img, c("0.5", 0.5) ) )
testthat::expect_error(antsSetOrigin(img, c(0.5, 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.