SingleCellStatic.update_sc_mask_by_crop(mask, padding_pixels=array([0, 0]), bbox=None)[source]

Updates the single cell mask by cropping the input mask to the bounding box of the single cell and updating the contour.

  • mask (np.ndarray) – The input mask to crop.

  • padding_pixels (np.ndarray, optional) – The number of pixels to pad the bounding box by, by default np.zeros(2, dtype=int).

  • bbox (np.ndarray, optional) – The bounding box of the single cell, by default None.


AssertionError – If the input mask has more than one contour.