From 43cf7e837a9df7060f0237675a540e9125ee1e7e Mon Sep 17 00:00:00 2001 From: jaknapper Date: Wed, 21 Feb 2024 14:42:52 +0000 Subject: [PATCH] Produce tiff as property --- src/openflexure_microscope_server/things/smart_scan.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/openflexure_microscope_server/things/smart_scan.py b/src/openflexure_microscope_server/things/smart_scan.py index a3c0e5d1..fa22b76d 100644 --- a/src/openflexure_microscope_server/things/smart_scan.py +++ b/src/openflexure_microscope_server/things/smart_scan.py @@ -783,7 +783,7 @@ class SmartScanThing(Thing): @thing_property def stitch_tiff(self) -> bool: - """The maximum distance from the centre of the scan before we break""" + """Whether or not to also produce a pyramidal tiff""" return self.thing_settings.get("stitch_tiff", False) @stitch_tiff.setter @@ -1045,6 +1045,11 @@ class SmartScanThing(Thing): """Generate a stitched image based on stage position metadata""" images_folder = self.images_folder(scan_name=scan_name) + if self.stitch_tiff: + tiff_arg = '--stitch_tiff' + else: + tiff_arg = '--no-stitch_tiff' + if overlap == 0.0: try: with open(os.path.join(images_folder, 'scan_inputs.json')) as data_file: @@ -1053,7 +1058,7 @@ class SmartScanThing(Thing): overlap = data_loaded['overlap'] except: overlap = 0.1 - self.run_subprocess(logger, [self._script, "--stitching_mode", "all", "--minimum_overlap", f"{round(overlap*0.9,2)}", images_folder]) + self.run_subprocess(logger, [self._script, "--stitching_mode", "all", f"{tiff_arg}", "--minimum_overlap", f"{round(overlap*0.9,2)}", images_folder]) @thing_action def create_zip_of_scan(self, logger: InvocationLogger, scan_name: Optional[str]=None, download_zip = True) -> ZipBlob: