as.array | R Documentation |
Converts antsImage, antsImage object to different data types
## S4 method for signature 'antsImage'
dim(x)
## S4 method for signature 'antsImage'
as.numeric(
x,
mask = logical(),
region = new("antsRegion", index = integer(), size = integer())
)
## S4 method for signature 'antsImage'
as.matrix(
x,
mask = logical(),
region = new("antsRegion", index = integer(), size = integer())
)
## S3 method for class 'antsImage'
as.matrix(
x,
...,
mask = logical(),
region = new("antsRegion", index = integer(), size = integer())
)
## S4 method for signature 'antsImage'
as.array(
x,
...,
mask = logical(),
region = new("antsRegion", index = integer(), size = integer())
)
## S3 method for class 'antsImage'
as.array(
x,
...,
mask = logical(),
region = new("antsRegion", index = integer(), size = integer())
)
## S3 method for class 'antsImage'
as.character(
x,
...,
mask = logical(),
region = new("antsRegion", index = integer(), size = integer())
)
## S3 method for class 'antsImage'
as.factor(
x,
...,
mask = logical(),
region = new("antsRegion", index = integer(), size = integer())
)
## S3 method for class 'antsImage'
factor(
x,
...,
mask = logical(),
region = new("antsRegion", index = integer(), size = integer())
)
## S4 method for signature 'antsMatrix'
as.data.frame(x)
## S3 method for class 'antsMatrix'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)
## S4 method for signature 'antsMatrix'
as.matrix(x, ...)
## S4 method for signature 'antsMatrix'
as.list(x, ...)
x |
object of class |
mask |
a logical vector/array or binary antsImage object |
region |
a |
... |
additional arguments passed to functions |
row.names |
NULL or a character vector giving the row names for the data frame. |
optional |
passsed to |
outimg <- makeImage(c(2, 10), rnorm(20))
as.numeric(outimg)
as.numeric(outimg, mask = outimg > 1)
testthat::expect_error(as.numeric(outimg, mask = outimg))
outimg <- makeImage(c(2, 10), rnorm(20))
as.matrix(outimg)
as.matrix(outimg, mask = outimg > 1)
testthat::expect_error(as.matrix(outimg, mask = outimg))
outimg <- makeImage(c(2, 10, 2), rnorm(40))
testthat::expect_error(as.matrix(outimg))
outimg <- makeImage(c(2, 10), rnorm(20))
as.matrix(outimg)
as.matrix(outimg, mask = outimg > 1)
outimg <- makeImage(c(2, 10, 2), rnorm(40))
testthat::expect_error(as.matrix(outimg))
img <- antsImageRead(getANTsRData("r16"))
img[img > 5] <- 0
sort(unique(as.character(img)))
factor(img)
table(img, img)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.