# Artery-tumor intersection points

**URL:** <https://discourse.slicer.org/t/artery-tumor-intersection-points/23070>\
**Category:** Support\
**Created:** [April 21, 2022, 9:01am UTC](https://discourse.slicer.org/t/artery-tumor-intersection-points/23070 "2022-04-21T09:01:52Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![gfurnari](https://avatars.discourse-cdn.com/v4/letter/g/a4c791/32.png) [@gfurnari](https://discourse.slicer.org/u/gfurnari)\
**Post date:** [April 21, 2022, 9:01am UTC](https://discourse.slicer.org/t/artery-tumor-intersection-points/23070/1 "2022-04-21T09:01:52Z")

</div>

Hi everyone,  
i’m working on segmentation of kidney tumor and artery that feeds the tumor. I used logical operator intersect to get the parts where artery and tumor touch each other. I’d like to know if it’s possible to get ras coordinates of the contact points (without adding markups manually).  
Thank you very much for your time.

---

<div class="post-metadata">

**Author:** ![gfurnari](https://avatars.discourse-cdn.com/v4/letter/g/a4c791/32.png) [@gfurnari](https://discourse.slicer.org/u/gfurnari)\
**Post date:** [April 21, 2022, 9:46am UTC](https://discourse.slicer.org/t/artery-tumor-intersection-points/23070/2 "2022-04-21T09:46:33Z")

</div>

P.S.  
it would be even better if i could get intersection point between tumor segment and centerline curve of the artery, obtained through “extract centerline” (vmtk).  
thanks again

---

<div class="post-metadata">

**Author:** ![mikebind](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@mikebind](https://discourse.slicer.org/u/mikebind)\
**Post date:** [April 21, 2022, 5:26pm UTC](https://discourse.slicer.org/t/artery-tumor-intersection-points/23070/3 "2022-04-21T17:26:31Z")

</div>

If there are multiple intersection regions, you can split each into it’s own segment using Islands → Split islands to segments. Then, you can find the centroid of each intersection segment using Segment Statistics module. If there are only small regions of intersection, these centroids might be quite close to the vessel centerline.

---

<div class="post-metadata">

**Author:** ![gfurnari](https://avatars.discourse-cdn.com/v4/letter/g/a4c791/32.png) [@gfurnari](https://discourse.slicer.org/u/gfurnari)\
**Post date:** [April 22, 2022, 1:13pm UTC](https://discourse.slicer.org/t/artery-tumor-intersection-points/23070/4 "2022-04-22T13:13:39Z")

</div>

Thank you for your quick response, mike.  
Though, is it possible to get the exact intersection point/points?

---

<div class="post-metadata">

**Author:** ![mikebind](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@mikebind](https://discourse.slicer.org/u/mikebind)\
**Post date:** [April 22, 2022, 4:09pm UTC](https://discourse.slicer.org/t/artery-tumor-intersection-points/23070/5 "2022-04-22T16:09:23Z")

</div>

I’m sure this is possible at the VTK level and I would not be surprised if this is possible somehow in Slicer or a current Slicer extension, but I personally do not know how to find intersection points of a markups curve with a surface model. In [this](https://discourse.slicer.org/t/intersection-two-models-plane-and-centerlines-ct-mr/4130/3) forum thread ([Intersection two models (Plane and centerlines CT/MR) - #3 by shahrokh](https://discourse.slicer.org/t/intersection-two-models-plane-and-centerlines-ct-mr/4130/3)), I see someone has shared code for finding intersections of curves with a plane using vtkCutter, but I think this will not quite work for your purposes because it looks like vtkCutter uses an implicitly described surface (easy for a plane but maybe less so for your vessel segments). I also found this link: [https://kitware.github.io/vtk-examples/site/Cxx/ImageData/IntersectLine/](https://kitware.github.io/vtk-examples/site/Cxx/ImageData/IntersectLine/), which seems closer to what you are trying to do, but again may not be exactly it.

@mau_igna_06, do you have any suggestions?

---

<div class="post-metadata">

**Author:** ![mau\_igna\_06](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mau_igna_06/32/9056_2.png) [@mau\_igna\_06](https://discourse.slicer.org/u/mau_igna_06)\
**Post date:** [April 22, 2022, 5:32pm UTC](https://discourse.slicer.org/t/artery-tumor-intersection-points/23070/6 "2022-04-22T17:32:06Z")

</div>

Hi.

To find the intersection of centerline (only one branch) and the tumor surface (created from the segment) I would recommend to get the internal polydata representacion of the simply displayed centerline curve (that’s a 3d model) and use the module CombineModels to get the intesection with the tumor model. Then extract the centerline of the resulting model.

Hope it helps

---

<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:** [April 23, 2022, 5:47am UTC](https://discourse.slicer.org/t/artery-tumor-intersection-points/23070/7 "2022-04-23T05:47:21Z")

</div>

Both CombineModels and vtkCutter should give you the intersection point coordinates. vtkCutter needs a implicit function as input, which you can get from the tumor polydata using vtkImplicitPolyDataDistance filter.

---

<div class="post-metadata">

**Author:** ![gfurnari](https://avatars.discourse-cdn.com/v4/letter/g/a4c791/32.png) [@gfurnari](https://discourse.slicer.org/u/gfurnari)\
**Post date:** [April 24, 2022, 2:30pm UTC](https://discourse.slicer.org/t/artery-tumor-intersection-points/23070/8 "2022-04-24T14:30:53Z")

</div>

Thank you very much for your replies, @mikebind, @mau_igna_06 and @lassoan .  
Actually, I can’t find CombineModels module. where can i find it?  
Sorry, i’m quite new with 3d slicer.

---

<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:** [April 24, 2022, 7:06pm UTC](https://discourse.slicer.org/t/artery-tumor-intersection-points/23070/9 "2022-04-24T19:06:35Z")

</div>

> [@gfurnari](#):
>
> I can’t find CombineModels module. where can i find it?

It is provided by the [Sandbox extension](https://github.com/PerkLab/SlicerSandbox#slicersandbox).

---

<div class="post-metadata">

**Author:** ![gfurnari](https://avatars.discourse-cdn.com/v4/letter/g/a4c791/32.png) [@gfurnari](https://discourse.slicer.org/u/gfurnari)\
**Post date:** [April 25, 2022, 2:09pm UTC](https://discourse.slicer.org/t/artery-tumor-intersection-points/23070/10 "2022-04-25T14:09:02Z")

</div>

is it available for 4.11.2 version?

---

<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:** [April 25, 2022, 2:11pm UTC](https://discourse.slicer.org/t/artery-tumor-intersection-points/23070/11 "2022-04-25T14:11:09Z")

</div>

You need to use the latest Slicer Preview Release. It will become the new Slicer Stable Release very soon anyway.

---

<div class="post-metadata">

**Author:** ![gfurnari](https://avatars.discourse-cdn.com/v4/letter/g/a4c791/32.png) [@gfurnari](https://discourse.slicer.org/u/gfurnari)\
**Post date:** [April 26, 2022, 11:55am UTC](https://discourse.slicer.org/t/artery-tumor-intersection-points/23070/12 "2022-04-26T11:55:48Z")

</div>

Hi, i tried with CombineModules method but if i use 3d model of centerline polydata representation and tumor, it does create the intersection model but it is not displayed and if i use it to extract centerline, an error tells me that “valid input surface is required”

---

<div class="post-metadata">

**Author:** ![gfurnari](https://avatars.discourse-cdn.com/v4/letter/g/a4c791/32.png) [@gfurnari](https://discourse.slicer.org/u/gfurnari)\
**Post date:** [April 26, 2022, 12:23pm UTC](https://discourse.slicer.org/t/artery-tumor-intersection-points/23070/13 "2022-04-26T12:23:33Z")

</div>

in fact, if i check properties of the model created, surface area, volume, number of points and number of cells are all to zero

---

<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:** [April 30, 2022, 4:11am UTC](https://discourse.slicer.org/t/artery-tumor-intersection-points/23070/14 "2022-04-30T04:11:17Z")

</div>

Artery is a polyline, tumor is a surface, therefore the intersection of the two is just a set of points.

What would you like to achieve?

---

<div class="post-metadata">

**Author:** ![gfurnari](https://avatars.discourse-cdn.com/v4/letter/g/a4c791/32.png) [@gfurnari](https://discourse.slicer.org/u/gfurnari)\
**Post date:** [April 27, 2022, 12:57pm UTC](https://discourse.slicer.org/t/artery-tumor-intersection-points/23070/17 "2022-04-27T12:57:33Z")

</div>

Hi everyone,  
i’ve already asked something like this, but i want to explain better what i’m trying to find out.  
Basically i have artery and tumor segmentation and i extracted artery centerline curve (with hierachy).

1. I would like to understand which of the branches of the centerline curve intersects with the tumor ;
2. once i found the branch(es), i want to go back up in the hierarchy to the main branch (‘Centerline curve(0)’ );
3. possibly doing all by code.

Do you have any ideas on how to do to something like this?

Thank you very much, guys.

---

<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 2, 2022, 12:21pm UTC](https://discourse.slicer.org/t/artery-tumor-intersection-points/23070/19 "2022-05-02T12:21:11Z")

</div>

> [@gfurnari](#):
>
> - I would like to understand which of the branches of the centerline curve intersects with the tumor ;
> - once i found the branch(es), i want to go back up in the hierarchy to the main branch (‘Centerline curve(0)’ );

This should not be a problem at all.

One option is to use [vtkCutter](https://vtk.org/doc/nightly/html/classvtkCutter.html) on a polydata that contains all branches. This works if the cutter preserves cell data in the output, because then you can add cell IDs as a cell array (using [vtkIdFilter](https://vtk.org/doc/nightly/html/classvtkIdFilter.html)) and in the output cell or point data you’ll have the IDs of all branches that had intersection point.

If vtkCutter does preserve cell data then you can use vtkCutter on one branch at a time. If the output is non-empty then you know that the branch intersects the surface. For this, you can use markup curves: iterate through the curves in the subject hierarchy and get the polydata of each curve using `curveNode.GetCurveWorld()`.

---

<div class="post-metadata">

**Author:** ![gfurnari](https://avatars.discourse-cdn.com/v4/letter/g/a4c791/32.png) [@gfurnari](https://discourse.slicer.org/u/gfurnari)\
**Post date:** [May 5, 2022, 2:24pm UTC](https://discourse.slicer.org/t/artery-tumor-intersection-points/23070/20 "2022-05-05T14:24:22Z")

</div>

Thank you very, it was very helpful!
