Skip to content

Commit

Permalink
Merge jakirkham/use_sqrt_moc into jakirkham/cuda-12
Browse files Browse the repository at this point in the history
  • Loading branch information
jakirkham committed Jul 14, 2023
2 parents eabbd77 + 3c40509 commit bb56ef7
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions python/cucim/src/cucim/skimage/measure/_colocalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,6 @@ def manders_coloc_coeff(image0, image1_mask, mask=None):
return cp.sum(image0 * image1_mask) / img_sum


@cp.fuse()
def _get_manders_overlap_coeff(image0, image1):
denom = cp.linalg.norm(image0) * cp.linalg.norm(image1)
return cp.sum(cp.multiply(image0, image1)) / denom


def manders_overlap_coeff(image0, image1, mask=None):
r"""Manders' overlap coefficient
Expand Down Expand Up @@ -261,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 bb56ef7

Please sign in to comment.