Skip to main content
WSI Metadata Properties Module. This module defines the schema and container for metadata extracted from Whole Slide Images (WSI). It provides a unified structure for handling physical, optical, and structural properties across different scanner vendors and file formats.

WSIProps

@dataclass(frozen=True)
class WSIProps()
Whole Slide Image (WSI) properties container. This class stores essential metadata required for WSI processing pipelines. It supports attribute access and dictionary-style key-based lookup with an automated fallback to raw vendor metadata.
DIMENSIONS
WSIDims
Full slide width and height.
BOUNDS
WSIBounds
The tissue-containing region of the slide.
LEVELS
int | None
The number of resolution levels in the pyramid.
MPP_X
MPP | None
Microns per pixel in the X dimension.
MPP_Y
MPP | None
Microns per pixel in the Y dimension.
OBJECTIVE_POWER
Magnification | None
The magnification power of the objective lens.
VENDOR
str | None
The name of the scanner vendor or backend.
FILE_PATH
Path
The filesystem path to the slide file.
RAW
dict[str, Any] | None
A dictionary containing all unprocessed metadata from the slide.
Example:
>>> dims = WSIDims(50000, 30000)
>>> props = WSIProps(DIMENSIONS=dims, VENDOR="Hamamatsu")
>>> print(props.DIMENSIONS.width)
50000
>>> print(props["VENDOR"])
'Hamamatsu'