pixeltype | R Documentation |
pixeltype
from antsImagesMethods that act on the slots
of the
antsImage object
pixeltype(object)
## S4 method for signature 'antsImage'
pixeltype(object)
pixeltype(object) <- value
## S4 replacement method for signature 'antsImage'
pixeltype(object) <- value
components(object)
## S4 method for signature 'antsImage'
components(object)
components(object) <- value
## S4 replacement method for signature 'antsImage'
components(object) <- value
spacing(object)
## S4 method for signature 'antsImage'
spacing(object)
spacing(object) <- value
## S4 replacement method for signature 'antsImage'
spacing(object) <- value
direction(object)
## S4 method for signature 'antsImage'
direction(object)
direction(object) <- value
## S4 replacement method for signature 'antsImage'
direction(object) <- value
origin(object)
## S4 method for signature 'antsImage'
origin(object)
origin(object) <- value
## S4 replacement method for signature 'antsImage'
origin(object) <- value
object |
is an object of class |
value |
is the value to assign to the slot. |
img01 <- as.antsImage(array(1:64, c(4, 4, 4, 1)))
stopifnot(is.character(pixeltype(img01)))
pixeltype(img01) <- "float"
testthat::expect_error({
pixeltype(img01) <- 1.5
})
img01 <- as.antsImage(array(1:64, c(4, 4, 4, 1)))
stopifnot(components(img01) == 1)
components(img01) <- 1L
testthat::expect_error({
components(img01) <- 1.5
})
img01 <- as.antsImage(array(1:64, c(4, 4, 4, 1)))
stopifnot(all(spacing(img01) == rep(1, 4)))
spacing(img01) <- rep(1, 4)
img01 <- as.antsImage(array(1:64, c(4, 4, 4, 1)))
stopifnot(is.matrix(direction(img01)))
direction(img01) <- diag(4)
img01 <- as.antsImage(array(1:64, c(4, 4, 4, 1)))
stopifnot(all(origin(img01) == rep(0, 4)))
origin(img01) <- rep(0, 4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.