Version 2.9.0 – Philips TIFF Support and Explicit Zoom-Level Reading

We are pleased to announce the release of SlideIO version 2.9.0, an update to our open-source library for pathology image analysis.

This version adds a driver for Philips TIFF (iSyntax/PHTIFF) whole slide images, introduces an API for reading a named zoom level directly, and fixes a CZI pyramid defect that could silently return partially blank images.

Highlights

Philips TIFF Support

SlideIO now reads Philips TIFF whole slide images as a first-class format, bringing the number of supported formats to 13.

  • Philips files are recognised by automatic format detectionopen_slide(path) with the default driver="AUTO" picks the PHTIFF driver, while plain TIFFs keep going to GDAL and OME-TIFF files to the OMETIFF driver.
  • The full zoom pyramid is exposed. Pyramid levels are paired with TIFF directories by the level number the directory itself declares, and the tile padding that Philips writes at the right and bottom edges of each level is cropped, so level content sizes are consistent across the pyramid.
  • Auxiliary images — thumbnail, macro and label — are available through the usual get_aux_image() interface.
  • Objective magnification and the structured slide and scene metadata tree are reported for Philips files, using the metadata API introduced in 2.8.1.
  • The Philips parsing path is hardened against incomplete and malformed input: a slide with a non-numeric attribute value stays readable instead of failing to open.

Explicit Zoom-Level Reading

Tiled viewers address image data as (level, column, row) and already know the rectangle they want in the coordinates of that level. Until now they had to convert it to full-resolution coordinates and let the library convert it back, which caused visible geometric drift between levels and unnecessary work per read.

A new read method removes that round trip. In Python:

import slideio

slide = slideio.open_slide("image.svs")
scene = slide.get_scene(0)

level = 2
info = scene.get_zoom_level_info(level)

for tile in range(info.tile_count):
    r = info.get_tile_rect(tile)
    raster = scene.read_block_from_level(level, (r.x, r.y, r.width, r.height))

read_block_from_level(level, rect, size, channel_indices, slices, frames) takes the rectangle in the coordinate system of the level you name, reads from that level and no other, and returns background for any part of the rectangle that falls outside the level. A size of (0,0) gives native level pixels; any other value rescales from the named level only. The slices and frames arguments cover 3D and 4D scenes, so one method serves every dimensionality.

Two helpers on the level info object are now exposed to Python as well: tile_count and get_tile_rect(index), which give a viewer the tile grid of a level directly, in level coordinates.

In C++ the equivalents are Scene::readResampledLevelBlockChannels() and Scene::readResampledLevel4DBlockChannels().

A new notebook, zoom-levels.ipynb, has been added to the SlideIO tutorial for this API. It shows how to inspect a scene’s zoom levels, read a region in a level’s own coordinate system, walk a level tile by tile the way a viewer or tile cache would, and avoid the assumptions about level geometry that real files break.

Native implementations are provided by the SVS, PHTIFF, NDPI, CZI, DICOM WSI, VSI/ETS, SCN, OME-TIFF and PKE drivers; the remaining scenes use a correct generic default. Single-level GDAL and PKE small scenes now register their one zoom level, so the level API is uniform across every format.

The existing read_block is unchanged — signature and behaviour are identical, bit for bit.

Bug Fixes and Improvements

  • CZI: fixed a defect where a single pyramid level was split into two zoom levels when sub-block size and stored-size ratios differed, causing read_block() to silently return a partially blank image (#70, contributed by @ebnertom).
  • AFI: fixed a metadata bug in the driver.
  • imagetools: TIFFKeeper is now a move-only owning handle that closes the handle it holds before taking a new one, fixing a leak on reassignment. This is a source-breaking change for out-of-tree users of slideio-imagetools — see software-docs/BREAKING_CHANGES.md.
  • C++ code quality improvements following the project coding guidelines (contributed by @Harold2017).
  • Build tooling: compiler version auto-detection on Windows, toolchain synchronisation moved into a standalone sync-toolchain.py, and a new GitHub Actions build-validation workflow.

Getting Started

A comprehensive tutorial with step-by-step instructions and code samples is available in our GitHub repository:

https://github.com/Booritas/slideio-tutorial

We welcome your feedback and issue reports on GitHub and appreciate your continued support of the SlideIO project.