// blog

What's Inside a DICOM File: Tags, Sequences and Private Tags

A DICOM file is a header of tagged data elements followed by the image. Each element has a tag (two four-digit hex numbers, such as (0010,0010) for the patient’s name), a value representation that says what kind of value it is, and the value. Groups gather related elements: 0010 the patient, 0008 the study and series, 0018 the acquisition, 0028 the image. Sequences nest elements inside elements, and odd-numbered groups are private tags a vendor defines.

Last updated 2 min read

A DICOM file looks like an image, but most of it is a record. The chest CT slice in our viewer carries 103 tagged elements before the first pixel: who the patient is (in this public sample, an anonymous code), when the scan was made, which scanner made it, how it was made, and how the image should be shown.

An element: tag, VR, value

Every element has three parts:

  • A tag: two four-digit hexadecimal numbers, group and element. (0010,0010) is the patient’s name, (0028,0030) the pixel spacing.
  • A value representation (VR): two letters for the kind of value. PN is a person name, DA a date, DS a decimal number stored as text, US an unsigned 16-bit number, UI a unique identifier, SQ a sequence.
  • The value. Some hold several values separated by a backslash: the pixel spacing 0.9765625\0.9765625 is the row spacing and the column spacing, in millimeters.

Hover a VR in the viewer’s tag table and it spells out the name.

Groups worth knowing

Group What it holds Examples
0002 File information Transfer syntax: how the rest is encoded
0008 Study and series Study date, modality, description, manufacturer
0010 Patient Name, ID, sex, age
0018 Acquisition Slice thickness, kVp, echo time, frame time
0020 Relationships and position Study and series UIDs, image position, slice location
0028 The image Rows, columns, bits stored, pixel spacing, window
7FE0 The pixels Pixel Data

In the viewer, the chips above the tag table filter by these groups.

Sequences

Some elements hold other elements. A sequence (VR SQ) contains items, and each item is a little set of elements of its own: a procedure code with its meaning, the regions of an ultrasound image, a reference to another study. Sequences can nest inside sequences.

The tag table folds them: click a sequence to unfold what’s inside, or Unfold all sequences.

Private tags

Any group with an odd number is private: a vendor’s own elements, defined in its conformance statement rather than in the standard. They hold settings and calibration only that vendor’s software understands. The viewer marks them, and the Private tags box hides them.

Read your own

Open the DICOM viewer, pick a sample or Open files with your own, and scroll to Every DICOM tag in this file. Search for a name, a tag number or a value, and copy any element with the button at the end of its row. Your files are read in the browser and never uploaded.

The names come from the data dictionary of the open-source OFFIS DICOM Toolkit (DCMTK), the same one its dcmdump tool uses.

Need DICOM data pulled into your own system? Let’s talk.