# How to analyze the thickness of the model

**URL:** <https://discourse.slicer.org/t/how-to-analyze-the-thickness-of-the-model/2735>\
**Category:** Support\
**Created:** [April 30, 2018, 1:56pm UTC](https://discourse.slicer.org/t/how-to-analyze-the-thickness-of-the-model/2735 "2018-04-30T13:56:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![timeanddoctor](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/timeanddoctor/32/5839_2.png) [@timeanddoctor](https://discourse.slicer.org/u/timeanddoctor)\
**Post date:** [April 30, 2018, 1:56pm UTC](https://discourse.slicer.org/t/how-to-analyze-the-thickness-of-the-model/2735/1 "2018-04-30T13:56:06Z")

</div>

Can I analyze the thickness of a stl model, and then get a color map.  
The distance between the two sides of an object.

 ![2018-04-30_215013](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/3/f30db8dfcca7916c3e14fd4f2352892d08d820cd.jpeg)

---

<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:** [May 1, 2018, 4:04pm UTC](https://discourse.slicer.org/t/how-to-analyze-the-thickness-of-the-model/2735/2 "2018-05-01T16:04:55Z")

</div>

“Thickness” is not a very well defined term for models (surface meshes), but for shell-like meshes it is probably not too difficult to estimate it robustly and accurately.

Potential approaches:

A. Extract medial surface and estimate thickness as 2x of distance from medial surface. There are various ways of computing these in Slicer. One possible workflow:

- Compute medial surface using **Simple Filters module - BinaryThinningImageFilter**.
- Compute distance map using **Simple Filters module - DanielssonDistanceMapImageFilter**. Input is binary: Yes; Use image spacing: Yes.
- Copy distance values from the distance map to model node using **Probe volume with model** module.

Critical part is the medial surface extraction. If you find that it is not accurate enough then you may to use smaller voxel sizes for the model-\>labelmap conversion, or use a different medial surface extraction method (for example, medial surface extractor in VMTK or [PowerCrust algorithm](https://github.com/timhutton/vtkpowercrust)).

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/3/2352e218fd3bb74629d3c8fd3d10969880c1f06e.png)

B. Implement a custom algorithm in C++. Something like this should be very easy to implement if you are already familiar with C++ programming using VTK: [http://mmmanual.com/thickness/](http://mmmanual.com/thickness/).

---

<div class="post-metadata">

**Author:** ![ALoopingIcon](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aloopingicon/32/7215_2.png) [@ALoopingIcon](https://discourse.slicer.org/u/ALoopingIcon)\
**Post date:** [June 25, 2020, 7:52am UTC](https://discourse.slicer.org/t/how-to-analyze-the-thickness-of-the-model/2735/3 "2020-06-25T07:52:48Z")

</div>

Another possibility is to use MeshLab to compute the Shape Diameter Function (SDF) that is a good generic definition of the _thickness_ of a mesh.

> <https://stackoverflow.com/questions/61787028/how-to-calculate-the-thickness-of-a-mesh/62198280#62198280>

---

<div class="post-metadata">

**Author:** ![TNgyn](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tngyn/32/68676_2.png) [@TNgyn](https://discourse.slicer.org/u/TNgyn)\
**Post date:** [December 12, 2023, 10:07am UTC](https://discourse.slicer.org/t/how-to-analyze-the-thickness-of-the-model/2735/4 "2023-12-12T10:07:27Z")

</div>

Hello,

I’m trying to analyze the thickness of a brain structure which is already segmented.  
Can you maybe explain the steps of option A in more detail?  
For example: What is the input volume and input model of the Probe volume with model module?
