Skip to content

Commit

Permalink
Inline _get_manders_overlap_coeff
Browse files Browse the repository at this point in the history
  • Loading branch information
jakirkham authored Jul 14, 2023
1 parent b261404 commit 3c40509
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions python/cucim/src/cucim/skimage/measure/_colocalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,6 @@ def manders_coloc_coeff(image0, image1_mask, mask=None):
return cp.sum(image0 * image1_mask) / img_sum


def _get_manders_overlap_coeff(image0, image1):
denom = cp.linalg.norm(image0) * cp.linalg.norm(image1)
return cp.vdot(image0, image1) / denom


def manders_overlap_coeff(image0, image1, mask=None):
r"""Manders' overlap coefficient
Expand Down Expand Up @@ -260,7 +255,8 @@ def manders_overlap_coeff(image0, image1, mask=None):
if image1.min() < 0:
raise ValueError("image1 contains negative values")

return _get_manders_overlap_coeff(image0, image1)
denom = cp.linalg.norm(image0) * cp.linalg.norm(image1)
return cp.vdot(image0, image1) / denom


def intersection_coeff(image0_mask, image1_mask, mask=None):
Expand Down

0 comments on commit 3c40509

Please sign in to comment.