Skip to content

Commit

Permalink
Refactor SingleCellStatic class initialization in single_cell.py
Browse files Browse the repository at this point in the history
  • Loading branch information
dummyindex committed Jul 10, 2024
1 parent 1c285d0 commit e0d5416
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions livecellx/core/single_cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ def compute_iou(self, other_cell: "SingleCellStatic", bbox=None):
max(self.bbox[3], other_cell_bbox[3]),
]
)

mask = self.get_contour_mask(bbox=bbox).astype(bool)
overlap_mask = self.compute_overlap_mask(other_cell, bbox=bbox)
return np.sum(overlap_mask) / (
Expand Down Expand Up @@ -823,12 +824,12 @@ def get_napari_shape_contour_vec(self, contour_sample_num: float = np.inf):
contour = contour[::slice_step]
return self.get_napari_shape_vec(contour)

def sample_contour_point(self, max_contour_num):
def sample_contour_point(self, max_contour_num, update_mask_dataset=False):
"""sample contour points from the trajectory and modify contour attr"""
contour = self.contour
if len(contour) > max_contour_num:
contour = contour[:: int(len(contour) / max_contour_num)]
self.update_contour(contour)
self.update_contour(contour, update_mask_dataset=False)

def segment_by_detectron(self):
pass
Expand Down

0 comments on commit e0d5416

Please sign in to comment.