PantelisGeorgiadis / dcmjs-dimse

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

How to set character encoding? #44

Closed suoc closed 1 year ago

suoc commented 1 year ago

Test with these files http://23.94.212.216/download/dicoms/dx-1.dcm http://23.94.212.216/download/dicoms/dx-2.dcm

PantelisGeorgiadis commented 1 year ago

Hello @suoc! I noticed that in both your DICOM files, the Specific Character Set tag is empty and, thus, the default repertoire is assumed (ISO IR-6). Once you load the files into a Dataset object, you can insert/update the tag value using the setElement(‘SpecificCharacterSet’, ‘YOUR_CHARACTER_SET’) function. However, strongly I suggest you to properly patch your datasets with the desired Specific Character Set, before you load them into a Dataset.

suoc commented 1 year ago

Is there a way to reload the elements tags value when I update the character encoding?

suoc commented 1 year ago

And when I receive the dataset, it has been assigned the default character encoding, and it is impossible to judge whether it is an empty tag.

PantelisGeorgiadis commented 1 year ago

Hello @suoc! Unfortunately, I don’t think that dcmjs supports updating the element values when the character set encoding is updated. Since dcmjs-dimse is based on dcmjs, it doesn’t do it either. It would be a nice feature to add to the dcmjs though. If you feel that you can implement it, I suggest you to go for it!

suoc commented 1 year ago

Ok thanks a lot, I'll try it out.

PantelisGeorgiadis commented 1 year ago

Great! That would be an awesome addition to dcmjs! Closing the issue now. If you feel that we can do more on that, please reopen or create a new issue.