# How to get \[“label”, “centroid”\] for each cell with cellpose

**URL:** https://discourse.scverse.org/t/how-to-get-label-centroid-for-each-cell-with-cellpose/1114
**Category:** squidpy
**Created:** [February 7, 2023, 9:39pm UTC](https://discourse.scverse.org/t/how-to-get-label-centroid-for-each-cell-with-cellpose/1114 "2023-02-07T21:39:01Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sophieRAIBAUD](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/sophieraibaud/32/397_2.png) [@sophieRAIBAUD](https://discourse.scverse.org/u/sophieRAIBAUD)
#### Post date: [February 7, 2023, 9:39pm UTC](https://discourse.scverse.org/t/how-to-get-label-centroid-for-each-cell-with-cellpose/1114/1 "2023-02-07T21:39:01Z")

</div>

dear squidpy dev,  
again thanks for your useful work  
I am struggling getting some information after cellpose nuclei deconvolution  
I am following this tuto:  
[squidpy\_reproducibility/hne\_image\_analysis.ipynb at master · theislab/squidpy\_reproducibility (github.com)](https://github.com/theislab/squidpy_reproducibility/blob/master/notebooks/image_figures/hne_image_analysis.ipynb)  
When it comes to: **calculate features: segmentation and summary**

1. in addition to _ **fraction of area covered by cells, number of cells** _ I would like to get the positions of the nuclei. I guess I would have to add “props”: [“label”, “centroid”] in features\_kwargs but I don’t understand how to mix it with the custom function…
2. Could you please explain me what is the  
‘spot\_scale’: 2, and ‘scale’: 1.0,?  
Many thanks !!  
Sophie

---

<div class="post-metadata">

### Author: ![LLehner](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/llehner/32/569_2.png) [@LLehner](https://discourse.scverse.org/u/LLehner)
#### Post date: [April 2, 2023, 7:40pm UTC](https://discourse.scverse.org/t/how-to-get-label-centroid-for-each-cell-with-cellpose/1114/2 "2023-04-02T19:40:25Z")

</div>

Hi @sophieRAIBAUD

1. Next to the other args you pass `features="custom"` and `features_kwargs={'custom':{'func': <your_function>}}` to `squidpy.im.calculate_image_features()`, where `<your_function>` is the custom function that retrieves the nuclei positions.

2. `'spot_scale': float` and `'scale':float` are kwargs passed to [squidpy.im.ImageContainer.generate\_spot\_crops](https://squidpy.readthedocs.io/en/stable/classes/squidpy.im.ImageContainer.generate_spot_crops.html#squidpy-im-imagecontainer-generate-spot-crops) and [squidpy.im.ImageContainer.crop\_corner](https://squidpy.readthedocs.io/en/stable/classes/squidpy.im.ImageContainer.crop_corner.html#squidpy.im.ImageContainer.crop_corner) respectively. `spot_scale` is the scaling factor for the spot diameter and `scale` rescales the crop.

If there are further questions feel free to ask here.
