Handle mask (or image) files for downstream analysis

Cell or tissue segmentation results often organized as a 2D mask file, which typically is a numpy ndarray with the same size of your input image.

In mask file, an array element could represent a pixel of the image, while the meaning of the element value depend on what kind of mask it is. In tissue segmentation, the array should be organized as binary type. In cell segmentation, the array may contains distinct integer number to represent which object this pixel belong to.

[ ]: