DICOM

Kay(Geun Woo)
3 min readJun 17, 2024

--

What is dicom?

Image of DICOM standard protocol generated by DALL-E

With the recent boom of AI, healthcare field started to rumble. Businesses began to apply AI to predict, simulate and enhance the human body and organisms to help the hospitals and doctors to deliver quicker and better treatment and surgical plans to the patients. This means much for the software developers(who are not into AI) as well. If you want to dive into the rising healthcare field, there are certain concepts you need to be aware of, and this blog explains them.

DICOM(Digital Imaging and Communications in Medicine)

DICOM is a standard protocol to manage, store, transmit, and display the medical imaging information like CT and MRI images. It is a worldwide standard of handling data related to medical imaging data, so if you learn about DICOM protocol, you would be a step ahead to become a healthcare software developer.

There are tons of explanations and elaborations about the details of the DICOM. However, I want to focus on few key aspects of DICOM.

  1. File extension: DICOM file uses “.dcm” file extension.
  2. File format: DICOM stores the data in byte codes. Hence, you cannot just open and read the dicom files like .exe files or .dmg files. You need certain libraries, or file system, or viewer to view the contents of them.
    i.e. pydicom library of python can read/write dicom files, Azure Dicom service can save the dicom files and the users can use it as a database to store, read, write, and manage the dicom files.
  3. Structure: A DICOM file is made of multiple sections.
    First, it starts with File Preamble, which is the first 128 bytes reserved and usually set to zero. It can be manipulated to address meaningful data, which can identify the file.
    After the preamble, DICOM prefix, DICM, is placed to identify that the file is a DICOM file.
    File Meta Information is followed by the prefix. It contains the metadata about the DICOM file itself, like File Meta Information Group Length , which determines the length of the file meta information and Media Storage SOP Class UID , which denotes the file’s content. For example, if the file contains data about a CT image, the SOP Class UID would be ‘1.2.840.10008.5.1.4.1.1.2’. It is unique, and never changes. That UID stands for CT image. There are more contents in File Meta Information, but I’m not explaining about them since there are plenty of online sources explain them like here.
    After the file meta information, Dataset enters. The dataset is literary a dataset that stores the data about the DICOM file. It is formatted like Java’s Hashmap, but in tag & value pair. For example, the patient’s name is tagged like (0010, 0010) . Other than its tag and value pair format, you need to know that the DICOM file has a certain hierarchical format. Image information, under Series Information, under Study information under patient information. For example, if a patient, Rachael, has a lung cancer, and she shoot two sequences of CT images, A and B, Rachael has a lung cancer study, with two series of CT images. This is just an example. The contents of the hierarchy depend on how the doctors or the writers select.
    At the end of the DICOM file, there is a Pixel Data, which stores the image or images to be stored in the file. This is in byte code as well.

This is the end of brief explanation about the DICOM protocol. I will keep post further details about the DICOM and how to modify them. Hence, see you in the next post!

--

--