Write a mask to disk
Usage
at_write_mask(
mask,
path,
format = c("tiff", "png", "rds"),
bits = c(16L, 8L),
legend = TRUE,
overwrite = FALSE,
call = rlang::caller_env()
)Arguments
- mask
An
annot_mask.- path
Output file path.
- format
"tiff"(default),"png"(8-bit only), or"rds"(full-fidelityannot_mask).- bits
Integer bit depth for TIFF:
16(default) or8.- legend
Logical; also write a
<path>.legend.jsonsidecar describing the mask. DefaultTRUE.- overwrite
Logical; overwrite an existing file. Default
FALSE.- call
The calling environment, for error reporting.
Examples
m <- at_mask(at_example_project(), "labelled")
f <- tempfile(fileext = ".tif")
at_write_mask(m, f)