Overlay Planes is always 1-bit per pixel where Overlay Bits Allocated
is 1 and Overlay Bits Position (60XX, 0102)
is always 0. One bit overlay data is encoded separately from Pixel Data
element and Overlay Data (60XX, 3000)
element is used for storing the data. Value representation for the Overlay data Element is OW. However, OB can be used for explicit VR encoding.
According to PS 3.5 of DICOM standard section 8.1.2, “Overlay Data is encoded as the direct concatenation of the bits of a single Overlay Plane, where the first bit of an Overlay Plane is encoded in the least significant bit, immediately followed by the next bit of the Overlay Plane in the next most significant bit. When the Overlay Data crosses a word boundary in the OW case, or a byte boundary in the OB case, it shall continue to be encoded, least significant bit to most significant bit, in the next word, or byte, respectively”.
The byte ordering of the 2-byte words (VR of OW) is dictated by the Endianness used in the encoding. So there is no padding used at the row boundary and it is encoded from left to right and top to bottom , a row at a time where overlay bit 1 is the first bit of the Overlay Plane (top left pixel).
Formally overlay data was allowed to be embedded in unused bits of Pixel Data (7FE0, 0010)
and Overlay Bit Position (60XX, 0102)
was used to indicate the unused bit in the pixel data in which overlay data was stored. In this type of encoding, Overlay Bits Allocated (60XX, 0100)
should have the same value as Bits Allocated (0028, 0100)
attributes of Image Pixel module. The value of Overlay Bits Allocated
greater than 1 is the indication that overlay data is embedded in the pixel data.
Even group (6000-601F, eeee) is used for Overlay Planes encoding and a dataset can have maximum of 16 overlays per image.