coerce_mask: Simple Mask Maker

Description Usage Arguments Value Examples

Description

Creates a logical array from an antsImage object

Usage

1
coerce_mask(x, error = TRUE)

Arguments

x

antsImage object

error

should the function error if the mask as not binary?

Value

Array, logical if all values within 0, 1, NA, and NaN

Examples

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)

muschellij2/atropos documentation built on May 4, 2019, 3:17 p.m.