PantelisGeorgiadis / dcmjs-dimse

DICOM DIMSE implementation for Node.js using the dcmjs library
MIT License
68 stars 13 forks source link

LUTData (0028,3006) element in dataset breaks sending C-Store request #47

Closed andreidubov closed 1 year ago

andreidubov commented 1 year ago

Hello,

Recently, I got the error like First argument to DataView constructor must be an ArrayBuffer when receiving or sending a C-Store request in dcmjs-dimse. After investigating, I found out that in the received dataset there is a LUTData (0028,3006) element, which lead to this error. The main problem locates in dcmjs (PR https://github.com/dcmjs-org/dcmjs/pull/343). But there is a workaround for this issue: we can override NameMap (Additional DICOM tags to recognise when denaturalizing the dataset) when calling DicomMetaDictionary.denaturalizeDataset().

dcmjs-dimse has the ability to pass nameMap to the Dataset.toFile() function and it works good. But the issue is still present when sending a C-Store request in Network._sendPDataTF() -> Dataset.getDenaturalizedDataset() function.

It would be nice to be able to configure a nameMap in Dataset.getDenaturalizedDataset() and also add it to Client.send() fe. to opts (pass to Network._sendPDataTF).

PantelisGeorgiadis commented 1 year ago

Hello @andreidubov! Thank you for reporting this! I have create a PR (https://github.com/PantelisGeorgiadis/dcmjs-dimse/pull/48) that updated the Network, Client and Server classes to pass dataset read, write and nameMap options. Please review, test and let me know so I can merge it.

andreidubov commented 1 year ago

Thank you very much, I tested it on my side and it works.