Search code examples
dicomfile-format

DICOM File Meta Information Version padded with zeros


I've got a DICOM file that starts like this, and most of it makes sense to me based on the spec parts 5, 6 and 10, but the File Meta Information Version element (0002,0001) has me foxed.

00000000: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000030: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000040: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000050: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000060: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000070: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000080: 4449 434d 0200 0000 554c 0400 ce00 0000  DICM....UL......
00000090: 0200 0100 4f42 0000 0200 0000 0001 0200  ....OB..........
000000a0: 0200 5549 1e00 312e 322e 3834 302e 3130  ..UI..1.2.840.10
000000b0: 3030 382e 352e 312e 342e 312e 312e 3737  008.5.1.4.1.1.77
000000c0: 2e31 2e36 0200 0300 5549 3800 312e 322e  .1.6....UI8.1.2.

This is the bit that I don't understand:

00000090: 0200 0100 4f42 0000 0200 0000 0001

The first four bytes are the (0002,0001) tag, and the next two are the VR 4f42 = OB. I expect 0200 for the value length (2 bytes) and 0001 for the version, but what are the two sets of 0000 in between?

I haven't found any specification of padding here, and in any case all mention of padding that I've found in the spec only extends as far as padding onto two-byte boundaries, never four or more.

And if the zeros were leading zeros in 32-bit quantities then I'd expect them to come after the 0200 and 0100, not before. And of course then the length would have to be 0400, not 0200.

The file was created by OrthancWSIDicomizer.exe, part of the Orthanc DICOM offering.

What am I missing? (Apart from the obvious: a deep understanding of DICOM!)


Solution

  • I haven't found any specification of padding here,

    The data element is correctly encoded: in the Explicit VR Little Endian transfer syntax, there is padding depending on the data element's value representation. According to Table 7.1-1, if the VR is either of "OB", "OD", "OF", "OL", "OV", "OW", "SQ", "UC", "UR", "UT", or "UN", then the two VR bytes are followed by "Reserved (2 bytes) set to a value of 0000H", and the length of the element is defined with 4 bytes instead of just 2. In this case, these are the bytes at position 0096. The subsequent 4 bytes, at 0098, represent the length of the element: 0200 0000 (little endian for 2).

    The complete data element with header is 14 bytes long: 0200 0100 4f42 0000 0200 0000 0001, (0002,0001) File Meta Information Version, OB, with the value 1.