Droplets segmentation

Hi Ilastik development team,

I am a new user of Ilastik and got the tutorials from Youtube.
So far, I have tried the pixel classification, pixel classification and object identification, and cell density.
Here, i haven’t found anything closer with the one I want.
With this example picture (attached), I want to identify each of the microfluidics droplets, either the one that has something inside or the empty one. I managed to identify the one which has something inside. But, I couldn’t find a way to detect both of my droplets. Do you have any suggestion regarding this? Thank you and look forward to your reply and suggestions.

Best regards,

Example.tiff (4.0 MB)

Hi @ims, thanks for providing the data.
So if your goal is to count the different types of droplets, it can be achieved with ilastik. I’d do two workflows:

  1. pixel classification: since i assume you’re only interested in the counts, you can be very aggressive with the annotations, that the classifier only learns to recognize more the pixels central to the object. Just foreground (object-center) vs background. Important is that you want separate islands of pixels, like the blue stuff in the following screenshot:

    from there you export the probabilites.

  2. Second step would be to go to object classification to do learn a classifier that can decide whether an object belongs to the bright, or the dark class. As images you’d use the original one as raw data, and the generated probability image from step 1 as prediction map. So in thresholding you’d get something like this:

    all objects should have a different color here (note, there a a few merges in the lower right corner, but taking more time in pixel classification can resolve this).
    Training a classifier that can distinguish between the two classes is a relatively easy task since the grey level characteristics are so different (bright vs dark). So it is sufficient to select maybe even the mean intensity value as a feature and do some annotations like this:

    from this object classification project you can export a table. It includes the predicted class as a field for every object. Counting them then can be done in excel or any other tool that can handle tables:

Should you, however, need a more accuarate shape, this could also be achieved…

1 Like

Hi @k-dominik,

Thanks for the reply, really helpful. I was thinking the same thresholding strategy but couldn’t execute it. Now, I got an idea to explore it more.
If I have something to ask, I will post it again here. Once again, thanks!


Hi @k-dominik,

I tried to do explore the feature, but got stuck into two things here.
First, the border. I was wondering whether my methods of classification is correct or not (haven’t run for batch processing).
But, I tried to play around with the one from your guidelines and made this one (attached).
Is this the only way to eliminate the one touch the border? or, should i move with the counting workflow?

Second, I adjusted the smooth and threshold to get the circular type of detected droplets here. But, is there anyway to make a dilation and maybe the detected droplets could reach the actual size? and, maybe make them until touching for each other?

Thanks a lot!


Hey @ims,

the answer to this is a bit more involved, so I’ll reply to this when I have a bit more time. Sorry…