mask_overlay#

cellpose_omni.plot.mask_overlay(img, masks, colors=None, omni=False)[source]#

overlay masks on image (set image to grayscale)

Parameters
  • img (int or float, 2D or 3D array) -- img is of size [Ly x Lx (x nchan)]

  • masks (int, 2D array) -- masks where 0=NO masks; 1,2,...=mask labels

  • colors (int, 2D array (optional, default None)) -- size [nmasks x 3], each entry is a color in 0-255 range

Returns

RGB -- array of masks overlaid on grayscale image

Return type

uint8, 3D array