Repository navigation
wsi-rs 0.8.0
wsi-rs 0.8.0 uses J2K 0.12.0 and JXR 0.3.0 and requires Rust 1.99 or newer. This release includes the changes prepared for 0.7.0; the previous published version was 0.6.0.
The Rust crate supports CPU reads plus optional Metal and CUDA JPEG 2000 decoding. The attached unsigned OpenSlide-compatible libraries enable Metal on macOS and CUDA on Linux. The Windows library provides CPU decoding; J2K currently generates CUDA kernels on Linux hosts. Each platform archive contains the library and its build metadata and SBOMs.
[0.8.0] - 2026-10-06
Added
MetalBackendSessions::prewarmcompiles a session's JPEG 2000 GPU kernels
ahead of time, so the first slide read doesn't wait for them.
Changed
- Requires Rust 1.99 or newer.
- Uses J2K 0.12.0 and JXR 0.3.0, including the updated CUDA and Metal batch
decode paths. - CUDA JPEG 2000 tile reads use bounded encoded-image batches for parallel
planning and pooled uploads. Results keep their request order and logical
crop; a recoverable tile failure does not discard neighboring results. - Metal JPEG 2000 batches share Tier-1 dispatch across compatible prepared
groups while retaining the existing 4 MiB execution window. .svcachefiles are looked up in~/.cache/wsi-rs/svcache/instead of
~/.cache/slideviewer/svcache/. Move existing cache files there or rebuild
them.- The OpenSlide shim opens slides with a 32 MiB tile cache, matching OpenSlide
4.0.1, and no display cache; format-specific caches scale down with it. - The OpenSlide shim composes small MIRAX reads in one pass and writes cached
regular-grid regions directly into the caller's pixel buffer. - Faster XML metadata parsing when opening ARGOS, Leica, Philips and Ventana
slides. - With the
route-telemetryfeature, route tile counts are reported only in
the per-device sections; theexecutionsection no longer repeats them.
Fixed
- Concurrent single-tile reads of one DICOM slide no longer queue behind each
other under the default memory limits, and Metal decodes DICOM frames in
groups instead of one at a time. - DICOM slides that store progressive JPEG frames under the baseline JPEG
transfer syntax, as some 3DHISTECH scanners do, now read in full. - Multi-tile JPEG reads also use CPU cores that free up while the read is
running, so concurrent reads finish sooner. - CPU batch helpers yield cores when new callers need them. Concurrent tiled
TIFF JPEG reads avoid adding caller threads to a pool that already uses
every CPU core. - MIRAX JPEG reads reserve memory from indexed source sizes, so small tiles
can share a bounded batch instead of each reserving the maximum input size. - MIRAX source batches decode on the caller with help from the shared CPU
pool. JPEG tiles with known dimensions use J2K's direct output API and
reusable decode scratch, including TIFF tiles whose color hints match the
JPEG header. Larger MIRAX reads use wider bounded row bands to reduce
repeated tile planning. - The first GPU calibration read no longer includes Metal kernel compilation,
which could make a decode route settle on the CPU.
Security
- Tiny raw JPEG 2000 files with impossible tile grids are rejected before
decoding can spend excessive time processing absent tiles. - Malformed DICOM file-meta headers using
SVorUVno longer bypass length
checks and trigger oversized allocations.
[0.7.0] - 2026-09-28
Added
- 12-bit JPEG DICOM slides (JPEG Extended and progressive JPEG). Reads return
16-bit RGB samples holding the 12-bit values; grayscale expands to RGB.
12-bit decoding runs on the CPU. The OpenSlide shim rejects 12-bit DICOM, as
OpenSlide does. - Hamamatsu VMU slides, with full 16-bit samples, metadata and macro images.
The OpenSlide shim returns them as 8-bit RGB, as OpenSlide does. - ARGOS and Huron TIFF slides, including ARGOS sparse tiles and z-planes, and
associated images for both. - Zeiss CZI slides: single-plane brightfield scans stored uncompressed, as JPEG
or as JPEG XR. 16-bit embedded preview images keep all 16 bits. - JPEG XR tiles in tiled TIFF files.
- DICOM JPEG Extended, progressive JPEG and lossless JPEG transfer syntaxes.
- Raw JPEG 2000 codestreams (
.j2k,.j2c) expose each resolution as a
pyramid level, matching OpenJPEG's reduced-resolution decodes exactly. - Raw compressed JPEG tile access for CZI, MIRAX, full-resolution VMS and
ordinary tiled TIFF. - Olympus VSI raw JPEG 2000 tile access and GPU-resident Metal and CUDA tile
reads. - Per-slide resource limits (
SlideLimits). - ICC profiles for associated images, also through the OpenSlide shim.
- GPU-resident JPEG 2000 and HTJ2K tile reads on Metal and CUDA
(read_tile_metal,read_tiles_metal,read_tile_cuda,read_tiles_cuda).
Changed
- All normal reads (tiles, batches, regions, display tiles and associated
images) returnCpuTile. CustomSlideReaderimplementations provide one CPU
tile method, and batch reads keep request order by default. DecodeAcceleration::{Auto, CpuOnly}replaces the output-routing and sampling
controls.Autouses the GPU for JPEG 2000 only when it measures at least 15%
faster, including copying the result back, and falls back to the CPU on any
GPU error.- The GPU is timed on a background thread instead of during the read, except
for batches too large to keep after the read. The CPU is timed on the read
that needs the tiles. If GPU startup is much slower than CPU decoding, that
kind of tile stays on the CPU. - All JPEG 2000 CPU decoding shares one thread pool for the process.
Per-slide thread-pool settings are gone. - Default caches are 64 MiB for decoded tiles, 32 MiB for display tiles and
32 MiB shared by format-specific caches. Older per-cache settings are scaled
to fit that total. - Every built-in format counts the metadata and indexes it parses against the
slide's limits. Custom readers are trusted while opening, and their reads
reserve memory conservatively. - Ventana reduced levels are slower than in 0.6 because they are now stitched
correctly (see Fixed). They are still faster than OpenSlide. - On Apple Silicon Macs, slide fingerprints use the CPU's SHA-256 instructions.
Removed
TileOutputPreference,DeviceOutputContext,OutputBackendRequest,
TilePixels,DeviceTile, the public route-decision types, the route-sample
setting and GPU decoding of ordinary JPEG. UseDecodeAccelerationand the
GPU-resident tile APIs instead.SlideReader::recommended_shared_cache_bytes. Cache sizes are set per slide.
Fixed
Pixels that differed from OpenSlide:
- NDPI and VMS levels that OpenSlide derives by JPEG scaling (1/2, 1/4, 1/8)
now match OpenSlide 4.0.1 exactly. They differed by up to 3 levels, or up to
about 160 for slides with subsampled color. - Ventana BIF reduced levels are built from the stitched full-resolution tile
map, as OpenSlide does. They used the unstitched overview images, which put
tissue 36 to 60 µm out of place and showed blank filler. - Overlapping tiles in Ventana level 0 and MIRAX are painted in OpenSlide's
order and arithmetic, so overlaps look the same as in OpenSlide. - MIRAX levels whose images split into fractional sub-tiles are resampled at
their exact offsets, and RGB sources use Pixman's rounding, as in OpenSlide. - The OpenSlide shim keeps partly covered edge pixels on Ventana and MIRAX
reduced levels. - Metal YCbCr-to-RGB conversion matches the CPU exactly; non-neutral colors
were off. - Sparse Philips and generic TIFF tiles stay transparent in single and batched
reads. - DICOM honors RGB and YBR color-transform metadata.
- Invalid levels, missing associated images, the shim's error state,
zero-length ICC reads, Leica barcodes and slide bounds behave as in OpenSlide. - Raw JPEG 2000 slides report
openslide.vendorandopenslide.quickhash-1
like other formats. - J2K 0.11.3 fixes JPEG 2000 decoding of subsampled images whose origin is not
zero.
Crashes, hangs and bad files:
- Fixed a deadlock when several readers read display tiles from the same
generated NDPI level. - Concurrent MIRAX reads no longer interfere with each other.
- Generated NDPI levels use virtual tiles, so zooming and fractional regions
don't decode an entire level. - Short TIFF payloads, malformed CZI payload lengths and invalid CZI geometry
are rejected before decoding. - Aperio, Ventana, DICOM, NDPI and MIRAX reject bad geometry, bad sparse data,
out-of-range offsets and non-finite physical metadata. - Corrupt JPEG 2000 codestreams fail immediately instead of retrying, and no
longer build excessive coding trees (J2K 0.11.3). - Corrupt MIRAX slides are recognized as MIRAX, so opening reports the real
error. - CZI keeps planes separate, respects resource limits and keeps mosaic overlap
order. Requests for missing native levels return errors. - Generic TIFF and Philips associated images use each image's own JPEG tables
and decode one strip at a time. - VMS reads keep complete index records when the file ends with an incomplete
row. - The shim installer no longer creates incorrect
libopenslide.4aliases.
Speed and memory:
- Multi-tile JPEG reads from tiled TIFF slides (SVS, Leica and similar) decode
in parallel again. - NDPI region reads no longer queue behind other readers' work.
- MIRAX handles opened on the same files share one parsed index.
- OpenSlide-compatible region reads use row bands to cap memory, compose cached
regions straight into the output, and skip empty areas of sparse slides. - Ventana reduced levels decode each stored tile once per batch and no longer
re-decode tiles while panning. - Aperio reduced-level, zoom and thumbnail reads are back to 0.6 speed.
- Cached region reads from MIRAX, VMS, CZI and ZVI are faster with many
concurrent readers. - CZI reuses decoded source blocks across neighboring output tiles.
- Region reads stream large requests in batches sized to the memory budget.