From df918bf2860c2a6979ec8477d54d7e63a167114c Mon Sep 17 00:00:00 2001 From: jaknapper Date: Thu, 31 Jul 2025 13:53:57 +0100 Subject: [PATCH 1/2] Prepend images with img_ --- src/openflexure_microscope_server/things/autofocus.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/openflexure_microscope_server/things/autofocus.py b/src/openflexure_microscope_server/things/autofocus.py index 3ec21a74..30b93d20 100644 --- a/src/openflexure_microscope_server/things/autofocus.py +++ b/src/openflexure_microscope_server/things/autofocus.py @@ -141,8 +141,10 @@ class CaptureInfo: @property def filename(self) -> str: - """The filename for this image generated from the position.""" - return f"{self.position['x']}_{self.position['y']}_{self.position['z']}.jpeg" + """The filename for this image generated from the position, prepended with "img_".""" + return ( + f"img_{self.position['x']}_{self.position['y']}_{self.position['z']}.jpeg" + ) def _get_capture_by_id(captures: list[CaptureInfo], buffer_id: int) -> CaptureInfo: From c00c027ab16fb2035849be17fbf5b11d030d6511 Mon Sep 17 00:00:00 2001 From: Joe Knapper Date: Thu, 31 Jul 2025 14:52:21 +0000 Subject: [PATCH 2/2] Apply suggestions from code review of branch img-name Co-authored-by: Julian Stirling --- src/openflexure_microscope_server/things/autofocus.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/openflexure_microscope_server/things/autofocus.py b/src/openflexure_microscope_server/things/autofocus.py index 30b93d20..de2fc1d1 100644 --- a/src/openflexure_microscope_server/things/autofocus.py +++ b/src/openflexure_microscope_server/things/autofocus.py @@ -141,7 +141,11 @@ class CaptureInfo: @property def filename(self) -> str: - """The filename for this image generated from the position, prepended with "img_".""" + """The filename for this image generated from the position. + + The file name is in the format ``img_{x}_{y}_{z}`` where x, y, and z are the + positions from the microscope stage. + """ return ( f"img_{self.position['x']}_{self.position['y']}_{self.position['z']}.jpeg" )