Skip to content

Add PLIP, iSyntax reader, faster TIFF thumbnails, and converter/device fixes - #247

Merged
guillaumejaume merged 7 commits into
mainfrom
feat/combined-community-prs
Nov 18, 2026
Merged

guillaumejaume merged 7 commits into
mainfrom
feat/combined-community-prs

Conversation

@guillaumejaume

Copy link
Copy Markdown
Contributor

Combines five community PRs into one, aligned with the rest of the codebase. Contributor commits are cherry-picked with their authorship. Where a PR could not be applied as is, it is credited with Co-authored-by.

Source Change How it was brought in
#225 Single-level TIFF thumbnails through libvips, with fallback to OpenSlide Cherry-picked as is
#241 Native Philips iSyntax reader (--reader_type isyntax, .[isyntax] extra) Cherry-picked as is, plus unit tests and doc updates
#108 device can be a torch.device as well as a string Rewritten for the 3 call sites on main (the PR fixed 1)
#194 Converted TIFFs saved with JPEG quality 95 (pyvips default is 75) Quality change only; the resolution fix is already in #246
#231 / #228 PLIP patch encoder Reimplemented, see below

C-RADIOv2 and CLIP-RN50 from #231 are not included.

PLIP

Changes from #231, to match the other encoders:

  • The default output is the pooled vision embedding before the contrastive projection (768-dim). This is the same convention as CONCH v1 (with_proj=False). with_proj=True returns the projected embedding (512-dim).
  • normalize is handled by the encoder itself.
  • Normalization constants come from get_constants('openai_clip') instead of being hard-coded.
  • Only the vision tower is loaded.
  • The docs use --patch_size 224, PLIP's native input size. PLIP declares no license on Hugging Face or GitHub, so the License column shows "—".

Other alignment

  • Encoder count updated to 34 in the README and the skill reference. PLIP added to docs/index.rst.
  • iSyntax added to the reader lists in docs/faq.rst and the Claude skill files. Add native Philips iSyntax WSI reader #241 did not cover these.

Verification

  • PLIP against the Hugging Face CLIPProcessor and CLIPModel on real weights: preprocessing, default output and with_proj output all match exactly (max diff 0.0). Local-folder loading gives the same output. Integration test passes.
  • Thumbnails on a real 16000×12000 single-level TIFF: same size as OpenSlide's, mean pixel difference 0.04/255, 0.71 s instead of 3.24 s.
  • iSyntax: new tests/test_isyntax_reader.py uses a fake backend, so it runs in CI. It covers extension detection, MPP and magnification, level-0 to level coordinates, RGBA to RGB, thumbnail aspect ratio, pickling and release. Not tested on real .isyntax slides here (the Add native Philips iSyntax WSI reader #241 author tested three).
  • Full unit suite: 106 passed, 71 integration tests skipped. Sphinx docs build without errors.

Note

#245 (METTLE 1.5) also bumps the encoder count to 34. Whichever of the two merges second needs 35.

Closes #149
Closes #152

🤖 Generated with Claude Code

RonitBStudent and others added 7 commits November 18, 2026 09:34
PER-540

Add an optional pyisyntax backend and register native .isyntax slides for automatic discovery, explicit reader selection, and the CLI. Use pyisyntax >=0.1.7 for correct WSI MPP metadata, convert level-0 locations to backend pyramid coordinates, and preserve thumbnail aspect ratio.
PER-540

Keep the existing converter extension set when adding native iSyntax discovery, preserving CZI, BIF, and SVSLIDE defaults.
torch.autocast needs a device type; derive it with torch.device(device).type
instead of device.split(':'), which fails for torch.device objects.

Co-authored-by: GabrielCabas <38341255+GabrielCabas@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pyvips defaults to Q=75, which adds visible compression artifacts to
converted slides.

Co-authored-by: titionex <136621123+titionex@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Loads only the vision tower of vinid/plip. As for CONCH v1, the default output
is the pooled embedding before the contrastive projection (768-dim);
with_proj=True returns the projected embedding (512-dim). Preprocessing and
both outputs match the Hugging Face CLIPProcessor and CLIPModel exactly.

Based on #228 and #231.

Co-authored-by: dibalokechanda <135063772+dibalokechanda@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tests replace pyisyntax with a fake backend, so they run in CI: extension
detection, metadata, level-0 to level coordinate conversion, thumbnails,
pickling and release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Can you add Plip Foundation Model ? [Feature] Performance Issue: Slow thumbnail generation for single-layer TIFF files in OpenSlideWSI

3 participants