mercure-imaging / mercure

mercure DICOM Orchestrator
https://mercure-imaging.org
MIT License
67 stars 32 forks source link

Specific Character Set bug with fix #42

Closed alipairon closed 1 year ago

alipairon commented 2 years ago

Describe the bug In case of tag Specific Character Set contains double value for example: ISO 2022 IR 100\ISO 2022 IR 144 The getcmdtags will fire an error and won't process the file because of the findAndGetOFString behaviour, only the ISO 2022 IR 100 part is returned.

The fix is to change in main.cpp of getcmdtags line: if ((dcmFile.getDataset()->tagExistsWithValue(TAG)) && (!dcmFile.getDataset()->findAndGetOFString(TAG, VAR).good())) \

to

if ((dcmFile.getDataset()->tagExistsWithValue(TAG)) && (!dcmFile.getDataset()->findAndGetOFStringArray(TAG, VAR).good())) \

alipairon commented 1 year ago

Also about some more charset problems.

ISO 2022 IR 87 charset is only supported in DCMTK built with libiconv support. But by default DCMTK is built with ICU support, so this causes problems too.

tblock79 commented 1 year ago

Addressed with commit d57e00baf5837e6ec47dab2a2d43705ba3b9b97a.

If support for legacy code pages is needed, such as ISO 2022, the user would need to recompile dcmtk and the getdcmtags module with libiconv support (no change of the mercure code is required). However, it is assumed that this affects only a small number of users with legacy equipment. Modern devices should be using UTF-8 encoding.