Skip to content

Commit e0fa45f

Browse files
committed
Update Getting Centroids using Vigra
1 parent bc35fcc commit e0fa45f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

micro_sam/util.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,15 +262,14 @@ def get_cell_center_coordinates(gt, mode="p"):
262262
"""
263263
assert mode in ["p", "v"], "Choose either 'p' for regionprops or 'v' for vigra"
264264

265+
properties = regionprops(gt)
266+
265267
if mode == "p":
266-
properties = regionprops(gt)
267268
center_coordinates = [prop.centroid for prop in properties]
268-
bbox_coordinates = [prop.bbox for prop in properties]
269-
270-
elif mode == "v": # TODO: doesn't seem to work currently, will need further testing
271-
raise NotImplementedError
269+
elif mode == "v":
272270
center_coordinates = vigra.filters.eccentricityCenters(gt.astype('float32'))
273-
bbox_coordinates = None # TODO
271+
272+
bbox_coordinates = [prop.bbox for prop in properties]
274273

275274
return center_coordinates, bbox_coordinates
276275

0 commit comments

Comments
 (0)