Skip to content

feat(wsi): accept Ventana BIF and Hamamatsu NDPI slides - #789

Closed
blanca-pablos wants to merge 3 commits into
mainfrom
feat/wsi-bif-ndpi
Closed

blanca-pablos wants to merge 3 commits into
mainfrom
feat/wsi-bif-ndpi

Conversation

@blanca-pablos

@blanca-pablos blanca-pablos commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

HETA's normalization is adding BIF and NDPI support (aignostics/he-tme#482), but the SDK rejects those files before upload. This PR adds .bif and .ndpi to the supported extensions.

The SDK offers them only for HETA 2.2.0 and later (its release candidates included), based on the version the run targets. Older HETA versions keep the old set, because they would fail the run during processing instead of at submission.

The files go up as application/octet-stream, like .svs, which HETA accepts. CZI is left out because the bundled OpenSlide cannot decode JPEG XR CZIs. Without that, the SDK cannot read their metadata.

🤖 Generated with Claude Code

Add .bif and .ndpi to WSI_SUPPORTED_FILE_EXTENSIONS so HETA run
preparation reads their metadata with OpenSlide and uploads them as
application/octet-stream, like .svs. CZI stays out: the bundled
OpenSlide cannot decode JPEG XR compressed CZI files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ox-security

ox-security Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

OX Security Logo

OX Security reviewed this pull request — nothing to fix.

✔ No issues found

Branch feat/wsi-bif-ndpi → main

View scan in OX Security →

@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ics/application/_gui/_page_application_describe.py 87.50% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/aignostics/application/_service.py 56.12% <100.00%> (ø)
src/aignostics/application/_utils.py 87.86% <100.00%> (+0.17%) ⬆️
src/aignostics/constants.py 92.30% <100.00%> (+0.64%) ⬆️
...ics/application/_gui/_page_application_describe.py 15.02% <87.50%> (+0.96%) ⬆️

... and 4 files with indirect coverage changes

@blanca-pablos
blanca-pablos marked this pull request as ready for review November 20, 2026 15:49
@blanca-pablos
blanca-pablos requested a review from a team as a code owner November 20, 2026 15:49
Copilot AI balanced review requested due to automatic review settings November 20, 2026 15:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The inaccessible backend PR leaves required HETA BIF/NDPI deployment compatibility unverified, and a maintainer must also confirm the expansion is eligible under the SDK’s maintenance-only scope.

No open issues 🎉

What changed in this PR

This PR extends the SDK’s whole-slide image allowlist to accept Ventana BIF and Hamamatsu NDPI files, aligning SDK validation and QuPath imports with planned HETA support. Release remains dependent on deployment of the compatible HETA version.

Changes:

  • Add .bif and .ndpi to the SDK and QuPath supported extensions.
  • Add regression tests for case-insensitive extension acceptance, continued CZI rejection, and HETA’s extension set.
  • Update documentation and specifications to reflect the additional formats.
File Description
tests/​aignostics/​wsi/​service_test.py Tests BIF/NDPI extension acceptance and CZI rejection.
tests/​aignostics/​application/​utils_test.py Asserts HETA’s complete supported extension set.
src/​aignostics/​wsi/​CLAUDE.md Updates the documented WSI allowlist.
src/​aignostics/​qupath/​scripts/​add.groovy Allows BIF and NDPI in QuPath imports.
src/​aignostics/​constants.py Adds BIF and NDPI to the shared allowlist.
src/​aignostics/​CLAUDE.md Lists the additional OpenSlide formats.
specifications/​SPEC-QUPATH-SERVICE.md Expands documented QuPath input formats.
specifications/​SPEC-APPLICATION-SERVICE.md Updates application format support.
specifications/​SPEC_WSI_SERVICE.md Documents BIF/NDPI support and handler capabilities.
README.md Adds BIF and NDPI to the platform format overview.
docs/​partials/​README_platform.md Keeps the platform documentation partial aligned.
CLAUDE.md Adds BIF to the OpenSlide guidance.

Review effort: Balanced

Older HETA versions do not reject BIF or NDPI at submission; the run
fails while processing, and 2.1.1 would even try to process a BIF.
Metadata generation now uses the resolved application version, so HETA
before 2.2.0 keeps the .dcm/.tiff/.tif/.svs set. The submit page lists
the formats of the selected version. Local WSI tooling keeps the full set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 20, 2026 16:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

An optional application ID breaks the configured MyPy check, prepared metadata can bypass format-version compatibility checks, and successful BIF/NDPI metadata extraction lacks test coverage.

1 open issue
2 previously missed issues

In code that hasn't changed since last review

Medium severity Validate prepared rows against the target version before upload and submit

src/​aignostics/​application/​_service.py:373

The version gate only runs during metadata generation. A CSV prepared for HETA 2.2.0 can still be uploaded and submitted with --application-version 2.1.1, allowing BIF/NDPI slides to reach an unsupported processing version. Validate prepared rows against the resolved target version in both application_run_upload and application_run_submit_from_metadata before uploading or submitting them.

Medium severity Add valid BIF and NDPI metadata extraction integration tests

tests/​aignostics/​wsi/​service_test.py:494

These cases verify extension acceptance using invalid files, but do not verify successful BIF or NDPI metadata extraction. Decoder or metadata incompatibilities could therefore go undetected for the newly supported formats. Add integration cases with valid representative slides and assert the dimensions and resolution required for submission.

Review effort: Balanced

Comment on lines +190 to +191
if application_version and application_id in {HETA_APPLICATION_ID, TEST_APP_APPLICATION_ID}:
extensions = get_supported_extensions_for_application(application_id, application_version)
…s too

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 20, 2026 16:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Reusing prepared CSV metadata bypasses version compatibility checks during upload and submission, allowing unsupported BIF/NDPI files to reach older application versions and fail during processing.

1 open issue
1 previously missed issue

In code that hasn't changed since last review

Medium severity Enforce version compatibility for uploads and submissions

src/​aignostics/​application/​_service.py:373

The version restriction is only applied while scanning a directory. A CSV prepared for HETA 2.2.0 can still be passed to run upload and run submit --application-version 2.1.1: application_run_upload and application_run_submit_from_metadata never check the supported extensions, so BIF/NDPI files are uploaded and submitted as application/octet-stream to the older version. Please also enforce compatibility against the actual upload/submission target, so reusing prepared metadata cannot bypass the restriction and cause a processing-time failure.

Review effort: Balanced

@sonarqubecloud

Copy link
Copy Markdown

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.

2 participants