Description Usage Arguments Value Examples
Creates a logical array from an antsImage object
1 | 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
1 2 3 4 5 6 | 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.