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

DicomJsonConvertor deserialization fails on invalid dicomElement even when auto validate is set to false #1445

Closed
smithago opened this issue Sep 15, 2022 · 0 comments · Fixed by #1446

Comments

@smithago
Copy link
Contributor

smithago commented Sep 15, 2022

Describe the bug
We have a dcm file with invalid privateCreator data element like below
const string json = @"
{
""00090010"": {
""vr"": ""US"",
""Value"": [
1234,
3333
]
},
""00091001"": {
""vr"": ""CS"",
""Value"": [
""00""
]
}
} ";

Note: the 00090010 is a private creator tag, it needs to be VR: LO and VM:1 https://dicom.nema.org/dicom/2013/output/chtml/part05/sect_7.8.html

This bad data fails to deserialize with below exception even when autovalidate is set to false for the serializer.

DICOM element (xxxx,0010) must contain a single value, but contains 4

To Reproduce
const string json = @"
{
""00090010"": {
""vr"": ""US"",
""Value"": [
1234,
3333
]
},
""00091001"": {
""vr"": ""CS"",
""Value"": [
""00""
]
}
} ";

        // make sure below serialization does not throw
        DicomDataset ds = DicomJson.ConvertJsonToDicom(json, autoValidate: false);

Expected behavior
Conversion to succeed to the best effort.

Screenshots or test DICOM files
Included above

Environment
Fellow Oak DICOM version: 5.0.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants