Write German Umlauts into MetaData with SimpleITK

Hi Zivy,

I was hoping this was not the case and I was just too stupid to use it correctly :-), but after trying almost every possible permutation of encodings I was more or less expecting it to be that way.

Since there may be other people with the same problem as me, here is my fix:

I read the file as a Bytearray after writing it with SimpleITK and then adjust both wrong Umlaut-Bytes to the correct Byte, which - thankfully - is a pretty minor coding task to do since most DICOMs have a nicely structured data layout and because I only need them to be fixed within three or four different fields.

Don’t forget to adjust the field length afterwards and only partially read the header of the file till the pixeldata begins tho! It works well so far, and the additional runtime is negligible.

Thanks for your help!

1 Like