Skip to contents

Batch-write the masks of a project

Usage

at_write_masks(
  project,
  dir,
  per = c("layer", "roi", "class", "project"),
  type = c("labelled", "binary", "multiclass"),
  level = 0L,
  overwrite = FALSE,
  call = rlang::caller_env()
)

Arguments

project

An annot_project.

dir

Output directory (created if needed).

per

One of "layer", "roi", "class", or "project"; controls how masks are split into files.

type

Mask type passed to at_mask().

level

Integer pyramid level. Default 0.

overwrite

Logical; overwrite existing files. Default FALSE.

call

The calling environment, for error reporting.

Value

An invisible export-receipt tibble::tibble with columns path, type, n_px, bytes, name, status, message, sidecar_path, and sidecar_bytes. Counts and bytes use double precision. Display names are retained in name; filenames use safe components with unique suffixes. Each item is "ok", "error", or "skipped"; one failure does not abort later items. A TIFF and its legend form one staged output bundle.

Details

Output plans reject symlinked descendants and aliases before writing. Callers must serialize concurrent writes and keep destination paths stable; preflight plus staged renames is not a race-free filesystem transaction.