cellmil.data.cucim_deepzoom

Classes

DeepZoomGeneratorCucim(osr, cucim_slide[, ...])

Create a DeepZoomGenerator, but instead of utilizing OpenSlide, use cucim to read regions.

class cellmil.data.cucim_deepzoom.DeepZoomGeneratorCucim(osr: OpenSlide, cucim_slide: Any, tile_size: int = 254, overlap: int = 1, limit_bounds: bool = False)[source]

Bases: DeepZoomGenerator

Create a DeepZoomGenerator, but instead of utilizing OpenSlide, use cucim to read regions.

Parameters:
  • osr (OpenSlide) – OpenSlide Image. Needed for OS compatibility and for retrieving metadata.

  • cucim_slide (CuImage) – CuImage slide. Used for retrieving image data.

  • tile_size (int, optional) – the width and height of a single tile. For best viewer performance, tile_size + 2 * overlap should be a power of two. Defaults to 254.

  • overlap (int, optional) – the number of extra pixels to add to each interior edge of a tile. Defaults to 1.

  • limit_bounds (bool, optional) – True to render only the non-empty slide region. Defaults to False.

__init__(osr: OpenSlide, cucim_slide: Any, tile_size: int = 254, overlap: int = 1, limit_bounds: bool = False)[source]

Create a DeepZoomGenerator wrapping an OpenSlide object.

osr: a slide object. tile_size: the width and height of a single tile. For best viewer

performance, tile_size + 2 * overlap should be a power of two.

overlap: the number of extra pixels to add to each interior edge

of a tile.

limit_bounds: True to render only the non-empty slide region.

get_tile(level: int, address: tuple[int, int]) Image[source]

Return an RGB PIL.Image for a tile.

Parameters:
  • level (int) – the Deep Zoom level

  • address (tuple[int, int]) – the address of the tile within the level as a (col, row) tuple

Returns:

PIL Image

Return type:

Image.Image