MouseLand / cellpose-napari

napari plugin for cellpose (see www.cellpose.org) - an anatomical segmentation tool
https://cellpose-napari.readthedocs.org
BSD 3-Clause "New" or "Revised" License
47 stars 22 forks source link

Cell segmentation XYZ coordinates export #42

Closed alfonsecard closed 1 month ago

alfonsecard commented 1 year ago

Hi, thanks a lot for developing this software. I've been struggling with cell segmentation in 3D for a long time and your software is working so well after training the model with a few images.

I am able to obtain very accurate cell masks in 3D, but now I'm having problems converting this data into an XYZ coordinates text file (that I need for a subsequent smFISH-dot count analysis).

Do you have any recommendations on how I can obtain this?

Bests.

carsen-stringer commented 1 month ago

for each mask in a 3D masks array, its XYZ coordinates are:

for m in range(1, masks.max()):
    z, y, x = np.nonzero(masks==m)