Skip to content

Commit 0361a02

Browse files
committed
Make CameraDevice use pipeline instead of overriding _process_data.
1 parent 1c16359 commit 0361a02

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

microscope/devices.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,8 @@ def __init__(self, **kwargs):
670670
self._client_transform = (False, False, False)
671671
# Result of combining client and readout transforms
672672
self._transform = (False, False, False)
673+
# Add _apply_transform to pipeline.
674+
self.pipeline.insert(0, self._apply_transform)
673675
# A transform provided by the client.
674676
self.add_setting('transform', 'enum',
675677
lambda: CameraDevice.ALLOWED_TRANSFORMS.index(self._transform),
@@ -688,7 +690,7 @@ def __init__(self, **kwargs):
688690
self.set_roi,
689691
None)
690692

691-
def _process_data(self, data):
693+
def _apply_transform(self, data):
692694
"""Apply self._transform to data."""
693695
flips = (self._transform[0], self._transform[1])
694696
rot = self._transform[2]
@@ -702,7 +704,7 @@ def _process_data(self, data):
702704
(1, 0): numpy.fliplr,
703705
(1, 1): lambda d: numpy.fliplr(numpy.flipud(d))
704706
}[flips](data)
705-
return super()._process_data(data)
707+
return data
706708

707709
def set_readout_mode(self, description):
708710
"""Set the readout mode and _readout_transform."""

0 commit comments

Comments
 (0)