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

dicom.Write: The Pixel data only supports OW type #299

Closed
ChaoStraxcorp opened this issue Jan 30, 2024 · 2 comments
Closed

dicom.Write: The Pixel data only supports OW type #299

ChaoStraxcorp opened this issue Jan 30, 2024 · 2 comments

Comments

@ChaoStraxcorp
Copy link

When I try to write a Dicom dataset to a file, I encountered the following error:

ERROR dicomio.veryifyElement: VR mismatch for tag (7fe0,0010)[PixelData]. Element.VR=OB, but DICOM standard defines VR to be OW

However, the pixel data should support both OW and OB types:
https://dicom.nema.org/medical/dicom/current/output/chtml/part05/chapter_8.html

In pkg/tag/tag_definitions.go, the PixelData can only be OW.

@suyashkumar suyashkumar changed the title The Pixel data only supports OW type dicom.Write: The Pixel data only supports OW type Feb 4, 2024
@suyashkumar
Copy link
Owner

Thanks for logging this. I think as part of the updates we'd like to make to the tag definitions (e.g. a follow on to #169) we will allow support for tags that can have multiple VRs. Definitely an important feature, and we'll take a look at this in the next few months!

suyashkumar pushed a commit that referenced this issue May 29, 2024
This PR is resolving #147.

It updates the generate_tag_definitions.py script to read the DICOM standard JSON dump from the Innolitics repo. They provide a few extra fields, so we introduce them in Tag definition, namely, Keyword and Retired. Keyword represents what Name used to represent, see comments on the field definitions for details.

Innolitics also captures all possible VRs for tags that allow multiple VR values, so I updated the writer verification code to consider that. That ended up resolving #299 as well.

This is a breaking change because some tag variables have been deleted or renamed. In particular, the command tags (group 0000) have been all deleted since Innolitics doesn't provide them. I thought that was okay because these are only related to DIMSE and should never be present in a DICOM file. I can put them back somehow if you think we should keep them, but maybe we could sort that out if we ever work on #181. But mostly, tags were added or unchanged.

I ended up writing this from scratch and not branching from #169 because I thought that was a little bit too complicated for this. But we could reconsider that design if there are requests for supporting private data dictionaries.

Misc: fixes some warnings (i.e. removed deprecated ioutil, etc.), added a helper Uint32 method.
@suyashkumar
Copy link
Owner

Closed by #316

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

No branches or pull requests

2 participants