Intersection between markups closed curve node on the plane and a line

Dear all,

There is a vtkMRMLMarkupsCurveNode on a plane and a line on the same plane (e.g. x=10.0 mm). I want to find a intersection point (or points) between the curve and the line.

It could be done manually (crude and inefficient). May be there is a solution in Slicer or VTK of such problem?

Did you created the plane through this line(green)? If yes you can convert it to an array and get this points.

Maybe the simple way is creating two fidusions based the two intersection points in the 3d view

The green line is just an example. Initial data is a curve node (isocenter is an origin) and a line equation.

I will try to use vtkIntersectionPolyDataFilter.

  1. Convert curve to polygon.
  2. Convert line to vtkPlane.
  3. Get first output from IntersectionPolyDataFilter and check for intersection points.

VTK locators can compute all intersection points of a polydata with a line extremely fast, for example vtkCellLocator::IntersectWithLine. You can get the curve as polydata by calling GetCurveWorld method of the curve node.