flatironinstitute / CaImAn

Computational toolbox for large scale Calcium Imaging Analysis, including movie handling, motion correction, source extraction, spike deconvolution and result visualization.
https://caiman.readthedocs.io
GNU General Public License v2.0
640 stars 370 forks source link

How to get cell x/y coordinates #1193

Closed zhouyi0812 closed 1 year ago

zhouyi0812 commented 1 year ago

Hello!

I wonder how can get the single x and y coordinates for each cell on CaIman?

Here is my code for contour, but each cell has so many coordinates for it. Thank you!

idx = cnm.estimates.idx_components[0]
contour_dict = cnm.estimates.coordinates[idx]
contour_coords = contour_dict['coordinates']
contour_coords

EricThomson commented 1 year ago

What you are calling contour_dict is a coordinates dictionary that includes CoM key which is the center of mass. Generally you can do contour_dict.keys() to find what it includes.

Note these kinds of caiman usage questions are better suited for GitHub Discussions. Issues are more for raising software problems/bugs/feature requests. People will be more likely to search/find answers to these types of questions there moving forward.