# Model-to-model distance module questions

**URL:** <https://discourse.slicer.org/t/model-to-model-distance-module-questions/3481>\
**Category:** Support\
**Created:** [July 13, 2018, 8:01pm UTC](https://discourse.slicer.org/t/model-to-model-distance-module-questions/3481 "2018-07-13T20:01:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![aseman](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@aseman](https://discourse.slicer.org/u/aseman)\
**Post date:** [July 13, 2018, 8:01pm UTC](https://discourse.slicer.org/t/model-to-model-distance-module-questions/3481/1 "2018-07-13T20:01:00Z")

</div>

Operating system:  
Slicer version:4.8.1  
Expected behavior:  
Actual behavior:  
hello 3D slicer experts, I made two models and calculated the distance between them with the model to model distance module , then I ran it’s vtk output file in shapepopulationviewer module.it gives me a colour bar.  
1)what is the scale of this colour bar?  
2) how to calibrate the colour bar, so that the scale of this colour bar shows the actual distance between the points of two models?  
thank you

---

<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 14, 2018, 5:08pm UTC](https://discourse.slicer.org/t/model-to-model-distance-module-questions/3481/2 "2018-07-14T17:08:38Z")

</div>

You can edit color map range and show it in 3D view in Colors module.

---

<div class="post-metadata">

**Author:** ![bjoern](https://avatars.discourse-cdn.com/v4/letter/b/46a35a/32.png) [@bjoern](https://discourse.slicer.org/u/bjoern)\
**Post date:** [June 7, 2019, 8:10pm UTC](https://discourse.slicer.org/t/model-to-model-distance-module-questions/3481/3 "2019-06-07T20:10:30Z")

</div>

Hello everyone,

I am trying to calculate distances between two and also between more than two models in Slicer 4.10.2 .

The segment comparison module does not help me.

When use the Model To Model Distance module, I get an error. Please find the error message below.

Does anyone have an idea, why this doesn’t work?

Or does anyone know a better and working way to calculate distances?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/9/59bf7dcfbdeef77101d4b69c0f559094640ed5d3.png)

Model To Model Distance standard error:

dyld: Library not loaded: /Volumes/Dashboards/Support/qt-everywhere-build-5.10.0/lib/QtSql.framework/Versions/5/QtSql

Referenced from: /Applications/Slicer.app/Contents/Extensions-28257/ModelToModelDistance/lib/Slicer-4.10/cli-modules/libModelToModelDistanceLib.dylib

Reason: image not found

---

<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 7, 2019, 8:26pm UTC](https://discourse.slicer.org/t/model-to-model-distance-module-questions/3481/4 "2019-06-07T20:26:22Z")

</div>

> [@bjoern](#):
>
> The segment comparison module does not help me.

What do you mean? What do you do, what do you expect to happen, and what happens instead?

> [@bjoern](#):
>
> When use the Model To Model Distance module, I get an error. Please find the error message below.

I’ve just tried it and it works fine on Windows. Try uninstalling and installing the extension again (make sure to wait for the “Restart” button to appear, then press it to restart Slicer).

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [June 13, 2019, 9:43pm UTC](https://discourse.slicer.org/t/model-to-model-distance-module-questions/3481/5 "2019-06-13T21:43:48Z")

</div>

It does not work on mac - the error is below.

cc:@fbudin69500

```auto
Model To Model Distance standard error:

dyld: Library not loaded: /Volumes/Dashboards/Support/qt-everywhere-build-5.10.0/lib/QtSql.framework/Versions/5/QtSql
  Referenced from: /Applications/Slicer-4.10.2.app/Contents/Extensions-28257/ModelToModelDistance/lib/Slicer-4.10/cli-modules/libModelToModelDistanceLib.dylib
  Reason: image not found

```

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [June 18, 2019, 6:56pm UTC](https://discourse.slicer.org/t/model-to-model-distance-module-questions/3481/6 "2019-06-18T18:56:42Z")

</div>

I was going to submit an issue about this so it is documented somewhere other than this forum, but then I got confused about the source code location.

ExtensionIndex points to the fork of the code under @jcfr account: [https://github.com/Slicer/ExtensionsIndex/blob/master/ModelToModelDistance.s4ext#L9](https://github.com/Slicer/ExtensionsIndex/blob/master/ModelToModelDistance.s4ext#L9)

However, the @jcfr version does not allow submission of issues: [https://github.com/jcfr/3dmetrictools](https://github.com/jcfr/3dmetrictools). Also, the one from which @jcfr forked the repo is 18 commits behind the one under GitHub NIRALUser: [https://github.com/NIRALUser/3DMetricTools](https://github.com/NIRALUser/3DMetricTools).

@jcfr do you know what is going on with this extension?

It sounds like a basic functionality, but for clinical researchers this functionality can actually be quite useful (if it works).

---

<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 18, 2019, 7:09pm UTC](https://discourse.slicer.org/t/model-to-model-distance-module-questions/3481/7 "2019-06-18T19:09:29Z")

</div>

We need to fix the module (or add another one that works) but in the meantime, you can get model to model distance by typing 5 lines of code:

```python
# Get two model nodes that we want to compute distances of
m1=getNode('Segment_1')
m2=getNode('Segment_2')

# Compute distance
distanceFilter = vtk.vtkDistancePolyDataFilter()
distanceFilter.SetInputData(0, m1.GetPolyData())
distanceFilter.SetInputData(1, m2.GetPolyData())
distanceFilter.Update()
m1.SetAndObservePolyData(distanceFilter.GetOutput())

# Use the computed distance to color the node
m1.GetDisplayNode().SetActiveScalarName('Distance')
m1.GetDisplayNode().SetScalarVisibility(True)

```

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [June 18, 2019, 7:30pm UTC](https://discourse.slicer.org/t/model-to-model-distance-module-questions/3481/8 "2019-06-18T19:30:28Z")

</div>

Hope this helps @bjoern

---

<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:05am UTC](https://discourse.slicer.org/t/model-to-model-distance-module-questions/3481/9 "2021-06-27T03:05:27Z")

</div>

5 posts were merged into an existing topic: [Combining Module Functionalities](https://discourse.slicer.org/t/combining-module-functionalities/18347/2)
