Page MenuHomePhabricator

mitkDicomSeriesReader.txx does not ensure C correct number parsing
Closed, ResolvedPublic

Description

mitk::DicomSeriesReader uses ITK DICOM readers (GDCM or DICOMImageIO) to read DICOM images. In T2473 we found out that at least the GDCM reader is related to number parsing errors which are locale dependent.

mitk::DicomSeriesReader does currently not ensure that a working locale ("C") is used while reading files.

The solution implemented for T2473 should be moved from DataTreeNodeFactory to DicomSeriesReader to ensure correct parsing even for users who use the reader directly.

Event Timeline

A patch containing the changes.

Similar locale changing code will remain in DataTreeNodeFactory because there is a call to some file sorting function from GDCM. I'm not exactly sure if this function might also cause problems with non-C locales, so defaulting to "C" prevents unexpected changes from the current behavior.

Patch looks fine to me ( would be easier to read if created with diff -b ... )

Thanks. I just used "svn diff", will try that option.

[SVN revision 26327]
FIX (#5503): ensure C locale during DICOM reading to prevent number parsing errors