Skip to content

Commit 91b7e45

Browse files
Merge pull request #8 from computational-cell-analytics/vigra-updates
Update Getting Centroids using Vigra
2 parents 4a95444 + e0fa45f commit 91b7e45

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
@@ -274,15 +274,14 @@ def get_cell_center_coordinates(gt, mode="p"):
274274
"""
275275
assert mode in ["p", "v"], "Choose either 'p' for regionprops or 'v' for vigra"
276276

277+
properties = regionprops(gt)
278+
277279
if mode == "p":
278-
properties = regionprops(gt)
279280
center_coordinates = [prop.centroid for prop in properties]
280-
bbox_coordinates = [prop.bbox for prop in properties]
281-
282-
elif mode == "v": # TODO: doesn't seem to work currently, will need further testing
283-
raise NotImplementedError
281+
elif mode == "v":
284282
center_coordinates = vigra.filters.eccentricityCenters(gt.astype('float32'))
285-
bbox_coordinates = None # TODO
283+
284+
bbox_coordinates = [prop.bbox for prop in properties]
286285

287286
return center_coordinates, bbox_coordinates
288287

0 commit comments

Comments
 (0)