# How to retrieve modeltomodel values by coordinates?

**URL:** https://discourse.slicer.org/t/how-to-retrieve-modeltomodel-values-by-coordinates/23431
**Category:** Development
**Created:** [May 14, 2022, 7:36pm UTC](https://discourse.slicer.org/t/how-to-retrieve-modeltomodel-values-by-coordinates/23431 "2022-05-14T19:36:00Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![K\_Tilman](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/k_tilman/32/15303_2.png) [@K\_Tilman](https://discourse.slicer.org/u/K_Tilman)
#### Post date: [May 14, 2022, 7:36pm UTC](https://discourse.slicer.org/t/how-to-retrieve-modeltomodel-values-by-coordinates/23431/1 "2022-05-14T19:36:00Z")

</div>

Hey there!

Currently I am using the ModelToModelDistance module on two models, which outputs a third model which I have been analyzing using the ShapePopulationView module.

This colormap is somewhat useful in itself but I would like to look at the specific values that the model contains. I have used the function arrayFromModelPointData() to retrieve the distances however this gives me no indication to which points on the model these distances belong.

Is there maybe a way to click on the model to then retrieve the distances of the colormap for that specific point? I tried doing it using markups but I am not sure how to map the control point to a point on the node (retrieved using getNode) of the color map.

---

<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 14, 2022, 9:28pm UTC](https://discourse.slicer.org/t/how-to-retrieve-modeltomodel-values-by-coordinates/23431/2 "2022-05-14T21:28:33Z")

</div>

You can get the ID of the closest point to a coordinate using VTK locator classes. See a [complete example in the script repository](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#get-scalar-values-at-surface-of-a-model).

---

<div class="post-metadata">

### Author: ![K\_Tilman](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/k_tilman/32/15303_2.png) [@K\_Tilman](https://discourse.slicer.org/u/K_Tilman)
#### Post date: [May 25, 2022, 8:43am UTC](https://discourse.slicer.org/t/how-to-retrieve-modeltomodel-values-by-coordinates/23431/3 "2022-05-25T08:43:42Z")

</div>

Thank you for your answer!  
I managed to write a script to extract the data from the model to model distance extensions by placing markup nodes on the model. I still can’t manage to figure out how to place markup nodes on the colormap in ShapePopulationViewer. Can you help me with that? 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: [May 25, 2022, 5:30pm UTC](https://discourse.slicer.org/t/how-to-retrieve-modeltomodel-values-by-coordinates/23431/4 "2022-05-25T17:30:16Z")

</div>

I don’t think ShapePopulationViewer supports any kind of markups. Instead, I would recommend to enable coloring by scalars using Models module → Scalars section.
