TileSpec, a pure data structure describing tile geometry (size, stride, resolution, measurement unit). This module lives in the data layer so it can be imported by both bioptimus.extraction and bioptimus.models without creating circular dependencies.
For backward compatibility, TileSpec is re-exported from bioptimus.extraction.wsi.types.
TileSpec
size- The size of the tile as(width, height)or a single integer for both dimensions.stride- The stride of the tile as(stride_width, stride_height)or a single integer for both dimensions.resolution- The resolution at which the tile is defined.unit- The unit of measurement for the tile dimensions.
size
(width, height)stride
(stride_width, stride_height)width
height
stride_width
stride_height
scale_to_reference
Ratio of the reference-level downsample to the target-resolution downsample.
Microns-per-pixel at the target resolution.
TileSpec in reference-level pixels.
Raises:
ValueError- Ifunitis notPIXELSorUM, or if the scaled size or stride rounds to zero (the requested geometry is finer than one reference-level pixel).

