Get surface area of region on polydata

I would like to derive the surface area of a specific region on the surface of polydata. This specific region would be the part of the surface that is visible when viewed from above (in the y-plane) such that overlapping “points” are not considered.

This is the isosurface generated by Marching Cubes:

To illustrate, I have derive this particular top-surface by manipulating the original image stack and use MC to reconstruct the isosurface of the manipulated images (in green):

I can now get the surface area via vtkMassProperties().GetSurfaceArea()/2 of the region.

However, the derivation of the green region by manipulating the image data feels very cumbersome. Therefore I was wondering if anybody would know an appropriate method to get the region of a surface that is visible in the y-plane. Perhaps I would need to clip the object by a complex shaped plane?

I hope my question is clear, thanks in advance! :slight_smile:

We have tried a number of different approaches for solving this problem (selecting cells based on their normal direction, medial/Voronoi surface, etc), but what worked the best in the end was the following:

  • Create a curve by automatically placing points around the of the boundary (closest points to points far away from the model in 4-8 directions)
  • Compute path between the control points on the surface using vtkSlicerDijkstraGraphGeodesicPath, minimizing using inverse square of curvature computed by vtkCurvatures filter
  • Extract surface using vtkSelectPolyData

You can try this on your data without any programming by following steps described in this video:

Hi Andras, thank you for your comprehensive reply. I tried both methods, the 3D slicer was working fine but I need to make it automated.

vtkDijkstraGraphGeodesicPath needs a start and end vertex to compute a path. My input however consists of hundreds of vertices describing the (complex) boundaries of my object. Do you know how I could make a closed path between my boundary points using vtkDijkstraGraphGeodesicPath (instead of just between one start and end vertex)?

3D Slicer is fully Python-scriptable, so you can use it without GUI. But if you don’t work in medical imaging domain then it may be not necessary to use Slicer’s Python environment and want to just extract this particular feature. To get this working anywhere, follow the steps that I described above. Maybe the first step was not entirely clear: you get a complete closed curve by creating curves between each pair of the 4-8 control points. You can find control point by finding closest point to the surface from far away from the model, in 4-8 different directions.

hello, I watched this video in your youtube Channel and then switched to this web. I have a further question for your instruction. after getting this surface, can I use this surface to from the fit plane. I noticed that currently I can only pick three points to form the plane in the 3D slicer.

looking forward for your reply.

Yes, you can register the clipped surface to a plane using Model Registration module. There is a built-in VTK method for plane fitting using least squares (and there is a robust RANSAC plane fitting VTK class, too).

You can visualize the plane in Slicer by using a plane markup as shown in this example:

2 Likes

Thank you very much.

Dear Lasso,

Thanks for your answer on how to form the best-fitting plane with the surface. here, I met a further question. After the form of this plane, I get the axis of the plane, then I want to find the related point between surface 1 (the surface which forms the plane)and surface 2 along the direction of this axis, and calculate the distance of the two points.

I try the extend module “model to model” in the 3D slicer, in this module, the distance between two surfaces is likely to be calculated with the algorithm of ICP.

I drew my question, look forward to your kindly reply.

Is this projection? I noticed that in the extension “shape population viewer”, I can select “pointTopointAlongZ”, Does it means Along the Z-axis of this surface, and also along the z-axis of the Best-fitting plane formed by the surface?

Model to model distance module computes the distance between each point of one model to the closest point on the other model. If you want to get the distance from a plane then the easiest is to transform the model to make it aligned with the axes of the plane. If the plane normal is aligned with the third coordinate system axis then the third coordinate of each point gives you the distance from the plane.

thank you very much. I will have a try.