From cb10dd357973353f868e64d6326a3682d70a8860 Mon Sep 17 00:00:00 2001 From: ernestoab Date: Mon, 11 Dec 2023 19:08:39 +0100 Subject: [PATCH] optional saving of .h5 tile coords --- lazyslide/wsi.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lazyslide/wsi.py b/lazyslide/wsi.py index e637b20..d2df7b7 100644 --- a/lazyslide/wsi.py +++ b/lazyslide/wsi.py @@ -524,7 +524,9 @@ def create_tiles( self.h5_file.set_tile_ops(self.tile_ops) self.h5_file.save() - def new_tiles(self, tiles_coords, height, width, level=0, format="top-left"): + def new_tiles( + self, tiles_coords, height, width, level=0, format="top-left", save=False + ): """Supply new tiles to WSI The default coordination for tiles in top-left, you can change this @@ -556,9 +558,10 @@ def new_tiles(self, tiles_coords, height, width, level=0, format="top-left"): ops_height=height, ops_width=width, ) - self.h5_file.set_coords(self.tiles_coords) - self.h5_file.set_tile_ops(self.tile_ops) - self.h5_file.save() + if save: + self.h5_file.set_coords(self.tiles_coords) + self.h5_file.set_tile_ops(self.tile_ops) + self.h5_file.save() def report(self): if self.tile_ops is not None: