| 
25 | 25 | 
 
  | 
26 | 26 | def _measure_volume_and_surface(mask, resolution):  | 
27 | 27 |     # Use marching_cubes for 3D data  | 
28 |  | -    verts, faces, normals, _ = marching_cubes(mask, spacing=(resolution,) * 3)  | 
 | 28 | +    verts, faces, normals, _ = marching_cubes(mask, spacing=resolution)  | 
29 | 29 | 
 
  | 
30 | 30 |     mesh = trimesh.Trimesh(vertices=verts, faces=faces, vertex_normals=normals)  | 
31 | 31 |     surface = mesh.area  | 
@@ -61,9 +61,9 @@ def _get_bounding_box_and_center(table, seg_id, resolution, shape, dilation):  | 
61 | 61 |     )  | 
62 | 62 | 
 
  | 
63 | 63 |     center = (  | 
64 |  | -        int(row.anchor_z.item() / resolution),  | 
65 |  | -        int(row.anchor_y.item() / resolution),  | 
66 |  | -        int(row.anchor_x.item() / resolution),  | 
 | 64 | +        int(row.anchor_z.item() / resolution[0]),  | 
 | 65 | +        int(row.anchor_y.item() / resolution[1]),  | 
 | 66 | +        int(row.anchor_x.item() / resolution[2]),  | 
67 | 67 |     )  | 
68 | 68 | 
 
  | 
69 | 69 |     return bb, center  | 
@@ -236,7 +236,7 @@ def compute_object_measures_impl(  | 
236 | 236 |     image: np.typing.ArrayLike,  | 
237 | 237 |     segmentation: np.typing.ArrayLike,  | 
238 | 238 |     n_threads: Optional[int] = None,  | 
239 |  | -    resolution: float = 0.38,  | 
 | 239 | +    resolution: Optional[Tuple[float, float, float]] = (0.38, 0.38, 0.38),  | 
240 | 240 |     table: Optional[pd.DataFrame] = None,  | 
241 | 241 |     feature_set: str = "default",  | 
242 | 242 |     background_mask: Optional[np.typing.ArrayLike] = None,  | 
@@ -307,7 +307,7 @@ def compute_object_measures(  | 
307 | 307 |     image_key: Optional[str] = None,  | 
308 | 308 |     segmentation_key: Optional[str] = None,  | 
309 | 309 |     n_threads: Optional[int] = None,  | 
310 |  | -    resolution: float = 0.38,  | 
 | 310 | +    resolution: Optional[Tuple[float, float, float]] = (0.38, 0.38, 0.38),  | 
311 | 311 |     force: bool = False,  | 
312 | 312 |     feature_set: str = "default",  | 
313 | 313 |     s3_flag: bool = False,  | 
 | 
0 commit comments