Skip to content

API Reference

eozin.Eozin

Eozin(path: str)

Bases: object

A high-performance digital pathology (WSI) image decoder implemented in Rust.

Initializes the decoder from the specified file path.

Parameters:

Name Type Description Default
path str

Path to the whole-slide image file.

required

dimensions property

dimensions: tuple[int, int]

The (width, height) of the level 0 (highest resolution) image.

level_count property

level_count: int

The total number of resolution levels in the image pyramid.

level_dimensions property

level_dimensions: list[tuple[int, int]]

A list of (width, height) for each pyramid level.

level_tile_sizes property

level_tile_sizes: list[tuple[int, int]]

The nominal (width, height) of tiles for each level.

read_region

read_region(location: tuple[int, int], level: int, size: tuple[int, int]) -> PILImage

Reads and combines tiles to return a specific region of the slide.

Parameters:

Name Type Description Default
location tuple[int, int]

(x, y) coordinates of the top-left corner (Level 0).

required
level int

The pyramid level to read from.

required
size tuple[int, int]

(width, height) of the region to extract.

required

Returns:

Type Description
Image

A combined RGB Image object representing the region.

read_tile

read_tile(lv: int, x: int, y: int) -> PILImage

Reads a single tile at the specified level and coordinates.

Parameters:

Name Type Description Default
lv int

The pyramid level index.

required
x int

The horizontal tile index.

required
y int

The vertical tile index.

required

Returns:

Type Description
Image

The decoded tile as a Pillow Image object.