Appropriate Compression For DICOM Files
As disk space usage has always been a priority when designing/implementing DICOM applications, “What is the best practice for writing DICOM files?” is becoming a very common question asked by our developers.
A sensible idea is to write uncompressed images in lossless-compressed format in order to reduce disk usage, and leave compressed images “as is”.
So check against the “original” transfer syntax of the image (either read from disk or received over network), if it’s one of those uncompressed formats then lossless compress it when you write on disk.
DICOM Transfer Syntax Negotiation
Transfer Syntax Negotiation in DICOM is relatively simple, but often misunderstood. It is important to understand this fully before attempting to take control using DicomObjects.
The transfer syntaxes available for network transmission depend on what is agreed between the applications during initial negotiation (and at no other time. The steps are as follows:
The SCU sends the SCP a list of “presentation contexts”, each of which has a SOP class and one or more transfer syntaxes.
Limiting Transfer Syntax for RT SOP Classes
There is a known issue in the Dicom Standard. SOP classes related to RT can legitimately be written / transferred using several different Transfer Syntaxes. HOWEVER The length of some of the attributes associated to RT is such that they can not be represented within a 32 bit word. As such it is imposable to represent them using an explicit Transfer Syntax.
Network Transfer Syntax Control (COM)
The mechanism is quite different for the simple Send methods compared to using DicomConnection
DicomImage.Send / DicomDataSet.Send For these simple method, the list of offered transfer syntaxes comes from the registry, from the default value of the following key
HKEY_LOCAL_MACHINE/Software/Medical Connections/DicomObjects/TransferSyntax NOTE: The above is a Key not a value. You need to edit the list of transfer syntaxes into the default value of that key.
or to change dynamically, it can be controlled by
Network Transfer Syntax Control (NET)
Background in earlier versions of DicomObjects, both .NET & COM the same basic mechanism was used for selecting transfer syntaxes:
When initiating, they can be created specifically using Contexts.Add etc. When accepting, they can be selected specifically using Context.AcceptedTS or Reject If neither of the above is used (as most people don’t) then a default mechansim is used, based on the TransferSyntax registry hive, which allows: Setting of specific values for different SOP classes using TransferSyntax/SOP class UID A more generic setting for all other SOP classes in the TransferSyntax/ default value This system, which is described here worked well for many years, but has 3 main drawbacks: