# Whole-Slide Imaging in Rust

Canonical page: https://frames-sg.com/whole-slide-imaging-rust/

`wsi-rs` reads whole-slide images through one Rust API. Applications can inspect slide pyramids and scanner metadata, read arbitrary regions, access the exact stored tiles, request regular display tiles and retrieve associated images such as labels, macros and thumbnails.

## Supported inputs

The maintained format table includes Aperio SVS, Hamamatsu NDPI/VMS/VMU, Leica SCN, Roche Ventana BIF, Philips TIFF, Trestle, ARGOS, Olympus VSI, Zeiss CZI/ZVI, 3DHISTECH MIRAX, DICOM VL Whole Slide Microscopy, single-file OME-TIFF, supported tiled TIFF, raw JPEG 2000 and the wsi-rs pre-decoded cache format. Format-specific limitations remain explicit in the project README.

## Pixel and metadata access

- Inspect scenes, series, pyramid levels, level dimensions and downsample factors.
- Read a rectangle from any level and stitch the required source tiles.
- Read native stored tiles or regular display tiles for a viewer.
- Read label, macro, thumbnail and other associated images.
- Access common scanner properties through OpenSlide-compatible names while retaining vendor-specific properties.
- Apply bounded caches and per-operation memory limits.

Optional Metal and CUDA features accelerate supported JPEG 2000 and HTJ2K tile routes. Normal read methods return CPU memory. Explicit resident APIs keep supported output on the selected device and return an error for unsupported codecs instead of falling back.

## Install and references

```sh
cargo add wsi-rs
```

- [API documentation](https://docs.rs/wsi-rs)
- [Source repository](https://github.com/frames-sg/wsi-rs)
- [DICOM whole-slide conversion](https://frames-sg.com/dicom-whole-slide-conversion/)
- [Rust JPEG XR codec](https://frames-sg.com/rust-jpeg-xr-codec/)
