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 #1

Updated by Jan Schlamelcher about 8 years ago

  • Target version changed from 3.6.2 to 3.6.3
Actions #2

Updated by Jan Schlamelcher over 7 years ago

  • Target version changed from 3.6.3 to 3.6.4
Actions #3

Updated by Jörg Riesmeier over 7 years ago

  • Target version changed from 3.6.4 to 3.6.6
Actions #4

Updated by Jörg Riesmeier almost 7 years ago

See also proposed CP "cp_ns05 change JSON value type mapping IS and DS.docx" in the private WG-06 folder.

Actions #5

Updated by Marco Eichelberg almost 7 years ago

  • Assignee deleted (Anonymous)
Actions #6

Updated by Jörg Riesmeier almost 7 years ago

The above-mentioned CP now has a number: CP-1861 (Consistency between DICOM VR definition of DS & IS, and JSON Value Representation)

Actions #9

Updated by Jörg Riesmeier over 5 years ago

  • Related to Conformance #881: Check our implementation of dcm2json against DICOM Supplement 183 added
Actions #10

Updated by Michael Onken over 5 years ago

  • Target version deleted (3.6.6)
Actions #11

Updated by Michael Onken over 5 years ago

  • Target version set to 3.6.6
Actions #12

Updated by Marco Eichelberg about 5 years ago

  • 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.

Actions

Also available in: Atom PDF