Bug #769

dcm2json produces invalid JSON for broken DS or IS values

Added by Michael Onken 4 months ago. Updated 3 months ago.

Status:New Start date:2017-06-27
Priority:Normal Due date:
Assignee:Sebastian Grallert % Done:


Category:Library and Apps
Target version:3.6.3 Estimated time:2.00 hours
Module:dcmdata Compiler:
Operating System:


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.


#1 Updated by Jan Schlamelcher 3 months ago

  • Target version changed from 3.6.2 to 3.6.3

Also available in: Atom PDF