

Because when we want to create a dicom file, we can’t just put the pixel data in, because a dicom file contains more information than just the values of the pixels.Īnd we are unable to provide this information without the assistance of another dicom file. The answer can be found on the blog where we converted from JPG to dicom. You may be wondering why we need a dicom file if we are attempting to convert to a dicom.


So, in this blog, I will demonstrate how simple it is to create such a function and make your life easier. The inspiration for this conversion came from a function I wrote to convert JPG or PNG images to dicoms.
Create Dicomdir From Dicom Files series#
But now I’ve decided to make it so that anyone who requires this type of conversion can use it.Įven the concept of creating a function that converts nifti files into dicom series was simple all that was required was to return the frame data from the nifti files, divide it into slices, and then convert each slice into one dicom. I wasn’t thinking about writing my own function to do the conversion for me at the time perhaps I was too lazy to think about it. It took me an eternity to finish this conversion.
Create Dicomdir From Dicom Files software#
We all know that there is no such library or function to convert nifti files into dicoms, so I struggled by manually converting the files one by one with the software 3D slicer. As a result, I needed to convert these patients into dicom files before creating the small nifti files with the desired number of slices. My dataset, on the other hand, was a collection of patients with a random number of slices. One of the things I was doing to prepare my data was making small nifti files with 128 slices for each file. So, in terms of data preparation, I experimented with a variety of approaches in order to improve my results. It was a difficult project I had a lot of tasks to complete, including data preparation. Nifti to Dicom Photo by National Cancer Institute on Unsplash Abstractĭuring my internship for my master’s degree in computer vision, I worked on a project that used U-Net to segment tumors throughout the body.
