What Is The Difference Between Dicom And Nifti Images?

In this article, we will talk a little bit about the Nifti files and the difference between them and normal 2D slices (Dicom). Then we will see how to visualize and convert them.

Mohammed El Amine Mokhtari
4 min readApr 5, 2021

The original article on my blog website here.

Introduction

Before talking about the differences between these two types of images, we should know first what these types are.

So the answer is that they are both images or we call say files special for medical analysis. Because in general, 80% of people use normal images like JPEG, PNG, Tiff … but in the medical field, these images are not helpful because for more precise analysis we need more information about the patient and about how the image was taken.

This information is stored in the same file either Dicom or Nifti and to call them we can use something called tags, so we use these tags to return the information that we want like the patient ID, name… Those were the information only for the patient but there is the other side that is special for the image itself. We call them also by using the tags but they are a little bit different, from this information there is a component called pixel_data array which is an array that contains the values of the pixels that we can visualize, the dimensions of the pixel (in case you want to calculate an area from the body, for example, tumor), the depth of the pixel…

This definition was in general because you can say that if the two types (Dicom and Nifti) have the same functionalities so what is the use?

Don’t worry about that, I had this problem too at first and the articles that I found were not straight to the point so I was lost, but doing some analysis using the 3D slicer I could understand the difference between them and you will see that it is very easy to understand.

The Dicom image (or file) is a 2D image even though it has a volume but in reality, it is a 2D image because it has only one slice of an MRI, CT, TEP…

Instead of that, the Nifti file can contain a set of these Dicom images. To give you a quick example that I am sure you will understand, a video is a set of frames so when we put all the frames together with a delay between each frame then we get the video, so the same this here we can say that the Dicom images are frames and when we put them together we get the Nifti.

So a Nifti image is a whole representation of a part of the human body, that contains all the slices that we took using the X-rays or any other method.

In this case, the volume or the depth of the Dicom slices will be the distance between each two Dicom images. So now we have one Nifti file that represents all the slices with all the other information that we talked about in the Dicom part.

How to visualize the Nifti images?

In this article, we talked about how to visualize or convert a Dicom image using python and now I will show you how to visualize a Nifti file using multiple ways.

If you don’t care about programming so there is an easy way of how to visualize them using some free software, for that you can use:

  • 3D slicer
  • ITK snap
  • And there is more software that does almost the same thing.

If you use the 3D slicer for example you can do a lot of stuff with the Nifti images, you can visualize them, convert them into Dicom slices, JPG, or PNG images …

How to visualize a Nifti image using the 3D slicer

It is very easy actually. First, you can download the software from this link and install it, then you open it normally.

You will get this window:

Then you can choose either click on DATA in the top bar or you can directly drag and drop the Nifti file in this window and it will be open. You will visualize the file in the three cuts (axial, coronal, and sagittal), here is an example:

And when you scroll you will go to the next or the previous slice and in this case, you can analyze the images with more precision.

Read more

Link here

You Want to Learn Deep Learning for Medical Imaging!

Coming soon is a comprehensive medical imaging course covering 2D and 3D segmentation using Monai and PyTorch with added support. Join the waiting list to receive notifications of any course updates.

Subscribe to my newsletter to get all the updates about my work :).

--

--

Mohammed El Amine Mokhtari
Mohammed El Amine Mokhtari

Written by Mohammed El Amine Mokhtari

I'm a computer vision research assistant, YouTuber and online content creator. Co-founder at: https://pycad.co/

No responses yet