mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 11:41:49 +02:00
fix(image): raw data are saved in image item to always have precise processing
This commit is contained in:
@ -496,6 +496,7 @@ class BECImageShow(BECPlotBase):
|
|||||||
data = msg["data"]
|
data = msg["data"]
|
||||||
device = msg["device"]
|
device = msg["device"]
|
||||||
image = self._images["device_monitor"][device]
|
image = self._images["device_monitor"][device]
|
||||||
|
image.raw_data = data
|
||||||
self.process_image(device, image, data)
|
self.process_image(device, image, data)
|
||||||
|
|
||||||
@pyqtSlot(str, np.ndarray)
|
@pyqtSlot(str, np.ndarray)
|
||||||
@ -528,7 +529,7 @@ class BECImageShow(BECPlotBase):
|
|||||||
"""
|
"""
|
||||||
for source, images in self._images.items():
|
for source, images in self._images.items():
|
||||||
for image_id, image in images.items():
|
for image_id, image in images.items():
|
||||||
data = image.get_data()
|
data = image.raw_data
|
||||||
self.process_image(image_id, image, data)
|
self.process_image(image_id, image, data)
|
||||||
|
|
||||||
def _connect_device_monitor(self, monitor: str):
|
def _connect_device_monitor(self, monitor: str):
|
||||||
|
@ -71,6 +71,7 @@ class BECImageItem(BECConnector, pg.ImageItem):
|
|||||||
|
|
||||||
self.parent_image = parent_image
|
self.parent_image = parent_image
|
||||||
self.colorbar_bar = None
|
self.colorbar_bar = None
|
||||||
|
self._raw_data = None
|
||||||
|
|
||||||
self._add_color_bar(
|
self._add_color_bar(
|
||||||
self.config.color_bar, self.config.vrange
|
self.config.color_bar, self.config.vrange
|
||||||
@ -80,6 +81,14 @@ class BECImageItem(BECConnector, pg.ImageItem):
|
|||||||
self.set(**kwargs)
|
self.set(**kwargs)
|
||||||
self.connected = False
|
self.connected = False
|
||||||
|
|
||||||
|
@property
|
||||||
|
def raw_data(self) -> np.ndarray:
|
||||||
|
return self._raw_data
|
||||||
|
|
||||||
|
@raw_data.setter
|
||||||
|
def raw_data(self, data: np.ndarray):
|
||||||
|
self._raw_data = data
|
||||||
|
|
||||||
def apply_config(self):
|
def apply_config(self):
|
||||||
"""
|
"""
|
||||||
Apply current configuration.
|
Apply current configuration.
|
||||||
|
Reference in New Issue
Block a user