Search code examples
c++mathmatlab3dpoint-clouds

How to get curve from intersection of point cloud and arbitrary plane?


I have various point clouds defining RT-STRUCTs called ROI from DICOM files. DICOM files are formed by tomographic scanners. Each ROI is formed by point cloud and it represents some 3D object.

The goal is to get 2D curve which is formed by plane, cutting ROI's cloud point. The problem is that I can't just use points which were intersected by plane. What I probably need is to intersect 3D concave hull with some plane and get resulting intersection contour.

Is there any libraries which have already implemented these operations? I've found PCL library and probably it should be able to solve my problem, but I can't figure out how to achieve it with PCL. In addition I can use Matlab as well - we use it through its runtime from C++.

Has anyone stumbled with this problem already?

P.S. As I've mentioned above, I need to use a solution from my C++ code - so it should be some library or matlab solution which I'll use through Matlab Runtime.

P.P.S. Accuracy in such kind of calculations is really important - it will be used in a medical software intended for work with brain tumors, so you can imagine consequences of an error (:


Solution

  • You first need to form a surface from the point set.

    If it's possible to pick a 2d direction for the points (ie they form a convexhull in one view) you can use a simple 2D Delaunay triangluation in those 2 coordinates. otherwise you need a full 3D surfacing function (marching cubes or Poisson)

    Then once you have the triangles it's simple to calculate the contour line that a plane cuts them.

    See links in Mesh generation from points with x, y and z coordinates