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 dicom.ReadElement: Undefined length disallowed #82

Closed
IChocked opened this issue May 29, 2020 · 2 comments · Fixed by #79
Closed

ERROR dicom.ReadElement: Undefined length disallowed #82

IChocked opened this issue May 29, 2020 · 2 comments · Fixed by #79

Comments

@IChocked
Copy link
Contributor

This error occurs here in parser.go in the ParseNext() function. Something odd that I don't completely understand is that the tags reported in the error, at least for the two example errors below, don't exist in the file (they aren't printed out with dcmdump).

Example errors:

  • ERROR dicom.ReadElement: Undefined length disallowed for VR=\u0000\u0000, tag (0000,0000)[CommandGroupLength] (file offset 61170)
  • ERROR dicom.ReadElement: Undefined length disallowed for VR=\u0007\u0000, tag (ffdc,ffc4)[??] (file offset 61006)

Sample files
issue82.zip

@suyashkumar
Copy link
Owner

I think these are happening due to the same issue in #77. I think this because my quick fix branch seems to parse these files with no issues. (PR #79, branch s/native-pixeldata-fix)

@suyashkumar
Copy link
Owner

feel free to use a build from that branch for evaluating issues. I need to check on some weird behavior I saw with that PR before merging and clean things up, but overall it should unblock you all if you are blocked on it!

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.

2 participants