What is DICOM? The file format for medical images

DICOM is the international standard for storing and exchanging medical images. If you received a disc or a download link with your CT, MRI or X-ray images, the files are most likely DICOM files.

FDG-PET-CT-Lesions (Gatidis, Kuestner), TCIA, CC BY 4.0

On this page
  1. About the DICOM standard
  2. History of DICOM
  3. What is inside a DICOM file
  4. How a study is organized
  5. Compression and transfer syntaxes
  6. How DICOM images are exchanged
  7. Modalities and their codes
  8. How to open DICOM files
  9. Converting DICOM to JPEG, PNG or video
  10. Personal data and de-identification
  11. Frequently asked questions
  12. Sources

Almost all imaging equipment in radiology and cardiology uses DICOM. The same format is used when images move from the scanner to the hospital archive, to another clinic or onto a patient's disc. This page explains what is inside DICOM files and how to open, convert and share them safely.

About the DICOM standard

DICOM stands for Digital Imaging and Communications in Medicine. It defines a file format and a network protocol for medical images, so that equipment and software from different manufacturers can work together.

DICOM was created by the American College of Radiology (ACR) and the National Electrical Manufacturers Association (NEMA). Today it is developed by the DICOM Standards Committee, with NEMA as the secretariat. DICOM is also recognized as the international standard ISO 12052.

The standard has about 20 parts, numbered from PS3.1 to PS3.22, and is updated several times a year. The current edition is free to read at dicomstandard.org.

History of DICOM

In 1983, ACR and NEMA formed a joint committee, because scanner images were hard to read without the manufacturer's own equipment.

  • 1985 - ACR-NEMA 300, for point-to-point transfer over a dedicated 16-bit parallel interface.
  • 1988 - ACR-NEMA 2.0, the second version.
  • 1993 - DICOM 3.0, with the new name and support for computer networks (TCP/IP).
  • 1995 - exchange of studies on CDs, and objects for ultrasound, X-ray angiography and nuclear medicine.

There has been no new major version since 1993. Supplements have added, for example, the modality worklist (1996), structured reports (2000), breast tomosynthesis (2008), whole slide imaging (2010) and DICOMweb (2013).

What is inside a DICOM file

A DICOM file holds the image and information about the patient, the examination and the equipment. Its layout is defined in PS3.10:

  1. Preamble - 128 bytes, usually all zeros.
  2. Prefix - the four letters DICM, which identify a DICOM file.
  3. File Meta Information - group 0002, including the Transfer Syntax UID (0002,0010), which tells how the rest of the file is encoded.
  4. Data set - a sequence of data elements.
  5. Pixel Data (7FE0,0010) - the image itself, usually the last and largest element.
Inside a DICOM file
  1. 0x0000
    Preamble128 bytes, usually all zeros
  2. 0x0080
    DICM PrefixThe letters DICM mark the file as DICOM
  3. (0002,xxxx)
    File meta informationHow the rest of the file is encoded (transfer syntax)
  4. (gggg,eeee)
    Data setData elements about the patient, study, series and image

    One data element PatientName

    Tag
    (0010,0010)10 00 10 00
    Value type (VR)
    PN50 4E
    Length
    808 00
    Value
    DOE^JANE44 4F 45 5E 4A 41 4E 45
  5. (7FE0,0010)
    Pixel dataThe image itself, raw or compressed

Each data element has a tag (hexadecimal group and element numbers, for example (0010,0010)), a value representation or VR (a two-letter data type such as PN for a name or DA for a date), a length and a value. Tags with odd group numbers are private, usually defined by manufacturers.

TagName
(0010,0010)Patient's Name
(0010,0020)Patient ID
(0010,0030)Patient's Birth Date
(0008,0020)Study Date
(0008,0060)Modality
(0008,1030)Study Description
(0008,103E)Series Description
(0020,000D), (0020,000E), (0008,0018)Study, Series and SOP Instance UID
(0028,0010), (0028,0011)Rows and Columns (image size in pixels)
(0028,0030)Pixel Spacing (millimeters between pixel centers)
(0018,0050)Slice Thickness
(7FE0,0010)Pixel Data

