-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Description
Hola =)
We are seeing DICOM date tags in the wild that have control characters in some of their date VR tags. See attached DICOM file in the zip
corrupt_dates.zip
When feeding the unziped DICOM file to @itk-wasm/image-io::readImage
:
https://insightsoftwareconsortium.github.io/ITK-Wasm/image-io/ts/app/?functionName=readImage
Uncaught (in promise) SyntaxError: Bad control character in string literal in JSON at position 1786 (line 109 column 16) (at index-DK1H_2do.js:3638:594)
at JSON.parse (<anonymous>)
at eA (itk-wasm-pipeline.worker-p9mTvdp2.js:10:54442)
at itk-wasm-pipeline.worker-p9mTvdp2.js:10:59402
What do you think we should do? Ideas:
- update this line https://github.com/InsightSoftwareConsortium/ITK-Wasm/blob/main/packages/image-io/itkWasmImageIOBase.cxx#L92 to use glaze's
escape_control_characters = true
. Might need to udpate glaze version and therefor comple with c++23 - Do manual character escaping in the C++ code
- Do manual character escaping in the Typescript (and Python)
- Nothing and tell people to clean their files
Metadata
Metadata
Assignees
Labels
No labels