I have a set of 3D ROI label stacks stored as TIFF files, where each ROI represents a single cell. I want to generate surface meshes(I use trimesh) suitable for downstream shape analysis.
I tried marching cubes:
from skimage import measure import trimesh import numpy as np mask = labels == lab_id # binary mask for one ROI verts, faces, normals, values = measure.marching_cubes(mask.astype(np.float32), level=0.5) mesh = trimesh.Trimesh(vertices=verts, faces=faces) but Some meshes have missing surfaces, holes, or multiple disconnected “blobs. and Poisson surface reconstruction (Open3D) which didn't correctly capture the shapes.
I also tried
import trimesh coords = np.argwhere(mask) # N x 3 points pc = trimesh.points.PointCloud(coords) mesh = pc.convex_hull But Convex hull loses all concavities, making every cell look roughly the same.
What is the recommended way to generate a nice and smooth closed-contour mesh from a 3D ROI stack, preserving concavities and avoiding blobs or missing surfaces?
Are there specific parameters in either of the methods I tried that help produce more reliable meshes?