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

Check compression method used in the image (#17) #19

Merged
merged 1 commit into from
May 5, 2021

Conversation

gigony
Copy link
Contributor

@gigony gigony commented Apr 22, 2021

SVS format is not supported for now but we loosen the restriction by
delegating its process to libtiff's TIFFRGBAImageGet() method.
cuCIM assumes that only one image with Subfile Type(=0) is available in
the image file but apparently, some SVS files have also only one Subfile
Type with zero so bypassing the check.

This patch explicitly checks SVS format and compression methods and
raises an exception if the given file doesn't match the criteria.
Once SVS format is supported, those changes need to be updated to not
raise exceptions for SVS files.

Resolves: #17

SVS format is not supported for now but we loosen the restriction by
delegating its process to libtiff's TIFFRGBAImageGet() method.
cuCIM assumes that only one image with Subfile Type(=0) is available in
the image file but apparently, some SVS files have also only one Subfile
Type with zero so bypassing the check.

This patch explicitly checks SVS format and compression methods and
raises an exception if the given file doesn't match the criteria.
Once SVS format is supported, those changes need to be updated to not
raise exceptions for SVS files.
@gigony gigony requested a review from quasiben April 22, 2021 19:15
@gigony gigony requested a review from a team as a code owner April 22, 2021 19:15
@gigony gigony added bug Something isn't working breaking Introduces a breaking change labels Apr 22, 2021
@gigony gigony requested a review from jakirkham April 23, 2021 01:09
@quasiben
Copy link
Member

@gigony can this wait until Monday to get merged ? If not, we can ask ops to merge for us while John is out on PTO

@gigony
Copy link
Contributor Author

gigony commented Apr 23, 2021

@gigony can this wait until Monday to get merged ? If not, we can ask ops to merge for us while John is out on PTO

Sure, it is absolutely okay to be merged later. Thank you!

@jakirkham
Copy link
Member

rerun tests

@jakirkham
Copy link
Member

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 78ca078 into rapidsai:branch-0.20 May 5, 2021
rapids-bot bot pushed a commit that referenced this pull request Sep 30, 2021
Due to #17 ([BUG] Compression scheme 33003 tile decoding is not implemented), #19 (Check compression method used in the image) was merged so cuCIM has been handling only particular formats (only jpeg/deflate-compressed image).

If the input TIFF image has no-compressed RAW tile image, cuCIM showed the following error message:

> RuntimeError: This format (compression: 1, sample_per_pixel: 1, planar_config: 1, photometric: 1) is not supported yet!. https://github.com/Project-MONAI/MONAI/pull/2987/checks?check_run_id=3667530814#step:7:15641

This patch is to support raw RGB tiled TIFF with fast-path, re-allowing non-compressed image with slow-path (in case the input is not tiled RGB image).

This supports Project-MONAI/MONAI#2987.

Authors:
  - Gigon Bae (https://github.com/gigony)

Approvers:
  - Gregory R. Lee (https://github.com/grlee77)
  - https://github.com/jakirkham

URL: #108
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Introduces a breaking change bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Compression scheme 33003 tile decoding is not implemented.
3 participants