Repository navigation
Support raw RGB tiled TIFF - #108
Conversation
grlee77
left a comment
There was a problem hiding this comment.
This looks good, but is there a simple test we can add to ensure it is working as expected? Maybe read a simple raw TIFF generated in PIL via Python?
Thanks @grlee77 for the review! |
537c76e to
3049233
Compare
jakirkham
left a comment
There was a problem hiding this comment.
Thanks Gigon! 😄
Had a couple questions above
| unsigned char* raw_buf, | ||
| uint64_t offset, | ||
| uint64_t size, | ||
| uint8_t** dest, |
There was a problem hiding this comment.
Why does this need to be ** as opposed to *?
There was a problem hiding this comment.
For the same reason that cudaMalloc accept '**' (https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g37d37965bfb4803b6d4e59ff26856356) -- decoders may need to allocate memory and setting the address to dest if needed.
See
There was a problem hiding this comment.
Was mostly thinking about this in terms of the nullptr checks below. We may want to look into using references for this kind of thing in the future, but not urgent. Can be addressed later
| case COMPRESSION_NONE: | ||
| case COMPRESSION_JPEG: | ||
| case COMPRESSION_ADOBE_DEFLATE: | ||
| case COMPRESSION_DEFLATE: | ||
| return true; | ||
| default: | ||
| return false; |
There was a problem hiding this comment.
Might be worth indenting these to make this a bit more readable
There was a problem hiding this comment.
Thanks! Will do.
It turns out that the style is auto-formatted by the current clang-formatter setting (.clang-format) so this is the right style as long as we update clang-format configuration.
There was a problem hiding this comment.
Ah ok. Maybe we can track C++ formatting cleanup as an issue
There was a problem hiding this comment.
Yeah, will create an issue for that.
gigony
left a comment
There was a problem hiding this comment.
Thanks @jakirkham for the review! Will update it soon.
| unsigned char* raw_buf, | ||
| uint64_t offset, | ||
| uint64_t size, | ||
| uint8_t** dest, |
There was a problem hiding this comment.
For the same reason that cudaMalloc accept '**' (https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g37d37965bfb4803b6d4e59ff26856356) -- decoders may need to allocate memory and setting the address to dest if needed.
See
| case COMPRESSION_NONE: | ||
| case COMPRESSION_JPEG: | ||
| case COMPRESSION_ADOBE_DEFLATE: | ||
| case COMPRESSION_DEFLATE: | ||
| return true; | ||
| default: | ||
| return false; |
There was a problem hiding this comment.
Thanks! Will do.
It turns out that the style is auto-formatted by the current clang-formatter setting (.clang-format) so this is the right style as long as we update clang-format configuration.
|
rerun tests (looks like one of the jobs failed due to some sort of Jenkins issue) |
7e81eb4 to
b9df835
Compare
|
@gpucibot merge |
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:
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.