Introduction: How to Easily and Automatically Convert a CT Scan (DICOM Data) Into a 3D Printable Medical Model (STL File) in Minutes With Free Software and Online Services
In this Instructable you will learn how to easily convert a medical imaging CT scan in DICOM file format to a 3D printable STL model very quickly and easily using free software and online services. The method described here works on any major operating system (Windows, Macintosh, Linux) and requires no prior knowledge of medical imaging or CAD software. All data and software to follow along are provided, including a test CT scan.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Download the Software
The first software program we will use is 3D Slicer. 3D Slicer is a free medical imaging program available on Windows, Macintosh, and Linux, so no matter what operating system you are using you should be fine. Go to the slicer.org webpage and click on the Download button. Choose the latest stable release for your operating system and install the software once it is downloaded.
We will also be using Autodesk Meshmixer, a free mesh editing and modeling software program that we will use at the end of this tutorial in final preparation for 3D printing. Let’s download it now. Go to meshmixer.com and click the Download button on the upper right to download the latest version for your operating system.
Step 2: Download the Medical Scan Data
You will need a medical CT scan to follow along for this tutorial, and the one we are using here is available for free download at this link. You will need to register for free account at embodi3d.com to download the file. We will also use the automated medical scan conversion service on this website later in this tutorial which also requires you to have an account, so go ahead and register now if you haven't already. Download the DICOM CT scan data here and unzip the file. You should have a folder with a name composed of lots of numbers, “184.108.40.206.4.1.14519…” etc. That folder contains the DICOM files.
Alternatively, you can use your own CT scan if you’ve ever had one performed for you. Most hospitals will give you a CD or DVD that contains your CT scan in the radiology or medical imaging department. Some may ask for a small fee to cover the expense of the disk, but many will give you the disk for free once you fill out some paperwork. The picture below shows the image management desk at my hospital where I can pick of a disk with my CT scans on it. If you are using your own scan for this tutorial, make sure you are using a CT scan, and NOT an MRI or ultrasound. At this time the automatic conversion service only works with CT scans.
Step 3: Copy the DICOM Data Into 3D Slicer (Slicer Step 1 of 3)
Once we have our scan data and software, our next step is to convert the scan, which is in DICOM format, to an NRRD file, which is the file format the automated conversion service accepts. The NRRD format is ANONYMIZED, so it guarantees that confidential patient information isn’t transmitted over the Internet. Just to be clear, the CT scan we are using for this tutorial is already anonymized, so you needle worry about any privacy issues.
A variety of software programs will allow us to save a file in NRRD format, but today we will be using 3D Slicer. We will simply open the study in 3D Slicer and without modification save it in the NRRD format. The process takes less than a minute. Open 3D Slicer and open the folder that contains your DICOM files. The DICOM file format consists of a folder that has many subfolders and files within it. Drag the entire folder onto the 3D Slicer window and drop it onto the 3D Slicer window, as shown in the picture.
3D Slicer will ask you if you want to load the images into the database. Click Yes. It will also ask you if it is OK to copy the images into the database. Click Copy. You may have to wait a minute while the study copies. After a short wait you should get a window that says the study was added successfully as shown below. Click OK.
Step 4: Open the Study in the Active Scene (Slicer Step 2 of 3)
Now that the study is copied into 3D Slicer, we want to load it into the active scene. You should have a window showing called DICOM Browser. If you don’t see that click on the button on the main welcome page that says “Load DICOM Data,” and that should open the DICOM Browser. From the DICOM Browser select the series that was just copied into 3D Slicer and click on the Load button, as shown in the picture.
Step 5: Save the Study in NRRD Format (Slicer Step 3 of 3)
The CT scan should now be open in the active scene. Now we simply need to save this and choose a different file format. Click on the save button on the upper left side of the 3D Slicer window.
A new window that gives you saving options will now be shown. Uncheck all the rows except for the one that has the file that ends in “.nrrd” and make sure that the file format shows “NRRD (.nrrd).” Make sure that this row is checked. Also, make sure that you specify an appropriate folder to save your NRRD file in. When you are satisfied with the choices click on the Save button. The study will now be saved in the NRRD file format into the directory you chose.
I would like to note that 3D Slicer is capable of generating STL files by itself, using a variety of modules within the software. I’ve used this functionality for years and there are many online tutorials, but find the process is difficult to learn and the resulting STL files are of poor quality, having many defects in the mesh that require time-consuming manual repair. Automatically converting the scan data into a 3D printable model using the online embodi3D service is much faster and easier, and generally produces higher-quality models with less effort as long as the conversion task is straightforward, such as creating bones. For customized or complex tasks, manual conversion is probably better. If you want to learn more about the benefits of automated conversion vs manual conversion, here is a good tutorial.
Step 6: Upload the NRRD File to the Free Online Conversion Service
Go to embodi3d.com and click on the Launch App under the democratiz3D menu. Democratiz3D is the free service that will convert the scan into a 3D printable model file. You need to be logged into your free account in order for the service to work, so double check that if you have any problems. A window will pop up asking you to drag and drop your files. Drag the NRRD file that you created onto this window. Be sure that the file you are dragging is an NRRD file, as this file format is required.
Step 7: Complete File Processing Parameters, Step 1 of 2
While your NRRD file is uploading, fill in some basic information about it. Give your NRRD file a title, a short description, any tags that you wish to assign to it, and specify if you want the file to be private or shared. Feel free to share your file and make it available for download by others if you wish, but if you do, specify the type of shared file (free versus paid) and an appropriate license type.
When you have finished with this section of the form, scroll down to the next part, which details how you would like your NRRD file to be processed.
Step 8: Complete File Processing Parameters, Step 2 of 2
The next section of the upload form specifies how to process the NRRD file into a 3D printable model file. In the democratize3D processing section, push the slider to the right so it turns green, thus turning on processing for your NRRD file. Choose the operation to perform, in this case CT NRRD to Bone STL. This will convert a CT scan in NRRD format to an STL file of the bones. Other operations are available, such as creating 3D printable muscle or skin models.
Your uploaded NRRD file will now be automatically converted into a 3D printable STL file of the bones, muscles, or skin, depending on what operation you selected. In anywhere between 5 and 15 minutes you should receive an email saying your 3D printable model is completed and ready for download.
Please note that it is possible for you to process multiple models simultaneously. If you have many models to make, this service really saves time because you can upload multiple NRRD files sequentially and they will process in the background. I’ve personally uploaded 8 NRRD file sequentially and within one hour all 8 models were completed. This is much faster than doing the job manually using desktop software.
Step 9: Download the Medical Model STL File
Within a short time you should receive an email saying that your file has been processed and is ready for download. There will be a link in the email that will bring you to your file download page. Alternatively if you are already on the embodi3D website you can click on the My Files menu item underneath your username. There will be several thumbnails that have been rendered from your medical model STL file. Rendering takes about 5 to 6 minutes so if you go to the download page right after processing is completed, you may not see the renders. Don’t worry, they’ll show up eventually. If you are happy with the overall appearance of the file, click the Download this file button.
To illustrate the different operations, I processed my NRRD file into a bone STL model and also into a muscle STL model, which are both shown in the pictures above. We will look at them both more closely in the next step.
Step 10: Check the Model for Errors With Meshmixer
Next were going to open our files in Meshmixer, check them for errors, and perform a few touchups prior to 3D printing. Open Meshmixer, click on Import, and select your downloaded STL file. You will note that the bone model has parts of the table the patient was laying on included. We can remove these unwanted table parts easily.
Choose the Select tool from the Meshmixer left side tools panel. Put the brush over a portion of the model that you wish to keep and select it with the left mouse button. The selected portion of the model will turn orange as shown in the first picture above.
Next, we are going to expand the selection to encompass everything that is physically connected to that initial selected spot. Hit the "E" key and the entire bone portion of the model should turn orange, as shown in the second picture. If this doesn’t work, an alternative way to do this is to use the Select-> Modify-> Expand to Connected menu item.
Finally, invert the selection by using the "I" key. Alternatively, you can choose Select->Modify-> Invert. The orange bones will now turn silver, and the unwanted table will turn orange. We can now delete the unwanted table parts by hitting the "X" key.
We can do further mesh cleanup using the Inspector tool. Click on the Analysis button on the left nav panel and choose Inspector. If there are any errors or defects in the mesh, Meshmixer will highlight them with colored labels. The Auto Repair All button will attempt to automatically fix these errors. In this case, however, the STL that was generated from the online service is error-free, and no further error correction is required.
With the unwanted table parts now removed, we are ready to export the cleaned and corrected STL file. Export the file by clicking on the File menu -> Export. Choose a name for your file and make sure you are saving in the STL file format.
Step 11: Final Thoughts
Now that you have your clean, error-free STL file you are ready for 3D printing on almost any 3D printer. The detail and accuracy of files produced with this method is excellent, and the use of a scalable and free online service makes creating multiple files quite efficient. The different automated operations you can use is interesting. For example, using the NRRD file derived from a CT scan, I created the bone model on the left and muscle model on the right as shown in the picture above.
I hope you found this Instructable helpful. Please share what you have created in the comments. Good luck with your medical 3D printing adventures!