python-microscope / microscope

Python library for control of microscope devices, supporting hardware triggers and distribution of devices over the network for performance and flexibility.
https://www.python-microscope.org
GNU General Public License v3.0
66 stars 38 forks source link

Camera pixel positions should always start from 0 #294

Open iandobbie opened 8 months ago

iandobbie commented 8 months ago

A recent discussion brought up that some cameras start counting pixels at 0,0 (eg ximea cameras) and some start from pixel 1,1 (eg Andor cameras).

I propose we should specify that camera pixel positions eg for ROI definitions, should always start at 0,0. This is expected behavior in Python. If the lower level interface expects counting to start at 1,1 then the hardware specific microscope code should deal with the translation of this to 0,0.

juliomateoslangerak commented 8 months ago

Looking at abc camera code, it seems that the ROI is specified as:

So roi.left + (roi.width * binning.h) =< sensor.width. This logic is implemented as a validation in some cameras. We could move it to abc.

Is this how it is supposed to be? If so:

juliomateoslangerak commented 8 months ago

I pushed some of the changes discussed here to this branch. Can you have a look? https://github.com/juliomateoslangerak/microscope/tree/add_hahamatsu_roi