Open YezheWang opened 4 years ago
Apologies for such a delay on this. I had initially taken a look and had a tough time making any progress. Coming back to this, I thought it might help to at least share what I have:
surf = cloud.delaunay_3d(alpha=6.0, progress_bar=True).extract_surface().triangulate().clean()
p = pv.Plotter(notebook=False)
p.add_mesh(cloud, color='red')
p.add_mesh(surf, color=True, opacity=0.75)
p.enable_depth_peeling()
p.show()
I also tried projecting the data to a common plane and doing the delaunay there (because this filter does the triangulation along a best fitting plane) but this wasn't totally successful (note that it might error on vtk<9)
import vtk
def shell_delaunay_2d(mesh):
copy = mesh.copy()
copy.points[:,1] = 0.0 # Smash shell down to a plane
# Exagerate x and z
copy.points[:,0] *= 10
copy.points[:,2] *= 10
tri = copy.delaunay_2d()
# Put connectivity on plane to the original mesh
return pv.PolyData(mesh.points, tri.faces)
shell = shell_delaunay_2d(cloud)
p = pv.Plotter(notebook=False)
p.add_mesh(cloud, color='red')
p.add_mesh(shell, color=True, opacity=0.75)
p.add_axes()
p.enable_depth_peeling()
p.show()
Description
I want to perform a triangulation to turn some discrete points (around the skull) into a connected surface, just on the outer most layer. But now , inside too! I haven't seen any parameters that can control the connection distance of points.
Example Data
cmask21.nii.gz