Skip to content

Commit

Permalink
Use previous definition of CoM (add documentation)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanbb committed Jul 24, 2024
1 parent c206c83 commit fa9d7f9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mesmerize_core/caiman_extensions/cnmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ def get_contours(
) -> Tuple[List[np.ndarray], List[np.ndarray]]:
"""
Get the contour and center of mass for each spatial footprint
Note, the centers of mass are different from those computed by CaImAn.
They are based on the contours and can be used to compute click targets for visualizations.
Parameters
----------
Expand Down Expand Up @@ -303,8 +305,11 @@ def get_contours(


for contour in contours:
coordinates.append(contour["coordinates"])
coms.append(contour["CoM"][::-1])
coors = contour["coordinates"]
coordinates.append(coors)

com = np.nanmean(coors, axis=0)
coms.append(com)

return coordinates, coms

Expand Down

0 comments on commit fa9d7f9

Please sign in to comment.