3D SLicer
Generating Scientific 3D Models
By Alejandro Romero
Overview
3D Slicer is an open-source program that allows for the three-dimensional visualization and processing of CT scans. The steps to go from a raw CT image sequence to a segmented 3D mesh are outlined below.
Preparing the Image Data
Total time: ~10 min
Morphosource is a great place to find sequences of CT scan images if you do not already have a dataset.
To import your images into 3D Slicer, you will need an .nrrd file. If you do not already have an existing .nrrd file, you can generate one using Fiji, a free image processing package available here: https://fiji.sc/
Generating an NRRD File
Open Fiji and go into: File → Import, and select Image Sequence
Select the file that contains your desired image sequence.
If your file is large, you can increase the increment size
Here, you can also determine which portions of the sequence you wish to export, and also change parameters such scaling.
To save your .nrrd, go to: File → Save As→ Nrrd
You now have a 3D Slicer-compatible NRRD image sequence!
Generating 3D Model
Using 3D Slicer
In 3D Slicer, load in the .nrrd file
File → Add Data → Choose File(s) to Add → select the .nrrd file
Click OK to load in the images
IMPORTANT: 3D Slicer will by default set Image Spacing dimensions to 1mm x 1mm x 1mm. Select the Volumes module in the drop-down menu in the top left.
4. In Volumes, set Image Spacing to the dimensions of the original image sequence, which can usually be found in a metadata file. If using a scan from MorphoSource, the dimensions are listed in the specimen scan description.
5. You should now have a workspace that looks like this:
You can adjust your workspace in: View → Layout (Conventional is the layout option used in the visuals provided here).
Next, let’s generate a 3D mesh:
Navigate to the Segment Editor module in the modules drop-down menu and click Add.
Double-click on the segment name to rename it (e.g. “catfish_skull”) or change other properties such as color.
In the Effects menu, you can use various tools to select a region of interest (ROI) for your mesh. It is easiest to select Threshold to generate a desired ROI.
Adjust the Threshold slider to ensure that all desired bone areas are highlighted. You may also manually adjust the Threshold Range using the arrow keys.
Click Apply to apply your threshold settings.
You can click on the Show 3D icon to see your current 3D mesh.
If any adjustments have to be made, the Scissors tool is handy in removing unwanted artifacts. It is also useful for creating different meshes in 3D Slicer. To do so, simply Add a new segment and repeat these steps.
NOTE: The Scissors tool applies ROI changes for the entire image sequence, not just the current frame. To eliminate an undesired portion of a single frame, the Erase tool can be used either in the 2D image window or in the 3D view window.
To export your mesh, click on the Segmentations icon.
Scroll down to the Export/Import models and labelmaps section
Make sure the Output Type is set to Models
Click Export
Click Save at the top left of 3D Slicer
In the popup window, uncheck all boxes on the left except for your desired segment (e.g. “catfish_skull.vtk”)
IMPORTANT: Change the file name and file directory as desired, but make sure to set the file format to OBJ (.obj)
Click Save when finished.
5. You now have a segmented 3D mesh! However, final mesh changes (e.g. polygon reduction, mesh cleaning, etc.) can be done in MeshLab.