From 6a44950a6c63d6061b02593eabe4582c4073b124 Mon Sep 17 00:00:00 2001 From: EricPei20 Date: Tue, 2 Jun 2026 17:10:12 -0700 Subject: [PATCH] Do not automatically set attributes.windowWidth and attributes.windowHeight. --- deapi/client.py | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/deapi/client.py b/deapi/client.py index e364792..75ec4cb 100644 --- a/deapi/client.py +++ b/deapi/client.py @@ -1594,13 +1594,6 @@ def get_result( pixel_format = PixelFormat.from_numpy_dtype(pixel_format) if attributes is None or attributes == "auto": attributes = Attributes(**kwargs) - scan_images = [17, 18, 19, 20, 21, 22, 23, 24, 25] - if frame_type.value in scan_images: - attributes.windowWidth = self.scan_sizex - attributes.windowHeight = self.scan_sizey - else: - attributes.windowWidth = self.image_sizex - attributes.windowHeight = self.image_sizey log.debug("GetResult frameType:%s, pixelFormat:%s", frame_type, pixel_format) start_time = self.GetTime() @@ -1609,12 +1602,6 @@ def get_result( if histogram is None: histogram = Histogram() - if attributes.windowWidth > 0: - self.width = attributes.windowWidth - - if attributes.windowHeight > 0: - self.height = attributes.windowHeight - image = None if logLevel == logging.DEBUG: @@ -2413,24 +2400,6 @@ def wait_for_saving_files(self, quiet=True): log.info(f" {duration:.1f}s") sys.stdout.flush() - def _get_auto_attributes(self, frame_type: FrameType): - """ - Get automatic attributes for the current acquisition settings. - Returns - ------- - Attributes - The automatic attributes for the current acquisition settings. - """ - attributes = Attributes() - scan_images = [17, 18, 19, 20, 21, 22, 23, 24, 25] - if frame_type.value in scan_images: - attributes.windowWidth = self.scan_sizex - attributes.windowHeight = self.scan_sizey - else: - attributes.windowWidth = self.image_sizex - attributes.windowHeight = self.image_sizey - return attributes - @deprecated_argument("pixelFormat", alternative="pixel_format", since="5.2.1") @deprecated_argument("fileName", alternative="file_name", since="5.2.1") @deprecated_argument("textSize", alternative="text_size", since="5.2.1") @@ -2461,7 +2430,7 @@ def get_image( if isinstance(frame_type, str): frame_type = getattr(FrameType, frame_type.upper()) if attributes == "auto": - attributes = self._get_auto_attributes(frame_type) + attributes = Attributes() self.StartAcquisition(1)