atomscale.results.rheed_image.decode_mask_rle#
- atomscale.results.rheed_image.decode_mask_rle(mask_rle: str | bytes, mask_height: int, mask_width: int) ndarray[tuple[Any, ...], dtype[_ScalarT]][source]
Decode a COCO RLE
countsstring into a binary segmentation mask.Shared by every RHEED mask endpoint the SDK consumes (single-frame
rheed/images/{id}/maskand per-framerheed/images/{id}/frame_masks), which all return the same pycocotoolsfrStringformat.- Parameters:
mask_rle (str | bytes) – COCO run-length-encoding
countsstring (pycocotoolsfrString, column-major / Fortran order).mask_height (int) – Mask height
Hin pixels.mask_width (int) – Mask width
Win pixels.
- Returns:
An
(H, W)uint8array with values 0 or 1.- Return type:
(NDArray)