# Model to Model Distance command line

**URL:** <https://discourse.slicer.org/t/model-to-model-distance-command-line/33384>\
**Category:** Support\
**Created:** [December 13, 2023, 9:37pm UTC](https://discourse.slicer.org/t/model-to-model-distance-command-line/33384 "2023-12-13T21:37:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhernandezr](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@jhernandezr](https://discourse.slicer.org/u/jhernandezr)\
**Post date:** [December 13, 2023, 9:37pm UTC](https://discourse.slicer.org/t/model-to-model-distance-command-line/33384/1 "2023-12-13T21:37:47Z")

</div>

Hello there!

Me and my teammates are trying to develop a project where we need to apply the model to model distance module with a command line and we were unable to do so.

Is there anyone that knows how to call that module from the terminal?

Thank you in advance!!

---

<div class="post-metadata">

**Author:** ![rfenioux](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rfenioux/32/70007_2.png) [@rfenioux](https://discourse.slicer.org/u/rfenioux)\
**Post date:** [December 14, 2023, 10:45am UTC](https://discourse.slicer.org/t/model-to-model-distance-command-line/33384/2 "2023-12-14T10:45:15Z")

</div>

What issue are you encountering ?

This would be the command to run the cli from the terminal :

```auto
[path_to_the_cli]/ModelToModelDistance.exe -t TargetModel.vtk -s SourceModel.vtk -o OutputModel.vtk -d signed_closest_point

```

---

<div class="post-metadata">

**Author:** ![RafaelPalomar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rafaelpalomar/32/1436_2.png) [@RafaelPalomar](https://discourse.slicer.org/u/RafaelPalomar)\
**Post date:** [December 14, 2023, 11:04am UTC](https://discourse.slicer.org/t/model-to-model-distance-command-line/33384/3 "2023-12-14T11:04:26Z")

</div>

@jhernandezr the `ModelToModelDistance modle` is a command-line module, which can be called from command line directly as @rfenioux suggests. The module requires though the use of some other libraries that won’t be found unless some Slicer environment variables are set. For me, invoking the module through `Slicer --launch` worked fine:

```sh
./Slicer --launch slicer.org/Extensions-32438/ModelToModelDistance/lib/Slicer-5.6/cli-modules/ModelToModelDistance -s /tmp/m1.vtk -t /tmp/m2.vtk -o /tmp/output.vtk

```
