Digital pathology / WSI / Rust

Whole-Slide Imaging in Rust

wsi-rs reads vendor whole-slide images through one Rust API. Open a slide, inspect its pyramid and metadata, then request only the tiles or regions your application needs.

Navigate images too large to load.

A slide can contain billions of pixels. wsi-rs exposes the stored pyramid so applications can work on a viewport, tile or associated image instead of materializing the entire scan.

Pyramids

Scenes, series and levels

Inspect dimensions and downsample factors for each pyramid level, discover multiple scanned scenes, and read label, macro and thumbnail images when the source provides them.

Pixel access

Regions and stored tiles

Read an arbitrary rectangle, request the exact tiles stored in the source, or ask for regular display tiles suitable for a viewer regardless of the scanner’s native tile geometry.

Metadata

One application-facing model

Access common scanner properties through OpenSlide-compatible names while retaining vendor-specific values. Decode failures return errors rather than fabricated pixels.

Vendor files, DICOM and tiled images.

Scanner families

Pathology WSI through one API

Aperio SVS, Hamamatsu NDPI/VMS/VMU, Leica SCN, Roche Ventana BIF, Philips TIFF, Trestle, ARGOS, Olympus VSI, Zeiss CZI/ZVI and 3DHISTECH MIRAX are represented in the maintained format table.

Interchange

DICOM and OME-TIFF plus tiled TIFF

Read DICOM whole-slide studies, single-file OME-TIFF pyramids, supported tiled TIFF images and raw JPEG 2000 codestreams.

Support is explicit

Unsupported shapes return errors

Format-specific limitations are documented. For example, Sakura is not supported because no public sample file is available for validation.

Read a region.

Start with the portable CPU build. Enable Metal on macOS or CUDA on supported Linux hosts when JPEG 2000 or HTJ2K tile acceleration fits the workload.

LibraryPortable
$ cargo add wsi-rs

Open supported slides and read their pyramids, regions, tiles and associated images.

GPU featuresOptional
wsi-rs = { version = "0.8", features = ["metal"] }
# or features = ["cuda"]

Normal methods return CPU memory. Explicit resident tile APIs keep supported JPEG 2000 and HTJ2K output on the device.

From reading to interchange