Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 1 addition & 32 deletions deapi/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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:
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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)

Expand Down
Loading