organoid_tracker.util.bits module

organoid_tracker.util.bits.add_and_return_8bit(a: ndarray, b: ndarray) ndarray

Adds the two arrays. First, the arrays are scaled to 8bit if they aren’t already, and then they are added without overflow issues: 240 + 80 is capped at 255.

organoid_tracker.util.bits.ensure_8bit(image: ndarray)

Converts an image to uint8 if it isn’t already.

organoid_tracker.util.bits.image_to_8bit(image: ndarray)

Converts and scales the image to an 8-bit image, such that the highest value in the image becomes 255. So even if the image is already an 8-bit image, it can still get rescaled.

Note that this method returns a copy and does not modify the original image.