The image of a DICOM object is described by the elements of the Image Pixel module
(group 0028, PS3.3 C.7.6.3) and stored in Pixel Data
(7FE0,0010), near the end of the data set. How the pixels are packed depends
on the transfer syntax.
Image pixel elements
| Tag | VR | Type | Name | Meaning |
|---|---|---|---|---|
(0028,0002) | US | 1 | Samples per Pixel | Number of samples (planes) per pixel: 1 or 3 for the interpretations below. |
(0028,0004) | CS | 1 | Photometric Interpretation | How to read the samples (below). |
(0028,0006) | US | 1C | Planar Configuration | Only when Samples per Pixel is above 1: 0 = interleaved by pixel (R1 G1 B1 R2 G2 B2 …), 1 = by plane (all R, then all G, then all B). |
(0028,0008) | IS | 1 | Number of Frames | Frames in a multi-frame image; part of the Multi-frame module, absent from single-frame objects. |
(0028,0010) | US | 1 | Rows | Image height. |
(0028,0011) | US | 1 | Columns | Image width. |
(0028,0034) | IS | 1C | Pixel Aspect Ratio | Vertical and horizontal size of a pixel, when not 1:1 and no pixel spacing is given. |
(0028,0100) | US | 1 | Bits Allocated | Bits of storage per sample: 1 or a multiple of 8. |
(0028,0101) | US | 1 | Bits Stored | Bits of each sample that hold data. |
(0028,0102) | US | 1 | High Bit | Position of the top data bit: Bits Stored − 1. |
(0028,0103) | US | 1 | Pixel Representation | 0000 unsigned integer, 0001 two’s complement. |
(0028,0106) | US or SS | 3 | Smallest Image Pixel Value | Lowest value in the image. |
(0028,0107) | US or SS | 3 | Largest Image Pixel Value | Highest value in the image. |
(0028,0120) | US or SS | 3 | Pixel Padding Value | Value of pixels outside the scanned area (General Equipment module). |
(0028,0121) | US or SS | 1C | Pixel Padding Range Limit | With the padding value, a range of padding values. |
(0028,1101)–(0028,1104) | US or SS | 1C | Red, Green, Blue, Alpha Palette Color Lookup Table Descriptor | Three numbers: entries in the table (0 means 65536), first pixel value mapped, bits per entry. |
(0028,1201)–(0028,1204) | OW | 1C | Red, Green, Blue, Alpha Palette Color Lookup Table Data | The table entries. |
(0028,2000) | OB | 3 | ICC Profile | Colour profile of the pixel values. |
(0028,2002) | CS | 3 | Color Space | Name of a well-known colour space, matching the ICC profile. |
(0028,7FE0) | UR | 1C | Pixel Data Provider URL | Where to fetch the pixels when a JPIP syntax is used. |
(7FE0,0001) | OV | 3 | Extended Offset Table | 64-bit byte offset of each frame’s first fragment. |
(7FE0,0002) | OV | 1C | Extended Offset Table Lengths | 64-bit length of each frame’s encoded data; required with the table. |
(7FE0,0008) | OF | 1C | Float Pixel Data | Pixels as 32-bit floats, in place of Pixel Data. |
(7FE0,0009) | OD | 1C | Double Float Pixel Data | Pixels as 64-bit floats, in place of Pixel Data. |
(7FE0,0010) | OB or OW | 1C | Pixel Data | The pixels. |
All planes share the same rows, columns, bits allocated, bits stored, high bit, pixel
representation and aspect ratio. To turn a stored value into a measurement, many
objects give Rescale Intercept (0028,1052) and Rescale Slope
(0028,1053): output = slope × stored + intercept (Hounsfield
units in CT). Window Center (0028,1050) and Window Width
(0028,1051) suggest a display range.
Photometric interpretations
| Value | Samples | Meaning |
|---|---|---|
MONOCHROME1 | 1 | Greyscale; the lowest value is shown as white |
MONOCHROME2 | 1 | Greyscale; the lowest value is shown as black |
PALETTE COLOR | 1 | Each value is an index into the red, green and blue lookup tables |
RGB | 3 | Red, green and blue |
YBR_FULL | 3 | Luminance and two colour differences, all at full resolution |
YBR_FULL_422 | 3 | As YBR_FULL, with the colour differences at half the horizontal resolution; uncompressed data stores Y1 Y2 Cb Cr for each pair of pixels |
YBR_PARTIAL_420 | 3 | Colour differences at half resolution both ways; compressed data only (MPEG) |
YBR_ICT | 3 | Irreversible colour transform; compressed data only (JPEG 2000) |
YBR_RCT | 3 | Reversible colour transform; compressed data only (JPEG 2000) |
XYB | 3 | Perceptual colour model of JPEG XL; compressed data only |
YBR_PARTIAL_422 | 3 | Retired in 2017 |
HSV | – | Retired in 2001 |
ARGB | – | Retired in 2001 |
CMYK | – | Retired in 2001 |
Native pixel data
With an uncompressed transfer syntax the value of (7FE0,0010) is the
pixels themselves, with an explicit length.
- Each sample sits in a cell of Bits Allocated bits. Its data occupies bits High Bit − Bits Stored + 1 to High Bit; other bits may hold anything, so a reader masks them (and sign-extends for Pixel Representation 1).
- Samples run left to right, rows top to bottom, then frame after frame with no padding between frames. One padding byte at the very end keeps the length even.
- Little endian syntaxes store 16-bit cells least significant byte first. The VR is OW, or OB when Bits Allocated is 8 or less in an explicit VR syntax.
- With Bits Allocated 1, pixels are packed eight to a byte, and a frame may start in the middle of a byte.
The size is Rows × Columns × Samples per Pixel × Number of Frames × Bits
Allocated / 8 bytes, rounded up to even, except for YBR_FULL_422, where two
pixels share one pair of colour samples.
Encapsulated pixel data
With a compressed transfer syntax, (7FE0,0010) is OB with undefined
length, and its value is a run of items:
| Item | Tag | Length | Content |
|---|---|---|---|
| Basic Offset Table | (FFFE,E000) | 0, or 4 × frames | Empty, or one 32-bit offset per frame. Each is the distance from the first byte after this item to the item tag of the frame’s first fragment, so the first is always 0. Must be empty when the Extended Offset Table is present. |
| Fragment | (FFFE,E000) | Even, at least 2 | Compressed data. A fragment holds data of one frame only; a frame may span several fragments, and the last one of a frame may be padded. |
| … | More fragments | ||
| Sequence Delimitation | (FFFE,E0DD) | 0 | The end. |
Encapsulation is only used for top-level pixel data, never for float pixel data, and the data set is always explicit VR little endian. A reader walks the item lengths rather than searching for the delimiter.
E0 7F 10 00 4F 42 00 00 FF FF FF FF (7FE0,0010) OB, undefined length
FE FF 00 E0 00 00 00 00 empty Basic Offset Table
FE FF 00 E0 2A 3B 00 00 FF D8 FF … fragment 1: 15146 bytes of JPEG
FE FF DD E0 00 00 00 00 sequence delimitation
RLE Lossless
Transfer syntax 1.2.840.10008.1.2.5 uses DICOM’s own run-length coding
(PS3.5 Annex G). Each frame is one fragment, made of a 64-byte header and up to 15
segments.
| Offset | Size | Type | Field |
|---|---|---|---|
| 0 | 4 | UL | Number of segments, 1 to 15 |
| 4 | 4 | UL | Offset of segment 1, always 64 |
| 8 | 4 × 14 | UL | Offsets of segments 2 to 15; 0 when unused |
Offsets are little endian and count from the start of the header. Each sample is padded with zero bits at the top to whole bytes, and the bytes are split into segments: the most significant bytes of all pixels first. A 16-bit greyscale image has two segments (high bytes, then low bytes); an 8-bit RGB image three (red, green, blue). Each segment is coded on its own:
| Header byte n (signed) | Meaning |
|---|---|
| 0 to 127 | Copy the next n + 1 bytes literally |
| −1 to −127 | Repeat the next byte −n + 1 times |
| −128 | Not used; a decoder skips it |
Runs never cross the end of a row, and each segment is padded to an even length with a zero byte.