Constructor for the sg_mask S3 class, which stores an integer label
matrix where 0 represents background and positive integers represent
individual cell IDs.
Arguments
- labels
Integer matrix of cell labels. 0 = background, positive values = cell IDs (gaps are allowed). Values must be finite whole numbers from 0 to 2147483647; larger uint32 IDs are unsupported and rejected before integer conversion.
- image_id
Optional character string identifying the source image.
- model_info
Optional named list of model metadata.
- mask_type
One of
"instance","labelled"or"binary".- legend
Optional data frame with one row per positive label and columns
label,object_id,class,name. Missing legends are generated deterministically when needed (seesg_mask_legend()).- plane
Optional plane list (see
new_sg_image()).- origin
Optional origin list (see
new_sg_image()).- status
Review status:
"draft"(default),"staged"or"reviewed". Seesg_review_mask().- provenance
Named list of provenance records.
- id
Optional mask identifier.
Details
Masks follow the segmantR mask contract: integer values, 0 is the
background, positive integers are object instances (mask_type = "instance", the default and historic meaning), class codes
("labelled") or foreground ("binary", values 0/1 only). All arguments
after model_info are optional interchange fields.