Project

General

Profile

Actions

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.

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

100%

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.


Related issues 1 (0 open1 closed)

Related to DCMTK - Conformance #881: Check our implementation of dcm2json against DICOM Supplement 183ClosedMarco Eichelberg2019-04-26

Actions
Actions

Also available in: Atom PDF