Project

General

Profile

Actions

Bug #1153

closed

XML and LUT export do not use locale-independent output routines

Added by Marco Eichelberg 7 months ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Category:
Library
Target version:
Start date:
2025-02-18
Due date:
% Done:

0%

Estimated time:
4:00 h
Module:
dcmdata, dcmimgle, dcmsr
Operating System:
Compiler:

Description

The output routines that convert DICOM datasets or structured reports to XML use the std::iostream functions to print certain floating point numbers (e.g. attribute values of OF and OD attributes, values of NUM content items in SR). These are not locale independent. Should an application change the process-global locale with std::locale::global(), then in certain locales such as German a comma instead of a point will be printed as decimal separator. Furthermore, iostream prints NaN values with sign bit as "-nan", which is not expected or supported by the conversion routines that convert XML back to DICOM. In these places, OFStandard::atof() OFStandard::ftoa() should be used, which is locale independent and prints NaN values without sign.
Also affected are routines that print certain lookup tables into a text file. In detail, the following methods need to be fixed:

  • DSRNumericMeasurementValue::writeXML()
  • DcmOtherFloat::writeXML()
  • DcmOtherDouble::writeXML()
  • DiCIELABLUT::createLUT()
  • DiGSDFLUT::createLUT()

Reported 2025-02-17 by Mathieu Malaterre <>.

Actions

Also available in: Atom PDF