# Model to Model Distance Parameters

**URL:** <https://discourse.slicer.org/t/model-to-model-distance-parameters/6543>\
**Category:** SlicerSALT\
**Created:** [April 19, 2019, 4:20pm UTC](https://discourse.slicer.org/t/model-to-model-distance-parameters/6543 "2019-04-19T16:20:06Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevenagl12](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/stevenagl12/32/3391_2.png) [@stevenagl12](https://discourse.slicer.org/u/stevenagl12)\
**Post date:** [April 19, 2019, 4:20pm UTC](https://discourse.slicer.org/t/model-to-model-distance-parameters/6543/1 "2019-04-19T16:20:06Z")

</div>

What are the differences between the parameters in model to model distance? By that I mean, what’s the differences between absolute closest point, signed closest point, and closest point? How do these differences effect the shape model created?

---

<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:** [April 28, 2019, 10:56pm UTC](https://discourse.slicer.org/t/model-to-model-distance-parameters/6543/2 "2019-04-28T22:56:51Z")

</div>

Since nobody seems to know this off hand, the best would be if you could have a look at the source code and get this information from there. We would appreciate if you shared what you’ve found so that we can add it to the module documentation.

@bpaniagua

---

<div class="post-metadata">

**Author:** ![ljod](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ljod/32/652_2.png) [@ljod](https://discourse.slicer.org/u/ljod)\
**Post date:** [April 29, 2019, 12:43am UTC](https://discourse.slicer.org/t/model-to-model-distance-parameters/6543/3 "2019-04-29T00:43:52Z")

</div>

I had a student use this module in the past, so I know that signed distance is negative when one model is inside the other. I don’t know about the closest points computation. The module is based directly on a vtk filter according to this docs page:  
[https://www.slicer.org/wiki/Documentation/Nightly/Extensions/ModelToModelDistance](https://www.slicer.org/wiki/Documentation/Nightly/Extensions/ModelToModelDistance)

VTK is well documented so you can read the docs for the filter to see what it does.  
[https://vtk.org/doc/nightly/html/classvtkDistancePolyDataFilter.html](https://vtk.org/doc/nightly/html/classvtkDistancePolyDataFilter.html)

---

<div class="post-metadata">

**Author:** ![styner](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/styner/32/1024_2.png) [@styner](https://discourse.slicer.org/u/styner)\
**Post date:** [July 6, 2020, 3:49pm UTC](https://discourse.slicer.org/t/model-to-model-distance-parameters/6543/4 "2020-07-06T15:49:00Z")

</div>

A bit late reply:

- closest point correspondence does not assume that there is already an established correspondence between the meshes, but generates the correspondence on the fly (matching points as corresponding if the distance is closest across all points).
- signed means that the sign of the distance (negative vs positive) depends on whether one surface is inside the other (like Lauren mentioned). This is computed relative to the target model, i.e. if the source surface at a given point is inside the target surface then that distance will be negative
- corresponding\_point\_to\_point: this means that there is already an established, index-wise correspondence (e.g. by using SlicerSALT to generate corresponding surfaces) and the distance is computed between points at the same index in each mesh.

---

<div class="post-metadata">

**Author:** ![sfglio](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sfglio/32/3346_2.png) [@sfglio](https://discourse.slicer.org/u/sfglio)\
**Post date:** [January 21, 2021, 9:21pm UTC](https://discourse.slicer.org/t/model-to-model-distance-parameters/6543/5 "2021-01-21T21:21:20Z")

</div>

I created two models from the sinus of two different CT scans which have been registered in the first step.

Does “model-to-model distance” allow me to create a distance-map (e.g. [Distance Map - Blender Market](https://www.blendermarket.com/products/distance-map)) in order to tell in which directions my models expanded/diminished??

Actually I am looking for a way to create a distance map of two models  
or in other words: I would like to get the distance numbers from the colors of the “shape population viewer”.

---

<div class="post-metadata">

**Author:** ![seanchoi0519](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/seanchoi0519/32/10354_2.png) [@seanchoi0519](https://discourse.slicer.org/u/seanchoi0519)\
**Post date:** [June 26, 2021, 6:51am UTC](https://discourse.slicer.org/t/model-to-model-distance-parameters/6543/7 "2021-06-26T06:51:51Z")

</div>

hello @sfglio just wondering if you were successful in achieving this? I’d like to find a way to tell in which directions my models need expanded/diminished, and if possible, by how much (mm) through the color map. let me know

---

<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:** [June 27, 2021, 3:00am UTC](https://discourse.slicer.org/t/model-to-model-distance-parameters/6543/8 "2021-06-27T03:00:12Z")

</div>

The question was posted in [this topic](https://discourse.slicer.org/t/model-to-model-distance-module-questions/3481/13) as well and it is currently being discussed there.

---

<div class="post-metadata">

**Author:** ![sfglio](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sfglio/32/3346_2.png) [@sfglio](https://discourse.slicer.org/u/sfglio)\
**Post date:** [July 2, 2021, 1:30pm UTC](https://discourse.slicer.org/t/model-to-model-distance-parameters/6543/9 "2021-07-02T13:30:31Z")

</div>

@seanchoi0519 The vtk output file allows nicely to visualize (i.e. color map) the difference between the two models. however I have not found yet a practical approach to quantify the difference in directions between the two models. So I can just tell by judging visually that e.g. the difference between two models was mainly on the inferior side…

---

<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:** [July 2, 2021, 6:31pm UTC](https://discourse.slicer.org/t/model-to-model-distance-parameters/6543/10 "2021-07-02T18:31:19Z")

</div>

You can use Dynamic Modeler module to cut out parts of a model (by drawing a curve on it or defining a ROI box, or cut it with planes), then get the scalar values of this clipped model as a numpy array and compute any statistics you need (average/min/max distance, histogram of thr distance distribution, etc).

---

<div class="post-metadata">

**Author:** ![Daniel1](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@Daniel1](https://discourse.slicer.org/u/Daniel1)\
**Post date:** [September 26, 2021, 12:28pm UTC](https://discourse.slicer.org/t/model-to-model-distance-parameters/6543/11 "2021-09-26T12:28:59Z")

</div>

> [@styner](#):
>
> by using SlicerSALT to generate corresponding surfaces

Thank you for that - makes sense. How do we use SlicerSALT to generate corresponding surfaces in two models?

---

<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, 2021, 1:40pm UTC](https://discourse.slicer.org/t/model-to-model-distance-parameters/6543/12 "2021-09-28T13:40:17Z")

</div>

See SlicerSALT tutorials [here](https://salt.slicer.org/documentation/#tutorials). If you have any question then create a new topic for it.

---

<div class="post-metadata">

**Author:** ![KAMONCHAT\_APIVANICHK](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kamonchat_apivanichk/32/10368_2.png) [@KAMONCHAT\_APIVANICHK](https://discourse.slicer.org/u/KAMONCHAT_APIVANICHK)\
**Post date:** [August 19, 2022, 12:47pm UTC](https://discourse.slicer.org/t/model-to-model-distance-parameters/6543/13 "2022-08-19T12:47:42Z")

</div>

Do the distance of ModetoModelDistance mean as same as Hausdorff distance? Can I use this module for comparing mask model and segmented model? Is its output reliable?
