# detailed threshold and smoothing documentation

**URL:** https://discourse.slicer.org/t/detailed-threshold-and-smoothing-documentation/8602
**Category:** Support
**Created:** [September 27, 2019, 10:21pm UTC](https://discourse.slicer.org/t/detailed-threshold-and-smoothing-documentation/8602 "2019-09-27T22:21:06Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![DaveB](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@DaveB](https://discourse.slicer.org/u/DaveB)
#### Post date: [September 27, 2019, 10:21pm UTC](https://discourse.slicer.org/t/detailed-threshold-and-smoothing-documentation/8602/1 "2019-09-27T22:21:06Z")

</div>

Hi,  
I’m new to Slicer. I’m trying to create a bone model of a lumbar spine from CT images (.6 axial images) to 3d print it. I’ve gone through all the related tutorials I could find. **Is there detailed documentation on the Automatic Threshold and Smoothing options? I can’t find that anywhere.** Btw, I’m mostly using Segment Editor.

I’m trying to create a very accurate 3d lumbar model to show to a surgeon. I’ve tried dozens of threshold ranges and smoothing combinations. I now have a 3d printed model that’s somewhat realistic, but there’s too much noise (extrusions) and too much smoothing. For example, many facet joints get filled in no matter which thresholds & smoothing parameters I use.

If I use higher thresholds, then bone disappears. If I use lower thresholds to get more bone, then the facet joints get filled in regardless of the smoothing kernel size I use.

It would be helpful to have more detailed documentation on these features. Please point me to that documentation if it exists.

Thanks, dave

---

<div class="post-metadata">

### Author: ![Amine](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/amine/32/4844_2.png) [@Amine](https://discourse.slicer.org/u/Amine)
#### Post date: [September 27, 2019, 10:51pm UTC](https://discourse.slicer.org/t/detailed-threshold-and-smoothing-documentation/8602/2 "2019-09-27T22:51:25Z")

</div>

Hi, there is no automatic threshold and segmentation that i know about, though you could use a script like [this one](https://gist.github.com/lassoan/5ad51c89521d3cd9c5faf65767506b37) to get a fast result, but you might have better results doing it manually,  
try cropping your volume (crop volume module) with a spacing scale of 0.6x before starting your segmentation, then use the module “Gradient anisotropic diffusion” to filter some of the noise.  
after applying your threshold do all the manual finishing you can before using smoothing (and use the smallest kernel size to keep detail).  
As for the facet joints it’s almost impossible to get them separated automatically because they are not well visible on the CT slices, they need manual deletion of a vertebra then the use of boolean operations to keep the other (or to use masking operations to draw individual vertebras from the original segment), you might want to check [this post](https://discourse.slicer.org/t/cut-3d-surface-from-the-whole-with-accuracy/8432) for the separation part.

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [September 28, 2019, 7:40pm UTC](https://discourse.slicer.org/t/detailed-threshold-and-smoothing-documentation/8602/3 "2019-09-28T19:40:32Z")

</div>

> [@DaveB](#):
>
> **Is there detailed documentation on the Automatic Threshold and Smoothing options? I can’t find that anywhere.** Btw, I’m mostly using Segment Editor.

We use ITK’s automatic threshold computation algorithms options. Their documentation is available [here](https://itk.org/Doxygen/html/group__ITKThresholding.html).

Smoothing pipeline consists of a number of VTK filters. See summary [here](https://discourse.slicer.org/t/segmentation-algorithm-used-in-3d-slicer/7420/3) and source code [here](https://github.com/Slicer/Slicer/blob/master/Libs/vtkSegmentationCore/vtkBinaryLabelmapToClosedSurfaceConversionRule.cxx).

> [@DaveB](#):
>
> If I use higher thresholds, then bone disappears. If I use lower thresholds to get more bone, then the facet joints get filled in regardless of the smoothing kernel size I use.

Vertebrae are very easy to separate on high-resolution CT scans, but on typical patient scans have much lower resolution.

@amine gave an excellent answer on how to approach this. In addition to his suggestions, you may also try masked grow from seeds. See [this segmentation recipe](https://lassoan.github.io/SlicerSegmentationRecipes/AortaMaskedGrowFromSeeds/) for details and this short demo video:

[![](https://img.youtube.com/vi/8Nbi1Co2rhY/maxresdefault.jpg "Femur segmentation using masked region growing in 3D Slicer") ](https://www.youtube.com/watch?v=8Nbi1Co2rhY)
