Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for reading compressed NDPI tiles #4181

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

melissalinkert
Copy link
Member

This expands on the "precompressed" features added in #3992.

The main goal was to just add compressed tile reading to the NDPI reader, so that conversion from NDPI to DICOM wouldn't require much if any recompression. This required a variety of changes not limited to NDPI though:

  • update JPEGTurboService so that the repackaged compressed tiles can be retrieved, as well as the tile size and counts
  • move general TIFF tile copying logic out of SVSReader, and into MinimalTiffReader (to prevent duplicate logic in NDPIReader)
    • this should also make it easier to support precompressed tiles in other TIFF-based formats later on
  • update NDPIReader to report optimal sizes based on actual IFD/JPEG stream, instead of constant 1024x1024
  • update DicomWriter to allow different tile sizes in each resolution, since NDPI reports different sizes per resolution
  • update NDPIReader to use the saveCompressedBytes API

The end result is that something like this should now work:

bfconvert -noflat -precompressed -compression JPEG CMU-1.ndpi cmu.dcm

and should complete within a few seconds as all tiles can be copied without any recompression.

I would not expect SVS -> DICOM support to change, but it probably makes sense to double-check just in case the refactoring caused any problems.

I don't expect this to fail tests, but excluding for now so this doesn't distract from 7.3.0. Given the API changes in JPEGTurboService, this probably does require a major version.

cc @dclunie, @fedorov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant