gerlichlab / looptrace

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

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

Closed vreuter closed 6 months ago

vreuter commented 6 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).