Skip to content
Snippets Groups Projects

Mesh for segmentation

3 files
+ 79832
0
Compare changes
  • Side-by-side
  • Inline

Files

+ 3
0
@@ -29,6 +29,9 @@ def create_mesh(volume: np.ndarray, level: float = 0.5, spacing: Tuple[float, fl
if volume.ndim != 3:
raise ValueError("The input volume must be a 3D numpy array.")
# get otsu threshold to compute level
#test witha object with a hole example.cement
# Apply the Marching Cubes algorithm to extract the surface mesh
verts, faces, _, _ = measure.marching_cubes(volume, level=level, spacing=spacing)
Loading