A 3D Slicer Tutorial

Segmentation and Landmarking Tutorial with 3DSlicer.

Segmentation


  • Load the volume

    • Click on the “DCM” button located on the upper left of the window. In the “Reload & Test” section, select “Import DICOM files”. Choose the files from the directory.
    • On the import DICOM page, choose the volume to import from the “Series” option. Click on “Examine”, then “Load”.
  • Crop the Volume

    • Press the “lens” button located in the upper part of the window. Search for the Module “Crop Volume” and click on “Switch to Module”.
    • In the right menu, under the “IO” section, select the Input Volume. Choose the volume that was just loaded.
    • In the Input ROI section, select “Create a new ROI”.
    • In the Advanced section, enable “Interpolated cropping” and “Isotropic Spacing”.
    • Adjust the box in the different views to select only the volume of interest. Click on “Apply”.
    • The ROI markers are no longer needed. In the Data module, click on the eye button to make the ROI invisible. This will make it easier to work with the next steps.
  • Volume Module

    • In the Display settings, select the CT-bone setup (the first option on the left). The threshold level should be around [W:1000, L:400]. The goal of this step is to increase the contrast between the bones or area of interest and the surrounding tissues.
  • Segment editor module

    • In the Segmentation Module, click on the “Add” button located on the right. Let’s add two segments: one for the bone to segment (e.g., “Humerus”) and the other for everything else (e.g., “Other”). Double click on each segment to rename them.

    • In the options, select “Threshold” and choose a level between [160, 2976]. Click on “Use for Masking”. The optimal level is when the highlighted area represents the bone but not the surrounding tissues. Be careful not to filter out some areas of interest. It’s better to include some surrounding tissue rather than erase areas of interest.

    • Let’s use semi-automatic segmentation. Go to “Grow from Seeds” and click on “Initialize”.

    • Use the brush tool to paint on the single slice views, covering several slices. Spending more time on this part will improve the segmentation. Make sure to use different colors for both segments to help the module differentiate between them.

    • After painting, go back to “Grow from Seeds” and click on “Apply”. Click on “Show 3D” to render the 3D view.

    • Toggle the visibility of the “Other” segment to assess the segmentation.

      • If you’re unsatisfied or if the segmentation has holes, go back to the Threshold and adjust the threshold level. Click on “Use for Masking” again. Go to “Grow from Seeds”, click on “Initialize”, and use the paint option to color the missing parts. Spend more time painting the segments. It’s important to zoom in on the slices and paint the edges of the segment to indicate to what they belong. Click on “Apply” to have an updated version of the segmentation.
    • Once you’re done with the segmentation, if there are any spikes or small islands, use the “Scissor” tool to cut them out. Make sure you have the correct segment selected when cutting out the island.

    • To smooth out the surface, go to the “Smoothing” option and apply a “Median” filter (use a small kernel of 2/3 mm).

    • Additionally, use the “Closing - Fill holes” filter, this time selecting a higher kernel (5/6 mm). To address single spots, go to the “Smoothing brush option” setting, click on “Edit in 3D view” to paint in the 3D view and close the local holes.

    • If satisfied with the segmentation, go on the Data Module, Under the Segmentation hierarchy, right-click on the Bone segment and Export to file. Select the STL version.


Landmarking


  • Once you have obtained a volume, navigate to the “Markup” Module.

  • To create landmarks, click on “Point list” and rename the list accordingly.

  • To adjust the size of the control points, go to Display and modify the “Glyph size” to your preference.

  • If you want to place multiple points in sequence, locate the “Place a Control Point” option (symbolized by a blue arrow and red dot) in the upper part of the window. Click on the arrow and select “Place Multiple Control Points”.

  • To view an overview of the points in the left panel, access the “Control point” setting. From there, you can rename the points or add descriptions.

  • If you wish to place a curve, click on “Curve” and position a few control points. Then, navigate to “Curve Settings” and select the segmented volume under “Constrain Model” (this ensures that the sampled points will be taken on the surface).

  • If you want to resample the curve, go to “Resample” and choose the desired number of resampled points under “Number of resampled points”. The resample setting will distribute equidistant points. Make sure to review each individual curve point to ensure they are in the intended positions. Note that the resample option may alter the landmarks’ positions. (Ensure that the output node setting is set to “Overwrite current node”). If the resampled nodes are not aligned with the surface, access “Curve Settings”, go to “Advanced”, and increase the “Maximum projection distance”. Then, click on “Resample” again.

  • Once you have registered the landmarks, proceed to “Save”. First, save the entire scene in mrb format. To save individual files, follow these steps:

    • Deselect all the items.
    • Select only the items of interest (the segmented volume and landmarks).
    • Choose the destination folder.
    • Select the desired file format (fcsv for landmarks).

The landmarking process is now complete.

If you have both landmarks and curves, the files will be saved separately. However, there is an option to merge them. Download the “Slicer Morph” extension and restart Slicer. Open Slicer and load the fcsv file you want to merge (click on “Data”, search for files, and load it). Use the lens search button to find the “MergeMarkups” extension. Access “Merge Landmarks set”, select the uploaded files, and click on “Merge Highlighted nodes”. A new set of merged landmarks will appear. Save it and use it for the morphing phase.

GPA - PCA

For General Procrustes Analysis (GPA) / Principal Components Analysis (PCA):