# How to get the triangle ID on 3D view (mesh) from mouse coordinates in slice view

**URL:** https://discourse.slicer.org/t/how-to-get-the-triangle-id-on-3d-view-mesh-from-mouse-coordinates-in-slice-view/11883
**Category:** Development
**Created:** [June 5, 2020, 4:24pm UTC](https://discourse.slicer.org/t/how-to-get-the-triangle-id-on-3d-view-mesh-from-mouse-coordinates-in-slice-view/11883 "2020-06-05T16:24:25Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![loubna](https://avatars.discourse-cdn.com/v4/letter/l/cab0a1/32.png) [@loubna](https://discourse.slicer.org/u/loubna)
#### Post date: [June 5, 2020, 4:24pm UTC](https://discourse.slicer.org/t/how-to-get-the-triangle-id-on-3d-view-mesh-from-mouse-coordinates-in-slice-view/11883/1 "2020-06-05T16:24:25Z")

</div>

Hi;

I want to know if is it possible to obtain the triangle ID (the closest one) when I click on a segmented area in 2D slice view? Can you give me some examples or classes to that in c++.

thank’s in advance

---

<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 5, 2020, 4:30pm UTC](https://discourse.slicer.org/t/how-to-get-the-triangle-id-on-3d-view-mesh-from-mouse-coordinates-in-slice-view/11883/2 "2020-06-05T16:30:34Z")

</div>

You can find a complete example in the script repository: [https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Select\_cells\_of\_a\_model\_using\_markups\_fiducial\_points](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Select_cells_of_a_model_using_markups_fiducial_points)
