coerce_mask | R Documentation |
Creates a logical array from an antsImage object
coerce_mask(x, error = TRUE)
x |
antsImage object |
error |
should the function error if the mask as not binary? |
Array, logical if all values within 0, 1, NA
, and NaN
img <- makeImage(c(10, 10), rnorm(100))
mask <- img > 0
coerce_mask(mask, error = TRUE)
coerce_mask(mask + 1, error = FALSE)
testthat::expect_error(coerce_mask(mask + 1, error = TRUE))
coerce_mask(as.array(mask) > 0, error = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.