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

Error: Encountered odd length #65

Closed
wkoszek opened this issue Apr 21, 2020 · 4 comments · Fixed by #79
Closed

Error: Encountered odd length #65

wkoszek opened this issue Apr 21, 2020 · 4 comments · Fixed by #79

Comments

@wkoszek
Copy link
Contributor

wkoszek commented Apr 21, 2020

Another issue when scanning many DICOMs:

Encountered odd length (vl=13945) when reading explicit VR SQ for tag (6003,1010)[private] (file offset 1752)
Encountered odd length (vl=27975) when reading explicit VR SQ for tag (6003,1010)[private] (file offset 1752)
Encountered odd length (vl=286383071) when reading implicit VR 'UN' for tag (1111,11e3)[private] (file offset 5382)
Encountered odd length (vl=419395) when reading explicit VR OW for tag (6000,3000)[??] (file offset 13496)
@wkoszek wkoszek changed the title Encountered odd length Error: Encountered odd length Apr 21, 2020
@suyashkumar
Copy link
Owner

suyashkumar commented Apr 26, 2020

Thanks for raising this! I will need to check further into the DICOM spec to see when we have odd value lengths, and why/when we expect them to be even (in the code, there seems to be an explicit check to see if it's even).

@wkoszek
Copy link
Contributor Author

wkoszek commented May 6, 2020

@suyashkumar Just wanted to make an intro here to Brian Hardell here, aka @IChocked at Github.

Brian will intern with us this support, and one of his tasks is stress-testing our data ingest pipeline at Segmed. I've mentioned getting some data samples for all the recent reported issues is high on our list, so you might be seeing some DICOMs from us.

@IChocked
Copy link
Contributor

I encountered this issue in some public data and wanted to share a few examples files.

examples.zip

Data Citation:
Kinahan, Paul; Muzi, Mark; Bialecki, Brian; Coombs, Laura. (2017). Data from ACRIN-FLT-Breast. The Cancer Imaging Archive. http://doi.org/10.7937/K9/TCIA.2017.ol20zmxg

@suyashkumar
Copy link
Owner

suyashkumar commented Jun 8, 2020

Thank you for the sample images! Very helpful.
These images all also seem to parse correctly with no errors with my quick fix in PR #79--there is a possible issue with the embedded icon image parsing though I want to look into (or maybe, a lot of the icons in some of these images are just empty, but will confirm after looking a bit deeper).

suyashkumar added a commit that referenced this issue Jun 8, 2020
…ICOM (#79)

This fixes #77 and appears to work on provided DICOMs. This is a relatively quick fix, that does seem to get the job done. There are some minor improvements that can be made in future PRs, but it will be best to get these changes in to unblock future work.

This also appears to fix #82, and fix #65 (we are able to parse those images without errors).

For most of the provided images, the issue was that an icon image sequence could appear in the DICOMs in addition to the primary PixelData. When reading that particular image sequence, a different set of metadata tags need to be used (instead of the global ones, which apply only to the core PixelData).

There may be additional work to fully and correctly parsing icon image sets (most of the icons seem to be unpopulated in the sample images), but this change will at least prevent the parser from failing on DICOMs like this.
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 a pull request may close this issue.

3 participants