Skip to content

Commit e26017a

Browse files
committed
ATMCD ROI/binning fixes.
Corrected imports, buffer shape and on-hardware image flip.
1 parent 676a392 commit e26017a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

microscope/cameras/atmcd.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ def __str__(self):
11291129
from threading import Lock
11301130
import functools
11311131
from microscope import devices
1132-
from microscope.devices import keep_acquiring, Setting, Binning, Roi
1132+
from microscope.devices import keep_acquiring, Setting, Binning, ROI
11331133
import time
11341134

11351135
# A lock on the DLL used to ensure DLL calls act on the correct device.
@@ -1223,8 +1223,8 @@ def initialize(self):
12231223
# Initialize the library and connect to camera.
12241224
Initialize(b'')
12251225
# Initialise ROI to full sensor area and binning to single-pixel.
1226-
self._set_roi()
1227-
self._set_binning()
1226+
self._set_roi(ROI(0,0,0,0))
1227+
self._set_binning(Binning(1,1))
12281228
# Check info bits to see if initialization successful.
12291229
info = GetCameraInformation(self._index)
12301230
if not info & 1<<2:
@@ -1364,7 +1364,7 @@ def _fetch_data(self):
13641364
height = roi.height // binning.v
13651365
try:
13661366
with self:
1367-
data = GetOldestImage16(width * height).reshape(width, height)
1367+
data = GetOldestImage16(width * height).reshape(height, width)
13681368
except AtmcdException as e:
13691369
if e.status == DRV_NO_NEW_DATA:
13701370
return None
@@ -1478,7 +1478,7 @@ def _set_readout_mode(self, mode_index):
14781478
# opposite edges from the chip. We set the horizontal flip
14791479
# so that the returned image orientation is independent of
14801480
# amplifier selection
1481-
SetImageFlip(mode.amp, 0)
1481+
SetImageFlip(not mode.amp, 0)
14821482
SetHSSpeed(mode.amp, mode.hsindex)
14831483

14841484
def _get_sensor_shape(self):

0 commit comments

Comments
 (0)