# How to get the center coordinates of Slice intersections

**URL:** <https://discourse.slicer.org/t/how-to-get-the-center-coordinates-of-slice-intersections/25624>\
**Category:** Development\
**Created:** [October 10, 2022, 7:58am UTC](https://discourse.slicer.org/t/how-to-get-the-center-coordinates-of-slice-intersections/25624 "2022-10-10T07:58:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![miniminic](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/miniminic/32/16647_2.png) [@miniminic](https://discourse.slicer.org/u/miniminic)\
**Post date:** [October 10, 2022, 7:58am UTC](https://discourse.slicer.org/t/how-to-get-the-center-coordinates-of-slice-intersections/25624/1 "2022-10-10T07:58:38Z")

</div>

![屏幕截图 2022-10-10 155740](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/0/003519931b3c86ae57839fbdb6ef6acede3d3ec7.jpeg)

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [October 10, 2022, 11:29am UTC](https://discourse.slicer.org/t/how-to-get-the-center-coordinates-of-slice-intersections/25624/2 "2022-10-10T11:29:21Z")

</div>

Take a look at the Slicer script repository linked below to see if this is what you are looking for

[https://slicer.readthedocs.io/en/latest/developer\_guide/script\_repository.html#get-current-mouse-coordinates-in-a-slice-view](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#get-current-mouse-coordinates-in-a-slice-view)

---

<div class="post-metadata">

**Author:** ![miniminic](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/miniminic/32/16647_2.png) [@miniminic](https://discourse.slicer.org/u/miniminic)\
**Post date:** [October 11, 2022, 4:04am UTC](https://discourse.slicer.org/t/how-to-get-the-center-coordinates-of-slice-intersections/25624/3 "2022-10-11T04:04:09Z")

</div>

I figured out how to get the center position of crosshair, but I didn’t figure out how to get the center position of Slice intersections. The feature I want to implement now is that when Slice intersections move,crosshair moves with them and their center points are always in the same place. When Slice intersections move as a whole, I can easily move them to the mouse position. The problem now is that I can’t get the central position of Slice intersections when the individual intersectingSliceNode moves. Thanks

---

<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:** [October 19, 2022, 6:12am UTC](https://discourse.slicer.org/t/how-to-get-the-center-coordinates-of-slice-intersections/25624/4 "2022-10-19T06:12:27Z")

</div>

In general slices do not intersect each other in a single point (there may be 0, 1, or several intersection points), so in general I would not recommend to depend on it.

However, it is quite common to have 3 non-parallel slice planes and for this case there is a single intersection point. You can find the computation for example in the [ValveView module in SlicerHeart extension](https://github.com/SlicerHeart/SlicerHeart/blob/master/ValveView/ValveView.py#L213).

---

<div class="post-metadata">

**Author:** ![miniminic](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/miniminic/32/16647_2.png) [@miniminic](https://discourse.slicer.org/u/miniminic)\
**Post date:** [October 19, 2022, 6:14am UTC](https://discourse.slicer.org/t/how-to-get-the-center-coordinates-of-slice-intersections/25624/5 "2022-10-19T06:14:43Z")

</div>

Thanks. I’ll give it a try
