Bug #769
closed
dcm2json produces invalid JSON for broken DS or IS values
Added by Michael Onken about 8 years ago.
Updated about 5 years ago.
Category:
Library and Apps
Description
dcm2json produces invalid JSON if encountering invalid DS or IS values. The issue showed up in a dataset where a DS-value (RescaleIntercept) contained the value "US". This results in the output "vr":"DS","Value":[US]. Obviously, US is not a valid JSON Number, i.e. the resulting JSON output will be rejected by all(?) JSON parsers.
dcm2json is not responsible for invalid values in the output. However, whenever easily possible, the resulting JSON output should always have a valid syntax.
I'd propose to have a check in IS and DS writeJSON() routines which stop with an error if such an invalid value is encountered.
- Target version changed from 3.6.2 to 3.6.3
- Target version changed from 3.6.3 to 3.6.4
- Target version changed from 3.6.4 to 3.6.6
See also proposed CP "cp_ns05 change JSON value type mapping IS and DS.docx" in the private WG-06 folder.
- Assignee deleted (
Anonymous)
The above-mentioned CP now has a number: CP-1861 (Consistency between DICOM VR definition of DS & IS, and JSON Value Representation)
- Related to Conformance #881: Check our implementation of dcm2json against DICOM Supplement 183 added
- Target version deleted (
3.6.6)
- Target version set to 3.6.6
- Status changed from New to Closed
- Assignee set to Marco Eichelberg
- % Done changed from 0 to 100
The implementation in DCMTK now uses the encoding introduced with DICOM CP 1861 for these cases: if any value of an IS or DS element is illegal, then all values of that element are printed as Json strings and not as numbers.
Closed by commit #10713dba6.
Also available in: Atom
PDF