How to segment dense DAPI stained nuclei?

Hi everyone,
This is my first post to this community. I ask similar question to stackoverflow and someone refer this to me and I land up to this community. After reading some post, I felt this is the right platform to ask and take suggestion from the experts.

I am new to image processing of biomedical images. I have DAPI stained of nuclei of some tissue. My task it to segment nuclei and find the properties of different nuclei. I have few questions.

  1. My image dimension is 978x6048x1965(zyx) and size of around ~10 Gb. It is unable to load in ilastik. After resizing the image I can able to upload in Ilastik and do the segment but is it right method to do?
  2. For this image
    Is it possible to do the segment of the nuclei because nuclei are very dense or do I need to apply any filter before segmenting?
  3. Just want to confirm that I am doing the right steps or not.
    I select features and class labels of nuclei at z=200 plane. Then I did the live prediction of entire x y pixels of z=200 plane and re do the process with assignment of more corrected labels. Now I have to get probabilities of the segmented nuclei for entire stack of z =1:400
    So, i load whole stack again in batch mode and run & save.
    Are these steps right?
  4. Ilastik returns probabilities in zyxc format. Here c has two channel. First channel refers background pb 0 and object pb 1. Second channel refers background pb 1 and object pb 0.
    So, I need to use only one channel for further analysis. Am I right?

If I am wrong, please correct me. Thanks for your help.


Wow ankitbioinfo,
You have your job cut out for you. Seems your in the right direction (please keep the originals safely) but it will take a lot of time and patience.

Before going into the details,it would be very helpful to know what kind of analysis you want to perform.
Do you want to count the nuclei? Do you need an instance segmentation of the nuclei? If so, in 2d or 3d?

Regarding the points you have raised:

If you need a precise (instance) segmentation of the nuclei it is probably not a good idea to downsample the images.
If you only need an estimate for the count, this might be ok.
Note that ilastik can open images of this size, but you will need to store them as hdf5.

You may be able to achieve a much better segmentation if you label a 3d volume (and also compute features in 3d) instead of just working in 2d. How much this would improve your results depends on the z-resolution of your sample. If it is nearly isotropic this will help a lot, if it is very anisotropic it might even be harmful.
If you want to work in 3d, it will also be helpful to convert the data to hdf5.

Yes, that’s correct.

Thanks for reply in details. But how to label 3d volume and compute features in 3d?. Available features in Ilastik Color/intensity,
Laplacian of Gaussian,
Gaussian of gradient magnitude,
Difference of Gaussian,
Structure tensor and
Hessian of Gaussian
work in both 2d/3d environment? Is there any tutorial about labelling 3d volume?

Yes, these features work in 2d as well as 3d. If you load a 3d dataset, they will automatically be applied in 3d.

3d labeling works the same as 2d labeling. Ilastik will show you 3 orthoviews (i.e. the 3 different image planes) and you can label in all 3 of theses.

Hi @ankitbioinfo,

features in ilastik are computed in 3D in 3D data as a default (since the latest version (1.3.2) you can select which features to compute in 2D or 3D (given 3D data).

Thank you @constantinpape. I got what mistake I did. When 3 orthoviews (Z-XY, X-YZ, Y-XZ) was showing in Ilastik. I only work with Z-YX orthoviews, remaining two I hide it. So I did not label any objects in YZ and XZ plane. Thanks for your help.

just a a side-note from my side:
we have those kind of issues quite often (very dense cell layer).

  • Often a cell segmentation is not needed at all (or let’s say the error would be high) and a “stained area” quantification gives better (more robust) results.

  • If a segmentation is really needed we got quite good results with a Mumford-Shah segmentation, see here for details:
    The drawback is, that it’s slow and memory consuming.