-
Notifications
You must be signed in to change notification settings - Fork 597
Description
Describe the Bug (might not be a bug tho)
Hi @carsen-stringer!
I found three suspicious implementations in intensity normalization but could only identify two as potential bugs. I attempted to fix these two in #981, but I still wonder if the third issue should be addressed:
To invert the image so that dark cells become bright cells while the bright background becomes darker, the current implementation is:
cellpose/cellpose/transforms.py
Lines 666 to 667 in 84344b0
| if (tile_norm_blocksize > 0 or normalize) and invert: | |
| img_norm[..., c] = -1 * img_norm[..., c] + 1 |
essentially:
image = -1 * image + 1However, image here is usually the output of a percentile-based normalization like normalize99() and is not strictly within the [0, 1] range. I guess most pixels are in [0, 1] so this inversion makes sense, but still some are outside [0, 1]. I haven't thoroughly thought this through. Is this a problem, or is it working as intended?
Many thanks!