pynetdicom icon indicating copy to clipboard operation
pynetdicom copied to clipboard

Support automatic conversion of Endianness

Open Spenhouet opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe.

By my understanding I have DICOM files which are in Big Endian format but the SCP I want to send to using pynetdicom only accepts a Little Endian transfer syntax.

I'm not really sure what to do now since pynetdicom does not seem to support an automatic conversion of the Endianness. At least it does not work and the docs state:

Uncompressed and deflated transfer syntaxes are the exception to this rule as pydicom is able to freely convert between these (provided the endianness remains the same).

Describe the solution you'd like

It would be good if pynetdicom could convert the Endianness out-of-the-box. This would make applications more flexible in what they can talk to as SCU and what they can accept as SCP.

Describe alternatives you've considered

I did want to "just" implement this conversion myself but did not immediately find clear solution (this problem is currently too far off from my current task that the (probably) necessary time investment to understand this is most likely not justified). But maybe someone has a good source?

I did find this blog post. But this only proposes to manually convert the respective files via the Gdcmconv tool. Definitely also something I can do in my specific situation but not really a permanent solution. Also dcmconv from DCMTK works to convert the files. It seems that dcmsend (the SCU option of DCMTK) is able to handle the Endianness conversion (probably through dcmconv).

Spenhouet avatar Aug 18 '22 06:08 Spenhouet

For any future reader looking for a work around: For me the easiest workaround was to rewrite all Dicom files via dcmodify from DCMTK as Explicit VR Little Endian TS (option: +te / --write-xfer-little): dcmodify +te -nb ./**/*.dcm

The feature request is independent of me having resolved my specific issue imo.

Spenhouet avatar Aug 18 '22 07:08 Spenhouet

Woof, no. At a minimum this needs to be added upstream to pydicom before I'd even consider it.

scaramallion avatar Nov 06 '23 22:11 scaramallion