> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bioptimus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# bioptimus.io.wsi.metadata

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

```python theme={null}
@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.

**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**:

```python theme={null}
>>> dims = WSIDims(50000, 30000)
>>> props = WSIProps(DIMENSIONS=dims, VENDOR="Hamamatsu")
>>> print(props.DIMENSIONS.width)
50000
>>> print(props["VENDOR"])
'Hamamatsu'
```

***

#### \_\_getitem\_\_

```python theme={null}
def __getitem__(key: str) -> Any
```

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.

<ParamField body="key">
  The name of the property (e.g., 'VENDOR') or raw metadata key (e.g., 'tiff.ImageDescription') to retrieve.
</ParamField>

**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.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.