Skip to content

Commit

Permalink
optional saving of .h5 tile coords
Browse files Browse the repository at this point in the history
  • Loading branch information
eabila committed Dec 11, 2023
1 parent 9816cfc commit cb10dd3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lazyslide/wsi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit cb10dd3

Please sign in to comment.