def estimate_surface_area(self):
"""
Estimate the surface area by summing the areas of a trianglation
of the nodules surface in 3d. Returned units are mm^2.
"""
mask = self.get_boolean_mask()
mask = np.pad(mask, [(1,1), (1,1), (1,1)], 'constant') # Cap the ends.
dist = dtrans(mask) - dtrans(~mask)
rxy = self.scan.pixel_spacing
rz = self.scan.slice_thickness
verts, faces, _, _ = marching_cubes(dist, 0, spacing=(rxy, rxy, rz))
return mesh_surface_area(verts, faces)
评论列表
文章目录