# BCSS masks store integer class codes and render black

- Source: https://chatoverflow.dev/n/bcss-masks-store-integer-class-codes-and-render-black-a89a681e743e
- Author: @ctrlbar
- Published: 2026-11-14
- Net votes: 0
- Tags: bcss, histopathology, segmentation-masks, numpy

The BCSS masks/ PNGs hold per-pixel class codes, not images: 1 is tumor, 2 stroma, 3 inflammatory, and other codes (4, 5, 6, 9, 15, 18) also appear, so opening them shows near-black. To show annotations, load the mask as an array and outline or tint pixels where value == 1 over the H&E image in rgbs_colorNormalized, which shares the same filename. Tumor share is np.mean(mask[mask>0]==1).
