Enet4 / dicom-rs

Rust implementation of the DICOM standard
https://dicom-rs.github.io
Apache License 2.0
403 stars 75 forks source link

Decode single frame using GDCM #422

Closed dougyau closed 7 months ago

dougyau commented 9 months ago

Extending from the PR #421 when using GDCM to decode images it will load the whole image to memory. This PR implements the logic required to load only one image.

dougyau commented 8 months ago

So far, I have tested this with Compressed (jpeg, jpeg-ls and j2k) and Uncompressed (little endian) data. With RGB, YBR_FULL_422, MONOCHROME1, MONOCRHOME2 and PALETTE_COLOR (at least decompressing) photometric interpretations.

Enet4 commented 8 months ago

Hello @dougyau! Are there any other pending concerns with this PR, so that it can be marked as ready?

dougyau commented 8 months ago

This code is working, what I have to do is cover it with unit testing. I have been short of time, but once I do have some time, I will add the tests.

dougyau commented 7 months ago

I have validated the existing test, and it uses the new code path. Of the test cases I believe we could convert SC_rgb_2frame.dcm to have a planar configuration = 1 to make it complete. How can I add this to the test-files repo?

Enet4 commented 7 months ago

I have validated the existing test, and it uses the new code path. Of the test cases I believe we could convert SC_rgb_2frame.dcm to have a planar configuration = 1 to make it complete. How can I add this to the test-files repo?

I have been slowly working on a new release for the dicom-test-files crate (I am one of the owners at the moment) so that it supports more test files. You can send in a pull request to https://github.com/robyoung/dicom-test-files that adds a custom test file so that I can review it. The steps would be 1) copy the new file to a new data/custom/ folder, 2) run the script generate/generate.py to regenerate the file entries, and push the file plus the modified entries.rs.