delmic / odemis

Open Delmic Microscope Software
GNU General Public License v2.0
47 stars 39 forks source link

[fix] acq.Stream.getPixelCoordinates() shouldn't detect pixel -0.5,-0.5 as inside the image #2847

Closed pieleric closed 1 month ago

pieleric commented 3 months ago

getPixelCoordinates() returns None if the coordinates are inside the image. If going just out the image on the left or top, the X/Y value could be between -1 and 0. However, in Python "int()" trunc the value to 0, and would claim this position is within the image, while it's just outside. => Use floor() to properly detect it.

Note: it's most noticeable on data sets with just 1x1 pixel in X/Y. Still no one had really noticed in a few years.

tmoerkerken commented 2 months ago

In your description: getPixelCoordinates() returns None if the coordinates are inside the image.

You mean outside, right?