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

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. Attributes:
  • 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:

__getitem__

Allows dictionary-style access to properties. Tries to retrieve the value from the class attributes first. If not found, it attempts to look up the key in the ‘RAW’ metadata dictionary.
The name of the property (e.g., ‘VENDOR’) or raw metadata key (e.g., ‘tiff.ImageDescription’) to retrieve.
Returns:
  • Any - The value associated with the key.
Raises:
  • KeyError - If the key is not a valid field of the class and is not present in the raw metadata dictionary.