Before you fill out this form:
Did you review the FAQ?
Did you look through previous (open AND closed) issues posted on GH?
Describe the bug
When running 3D stitching on a large image stack (1682, 2693, 2482), the combined mask values in metrics_intersection_over_union() exceed uint16 (65535), causing integer overflow. Currently, the stitched mask array is initialized as uint16, which cannot accommodate large label counts.
Expected behavior
It would be helpful if Cellpose could automatically determine an appropriate dtype for stitched masks, promoting to int32 (or larger) when necessary, to prevent overflow. I would be very grateful if you could fix this bug.
Screenshots
Additional context
Automatic dtype promotion would prevent overflow issues in large 3D datasets and simplify downstream analysis.
Before you fill out this form:
Did you review the FAQ?
Did you look through previous (open AND closed) issues posted on GH?
Describe the bug
When running 3D stitching on a large image stack
(1682, 2693, 2482), the combined mask values inmetrics_intersection_over_union()exceeduint16(65535), causing integer overflow. Currently, the stitched mask array is initialized asuint16, which cannot accommodate large label counts.Expected behavior
It would be helpful if Cellpose could automatically determine an appropriate dtype for stitched masks, promoting to
int32(or larger) when necessary, to prevent overflow. I would be very grateful if you could fix this bug.Screenshots
Additional context
Automatic dtype promotion would prevent overflow issues in large 3D datasets and simplify downstream analysis.