How a study is organized

DICOM organizes images in four levels:

  • Patient - the person who was examined.
  • Study - one examination, for example a chest CT on a given date.
  • Series - images acquired or reconstructed together, for example thin slices or a bone reconstruction.
  • Instance - one object, usually one image, stored as one file.
From patient to image
  • Patient PatientID

    The person: name, ID, date of birth

    • Study StudyInstanceUID

      One examination, such as a chest CT on a given day

      • Series SeriesInstanceUID

        One set of images from a single scan or reconstruction

        • Instance SOPInstanceUID

          One image or object, stored as one file

Each image is usually a separate file, and a study can have several series of hundreds of slices, so one study can contain thousands of files.

Every study, series and instance has a unique identifier (UID): numbers separated by dots, up to 64 characters long, for example 2.25.329800735698586629295641978511506172918. UIDs are designed to be unique worldwide, and software uses them, not file names, to group and sort images.

Each object belongs to a SOP Class that defines its type, for example CT Image Storage (1.2.840.10008.5.1.4.1.1.2). Multi-frame objects keep many frames in one file, such as an ultrasound clip. DICOM also stores other kinds of objects: structured reports (SR), encapsulated PDF documents, presentation states, segmentations (SEG) and radiotherapy plans.

Compression and transfer syntaxes

The transfer syntax defines the byte order, whether the VR is written in the file and whether the pixel data are compressed. A viewer that does not support a transfer syntax may fail to open a valid file.

Transfer syntaxUIDCompression
Implicit VR Little Endian (the default)1.2.840.10008.1.2None
Explicit VR Little Endian1.2.840.10008.1.2.1None
Deflated Explicit VR Little Endian1.2.840.10008.1.2.1.99Lossless, whole data set
JPEG Baseline1.2.840.10008.1.2.4.50Lossy
JPEG Lossless1.2.840.10008.1.2.4.70Lossless
JPEG-LS1.2.840.10008.1.2.4.80, 1.2.840.10008.1.2.4.81Lossless or near-lossless
JPEG 20001.2.840.10008.1.2.4.90, 1.2.840.10008.1.2.4.91Lossless or lossy
HTJ2K, added in 20231.2.840.10008.1.2.4.201 to 1.2.840.10008.1.2.4.203Lossless or lossy
RLE Lossless1.2.840.10008.1.2.5Lossless
MPEG-2, H.264, H.2651.2.840.10008.1.2.4.100 and othersLossy video

Lossless compression keeps every pixel exactly and often makes files two to three times smaller. Lossy compression can make files ten or more times smaller, but it permanently removes detail. It is common for ultrasound and video, while CT, MRI and X-ray images are usually stored uncompressed or lossless, because lost detail can matter for diagnosis. The value 01 in Lossy Image Compression (0028,2110) marks an image that was compressed with loss.

How DICOM images are exchanged

In a hospital, scanners send images to a PACS (Picture Archiving and Communication System), which stores them and delivers them to radiologists' workstations. Each DICOM device or program is an Application Entity (AE) with an AE title, an IP address and a port, usually 104 or 11112. The classic DIMSE services work over TCP/IP:

  • C-ECHO - checks the connection.
  • C-STORE - sends objects.
  • C-FIND - searches for studies, series or images.
  • C-MOVE - asks a server to send objects to a destination.
  • C-GET - retrieves objects over the same connection.

With the modality worklist, the scanner receives the list of scheduled patients, so names and IDs are not typed by hand. DICOMweb (PS3.18) offers similar services over HTTP: QIDO-RS to search, WADO-RS to retrieve and STOW-RS to store.

Patients usually receive a CD, DVD, USB drive or download link. A disc made to the DICOM standard has a DICOMDIR index file and often a viewer.

Modalities and their codes

