gerlichlab / looptrace

Fork (from EMBL Gitlab) of the looptrace project: https://git.embl.de/grp-ellenberg/looptrace
MIT License
2 stars 1 forks source link

Casting from `np.uint16` to `np.int16` when subtracting background during tracing #325

Closed vreuter closed 4 months ago

vreuter commented 4 months ago

If subtracting background for tracing, we convert arrays of unsigned 2-byte integers to signed 2-byte integers, to handle properly the possibility that a pixel value in background exceeds a pixel value in non-background. This, however, will be problematic for very high pixel values, near the upper bound of the domain for the unsigned 2-byte integer type. We should instead convert to signed 4-byte integers (numpy.int32).