// blog
Why a DICOM File Won't Open: Transfer Syntaxes Explained
A DICOM file’s transfer syntax says how its data and pixels are encoded: byte order, whether each element names its value type, and whether the image is compressed (RLE, JPEG, JPEG lossless, JPEG-LS, JPEG 2000). A viewer that can’t decode a file’s compression shows nothing, or only the tags. You can find the transfer syntax in element (0002,0010) and convert the file to an uncompressed one with the free OFFIS DICOM Toolkit: dcmdjpeg for JPEG, dcmdjpls for JPEG-LS.
Two DICOM files can hold exactly the same image and still behave differently: one opens everywhere, the other shows a blank screen. The difference is usually the transfer syntax.
What a transfer syntax is
Every DICOM file says, in element (0002,0010), how the rest of it is encoded. That decides three things:
- Byte order: little endian (almost everything) or big endian (rare now).
- Implicit or explicit VR: whether each element states what kind of value it holds, or the reader has to look it up in a dictionary.
- Compression of the pixels: none, or one of several.
The file header itself is always the same; only what follows changes.
The ones you’ll meet
| Transfer syntax | UID | Compression |
|---|---|---|
| Implicit VR Little Endian | 1.2.840.10008.1.2 | None |
| Explicit VR Little Endian | 1.2.840.10008.1.2.1 | None |
| Deflated Explicit VR Little Endian | 1.2.840.10008.1.2.1.99 | The whole file, zip-style |
| RLE Lossless | 1.2.840.10008.1.2.5 | Run-length, lossless |
| JPEG Baseline | 1.2.840.10008.1.2.4.50 | JPEG, lossy, 8 bits |
| JPEG Lossless | 1.2.840.10008.1.2.4.70 | JPEG, lossless |
| JPEG-LS Lossless | 1.2.840.10008.1.2.4.80 | JPEG-LS, lossless |
| JPEG 2000 | 1.2.840.10008.1.2.4.90 / .91 | JPEG 2000, lossless or lossy |
Uncompressed files open anywhere. Baseline JPEG opens anywhere a web browser can show a photo. JPEG lossless and JPEG-LS are where most viewers, and web pages in particular, give up: browsers can’t decode them.
Find out which one you have
With the free, open-source OFFIS DICOM Toolkit (DCMTK):
dcmdump +P 0002,0010 scan.dcm
Or open the file in our DICOM viewer: the side panel shows the transfer syntax, and if it can’t show the image, it says why and keeps every tag readable.
The fix: decompress it
DCMTK converts compressed files to uncompressed ones:
dcmdjpeg in.dcm out.dcm # JPEG, including JPEG lossless
dcmdjpls in.dcm out.dcm # JPEG-LS
dcmdrle in.dcm out.dcm # RLE
dcmconv +te in.dcm out.dcm # deflated or big endian, to Explicit VR Little Endian
Open out.dcm and it works. The open-source DCMTK doesn’t include a JPEG 2000 codec, so for those you need another converter.
What our viewer reads
Uncompressed (implicit or explicit VR, little or big endian), deflated, RLE and baseline JPEG, in the browser, with nothing uploaded. For JPEG lossless and JPEG-LS it shows the tags and the right command from above. The case study explains why it works that way.
Moving images between systems that don’t agree on formats? Tell me about it.
