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.
Full slide width and height.
The tissue-containing region of the slide.
The number of resolution levels in the pyramid.
Microns per pixel in the X dimension.
Microns per pixel in the Y dimension.
The magnification power of the objective lens.
The name of the scanner vendor or backend.
The filesystem path to the slide file.
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'