3D segmentation in tissue: counting nuclei

Hi !!!

I hope someone super expert can help me!

I’ve to do 3D segmentation of DAPI channel in order to count number of all nuclei in 10 um ( z stacks) of mouse colon tissue.

I would like to do that because my plan is to measure the fluorescent intensity of tight junctions expressed in villi and crypts and because in each picture the area and morphology changes I’m planning to measure the fluo intensity in the area corresponding on epithelial cells ( villi) and then divide this value for the number of cells ( ROI) corresponding at that area.

Is this possible?
If no which approach do you suggest?
I’ve tried making maximum intensity projection with dapi channel but nuclei overlapped and I cannot get exactly the number of all 10 um tissue.

CAN you help me please???

Here attached and example of maximum intensity projection and the segmentation ( with all filters but as you can see it doesn’t work …)

Stardist 3D is most likely what will work fine. Give it a try.


Thank you very much! I will try soon and if I ve problems i hope you will be still available!!! thanksssssss


Hi Again!

I’ve tried with Stardisc 2D and it works well.

as you can see here!

But Then ti requires anyhow the segmentation and even it’s better compared on my previous tentatives, also here some cells especially the overlapped ( recognized well by Stardist 2D) in the segmentation are seen as single cell… Do you eventually have suggestion for analyze particles? counting just the nuclei.

thank you very much!!! in advance!!!


You can try:

APEER - StarDist 2D


APEER - StarDist 3D

on the APEER platform. Feedback is welcome.


hi! thank yuo very much!! as soon as possible i will have a look! and i will let you know!



Hi Sebi!

I’ve still some questions and doubts…

  1. still my aim is to count nuclei in a 10 um z-stack. with 2D stardist I can distinguish them really well ( z-stack SUM projection) and then if I apply 3D object counter I can get the number of cells. Do you think this approach can get bias? My doubt is because it’s 2D plugin and not for 3D at the same time it seems distinguish quite well overlapped cells.

The problem is also because I’ve no idea how to do a macro eventually for 3D stardist…

  1. which is the best approach for measuring the fluorescent intensity in tissue samples? doing segmentation and use the integrated density as value? or without segmentation ? background subtraction?

Thank you very much for your big help!!! really kind!



Hi @valeria

If you have a stack with cells please use 3D StarDist, which will result in a stack with labels in 3D as well. I did not try to run 3d StarDist from a macro but I am sure somebody on this forum did it already.
And as an alternative you can also use 3D StarDist on APEER.

The 3D Stardist (GPU) module can be found here: APEER - StarDist 3D (GPU)

Your second question is tricky, because the answer might be straight forward and will depend on your actual application and the sample. I do not think there is a “best” approach, because what will work for you application depends on many factor?

  • How thick is your sample?
  • What imaging modality do you use?
  • Widefield, Confocal, ???
  • Do you apply Deconvolution?
  • Do you use calibrated light sources etc.?

The most import question is, what information do you want to derive from the intensity? Can you give an example image and explain what do you want to measure?

Thank you Sebi!

I’m honest, the problem using 3D StarDist is that I’ve no idea from what I can start, I’ve never used phyton and any kind of this things. But I could try to understand something or at least I hope someone can help me with a macro. First, What is it APEER? It seems for me really complicated…

About the second question I think I’ve solved, I need to measure the fluorescent intensity of proteins expressed along the epithelial cells, especially if the signal is increased or decreased in the treatment vs ctrl . My sample are 10 um thick and I think the best is doing a sum intensity project, measuring the integrated density and split for the number of cells ( got after segmentation with StarDist). I’ve only a doubt regarding the background subtraction if I’ve to do in all single pictures or if I can use only one picture as example, measuring the background as different single ROIs and then from that the integrated density and subtract this number from the integrated density of the protein signal.

thank you very much!

Hi @valeria

the point is that for StarDist 3D on APEER you do not need to do any coding. Just use it with your data.

And if you are interested, you can do deep dive and look at the code later.

Ahh ok I will have a look soon!

Meanwhile I’ve found an other method available in image J: 3D object counter. It’s not bad and it’s able to distinguish my cells.
Now the question is why should I have to use 3D StarDist instead of 3D object counter? which is the best?

I should of course try both and compare.

Thank you!


Hi @valeria,

StarDist will use pre-trained network to detect “cell nucleus like” shapes in a 3d stack as individual instances. It does not count or measure anything. This would be done in a later step by something like 3D Object Counter or using MorphoLibJ etc.

So the question what is better is hard to answer. When it is just about segmenting 3d cell nuclei I would put my money on StarDist, but this depends on the nature of your sample data.