Jump to content
  • entries
  • comments
  • views



In this tutorial I will cover some of the basics on working with dicom data with a focus on anatomizing, and reading into medical imaging software as well as how to potentially fix problematic scans.



So first of all what is DICOM data?  It is a standard file type for basically all medical imaging devices (CT, MRI, US, PET, X-ray, etc), DICOM stands for Digital Imaging and COmmunication in Medicine and along with the file format, and the tags, it is designed to be transferred and stored with PACS.  The DICOM standard can be found at their homepage.  


The useful bits for the purpose of creating anatomical models and particularly values that define the volume geometry can be found in 'tags'.  These are in each image/slice header file (metadata).  They are two 4 digit hexadecimal values assigned to a particular type of value like:


(0018, 0088) Spacing Between Slices


To find the official library of these tags go to the standard on the dicom home page and go down to "Part 6: Data Dictionary".  When opened scrolling down will reveal just how immense the dicom standard is.  Now this library just gives you the tag and the name but not much information about that tag.  To get a bit more of a description use Dicom Lookup and type in the tag or name to find more information.


Before looking at data a mention on anatomizing data.  The goal is to remove any information that can be traced back to the original person without removing other important information like modality, etc...  To get an official type of list of these values go to HIPPA and find there de-identification guidance document.  In general (pages 7 and 8) remove all names, dates, addresses, times, and other sensitive information like SSN.


Now to actually look at the data I have for years used ImageJ which has been updated to Fiji.  Open an image from the scan CD and click 'CNTR+I' to open the header file and see what is in there.




Fiji (ImageJ) is a very simple and useful program for looking at data.  It is mostly made for working in 2D so in that way is kind of outdated compared to modern medical imaging software like 3DSlicer but it still has its place.  Fiji can save a stack of images as an nrrd file so if for some reason 3DSlicer doesn't want to load a scan correctly Fiji gives you another option.


So as useful as Fiji is; for anonymising and changing the values of tags I would suggest Dicom Browser.  I personally use some code in Matlab to automate the process but that is an expensive and cumbersome tool for the average user.  Open the folder with the data in Dicom Browser and when the main folder is selected the values from each slice are stacked on top of each other.  To anonymise the data select a value and set it to 'clear'




Find all relevant information and clear it or change its value to something that can't be traced to the person (like patient A001).  This is also where geometrical values like slice thickness can be changed if that is necessary to get a scan to load properly.  Once all the values are changed save the new dicom files and open the new ones again in ImageJ just to check that it all worked and that no PID (Patient Identifier Data) was missed.


As to fixing data the most common issue I have come across is an incorrect slice spacing which causes the scan to be shrunk or stretched.  There are a few values that control this and different programs will use different values.  'SliceThickness' is sometimes used which is bad.  The best is to use the 'ImagePositionPatient' which changes for each slice/image.  'SliceSpacing' is often used as well which is better than 'SliceThickness'.  If you suspect your slice spacing value is wrong calculate the difference between two consecutive 'ImagePositionPatient' values and check it against the slice spacing if they are not equal something is amiss. 


Now you have anonymized and potentially fixed data that you can send to a friend, share here on embodi3D or load up in medical imaging software like my favorite 3DSlicer.


When dicom data (anonymized or not) is loaded into 3DSlicer and saved to an nrrd file (see Dr. Mike's tutorial) you will have a single volume file which is inherently anonymized.  Opening the *.nrrd file in a text editor like notepad++ there are a few lines at the top which are basically your new header file.  It is very minimal and doesn't include a great deal of the information that was in the original dicom files like modality, scan type and settings.  This is fine if all you want to do is create a model from it but it can be helpful to have other information then what you have in an nrrd file, so anonymized dicom will be better in some situations.


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...