The modality code is stored in the tag (0008,0060).

CodeMeaningArticle
CTComputed tomographyCT scan
MRMagnetic resonanceMRI
CR, DXComputed radiography, digital radiographyX-ray
USUltrasoundUltrasound
MGMammographyMammography
PTPositron emission tomographyPET and PET/CT
NMNuclear medicineNuclear medicine and SPECT
XA, RFX-ray angiography, radio fluoroscopyAngiography and fluoroscopy
IO, PXIntra-oral radiography, panoramic X-rayDental X-rays and CBCT
BMDBone densitometryBone density scan

A PET/CT study contains both PT and CT series, and dental cone beam CT (CBCT) usually uses the code CT. Other codes include OP and OPT (eye imaging), SM (slide microscopy), ES (endoscopy), ECG, SR, SEG and RTSTRUCT, RTPLAN, RTDOSE (radiotherapy).

How to open DICOM files

Ordinary photo viewers cannot open DICOM files. You need a DICOM viewer, for example:

  • Weasis - free and open source, for Windows, macOS and Linux.
  • 3D Slicer - free and open source, with advanced 3D tools, for Windows, macOS and Linux.
  • Horos - free and open source, for macOS.
  • OHIF Viewer - free and open source, runs in a web browser.
  • MicroDicom - free for non-commercial use, for Windows.
  • RadiAnt DICOM Viewer - commercial, with a free trial, for Windows.

Licenses can change, and this list is not a recommendation.

To view a disc, copy all of it to your computer, then open the DICOMDIR file or the folder in a viewer. The viewer on the disc is optional and often runs only on Windows. Without a disc drive, ask the clinic for a download link.

Converting DICOM to JPEG, PNG or video

Viewers can export images to JPEG or PNG and series to video, but the result is no longer a full medical image:

  • Metadata is lost: patient, study and equipment data and the order of images.
  • Gray levels are reduced. CT and MR images usually have 12 to 16 bits per pixel (thousands of shades of gray), but a typical JPEG has 8 bits (256 shades).
  • Window and level are fixed. A doctor can no longer adjust the displayed range for bone, lungs or soft tissue.
  • Measurements become unreliable, and 3D reconstructions are no longer possible.

For a second opinion, send the original DICOM files of the whole study, not screenshots or videos.

Personal data and de-identification

DICOM headers usually contain personal data: the patient's name, ID, date of birth and sex, examination dates, and the names of the hospital and doctors. Text can also be burned into the pixels, for example on ultrasound images, and private tags may hold identifying data.

De-identification removes or replaces this information. The standard describes it in PS3.15, Annex E (Attribute Confidentiality Profiles). Before you share images publicly or for teaching:

  • use a de-identification tool that also removes private tags;
  • check the pixels for names and dates, and crop or cover them;
  • remember that a 3D reconstruction of a head CT or MRI can show the face;
  • keep the original files for your doctors.

Frequently asked questions

Why does my study have so many files?

Each image is usually a separate file, and a study can have hundreds or thousands of images (see how a study is organized). This is normal.

What is DICOMDIR?

DICOMDIR is an index file on the disc. It lists all patients, studies, series and images and the location of each file. Open it in a viewer to load the whole disc.

Can I open DICOM files on a phone?

Yes, with a DICOM viewer app or a web viewer. For diagnosis, doctors use larger, calibrated displays.

Can I convert DICOM to JPG or PDF?

Yes, but exported images lose information, so keep the original files (see converting DICOM).

Is DICOM free to use?

The standard is free to read, and many free and open-source programs support it. NEMA does not certify products; manufacturers publish DICOM Conformance Statements.

Does a DICOM file need the .dcm extension?

No. Files on discs often have short names like IM000001 without an extension. Programs recognize a DICOM file by the DICM prefix, not by its name.

Sources

Updated

Imaging studies stored in DICOM

Ten common medical imaging studies: how each one is done, what it shows and what its DICOM files contain.