Project

General

Profile

Bug #769

dcm2json produces invalid JSON for broken DS or IS values

Added by Michael Onken 6 months ago. Updated 5 months ago.

Status:
New
Priority:
Normal
Category:
Library and Apps
Target version:
Start date:
2017-06-27
Due date:
% Done:

0%

Estimated time:
2.00 h
Module:
dcmdata
Operating System:
Compiler:

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.

History

#1 Updated by Jan Schlamelcher 5 months ago

  • Target version changed from 3.6.2 to 3.6.3

Also available in: Atom PDF