Segmentation of islets in fluorescence image


I am trying to create an analysis pipeline to segment islets in fluorescence images (input: image1, manual_ROI: image2) either of FIJI or Cellprofiler 3. The common segmentation methods in FIJI does not lead to accurate segmentation as it requires high sigma values for Gaussian filer. Using cellprofiler with specific configuration, it is manageable to segment the islets, yet there are false positives that requires several steps to exclude them.
I have TWO questions:
1- regarding common segmentation with FIJI/cellprofiler, are there any specific plug-ins you suggest to use for such segmentation?
2- in case of using machine-learning methods, what would you suggest?

Thanks in advance

image1: Image1.tif (1.1 MB)
image2: Image2.tif (1.1 MB)

1 Like

Hi Ali @AGeisari,

welcome to the forum :slight_smile:

That’s a challenging one! I just quickly tried ilastik and Fiji Trainable Weka Segmentation. Both struggle in a similar way with precise segmentation but I’d assume with some post-processing (Binary opening with large radius), you could make it to work. Maybe @k-dominik could give advanced advice on ilastik? :wink:

Furthermore, as you pointed out, large sigmas/radii are important for this data set

Afterwards, some post-processing might allow you to remove the small false-positives. The following macro brings you from the Weka result shown above to this selection:

// Get Result from Fijis Trainable Weka Segmentation
selectWindow("Trainable Weka Segmentation v3.2.34");

// Visualisation in black/white
selectWindow("Classified image");
setMinAndMax(0, 1);

// make a proper binary image out of the result
setAutoThreshold("Default dark");
setThreshold(1, 1);
setOption("BlackBackground", true);
run("Convert to Mask");

// post-process the binary image
run("Fill Holes");
run("Create Selection");

// binary opening using a selection
run("Enlarge...", "enlarge=-25");
run("Enlarge...", "enlarge=25");

// open original image and show the selection on it
run("Restore Selection");
selectWindow("Classified image");

Not perfect, but the strategy might have potential.

Let us know how it goes!



A morphology-based approach in FIJI could be to try correlating “texture” with the original image:

  1. Duplicate original image, then Process > Gray Morphology > Closing with a large-ish kernel
  2. Duplicate original image, then Process > Gray Morphology > Opening with a large-ish kernel
  3. Process > Calculator Plus > Subtract the opening from the closing to a new window

This will give you a texture approximation where the islets stand our more against the background than in the original image. You can then use the threshold of the texture image to help clean up the threshold of the original image.

A better approach would probably be pixel classification, as @haesleinhuepf mentioned. Here are previews of results you can get in ilastik and Aivia Community with just a few seconds of painting each. For these large features you will do best to use texture classifiers with large radii:


Hi Robert, thanks for welcome and the solution. I give it a try on specially on CLIJx since the actual data-sets are enormous

Thanks Trevor. The results in Aivia specially is great. I give it a try with our actual large data-sets.


Awesome! Let me know how it goes! For working with hugh images, there are two new commands in CLIJx: pushTile and pullTile which allow you to process a huge image piece wise.

Here is some example code:

for (x = 0; x < numTilesX; x++) {
	for (y = 0; y < numTilesY; y++) {
		for (z = 0; z < numTilesZ; z++) {
			Ext.CLIJx_pushTile(original, x, y, z, tileWidth, tileHeight, tileDepth, margin, margin, margin);
			Ext.CLIJ2_mean3DBox(original, result, 3, 3, 3);

			Ext.CLIJx_pullTile(result, x, y, z, tileWidth, tileHeight, tileDepth, margin, margin, margin);

And this is how it may look:

This functionality is online since yesterday, so I’d be happy about feedback and I’m happy to provide support if necessary :wink:



OMG :heart_eyes:
Thanks a lot.

1 Like

Dear Ali,

in case you have plenty of groundtruth available from manual annotation an AI approach might make sense. Maybe with one of the tools presented here:

Otherwise, I am a great fan of the iastik autocontext approach.




Since we are all (hopefully) at home and have some time for image analysis I also tried the image with ZEN + Intellesis Machine-learning Segmentation and got:

If you like it go for the trail licence and check it out.

Best regards,

Sebi (from ZEISS)


Dear Ali,

here is an intermediate result with autocontext. In the first round of training I included 3 classes. Islet, blood vessels and exocrine (one could also incluse nuclei of the islet). The second training step just has islet and background. With the probability map one can now do some thresholding. Maybe this helps.



Here the result after probability and size thresholding.


Hey @Andreas-Mueller-Micr,

this looks really awesome! Would you mind sharing the ilastik classifier file with us? :upside_down_face:



Hi @haesleinhuepf

Here is the autocontext file:

The object classification is basically self-explanatory out of the screenshot.
Keep in mind that this was just a quick trial and could probably be optimized.




Hi Andreas,
Great help. This is what we’re looking for. Thank you very much for the explanation and sharing the file.
Best, Ali


Will be interesting to see how it performs on the other images.
This can be done with batch processing.



1 Like

Thanks all of you!

I have tried suggested open-source solutions yet the trained model does not predict the object in other images. It tells me that better data-set to train the model is needed since the range of the objects in size and intensity distribution varies. Although the texture remains similar, it seems not enough.

Best, Ali

Hi @AGeisari,

I gave try with Cellprofiler with your image set. It looks ok. Its a very basic pipeline to start with & PFA screen shot. Another option to try is, you could use the illastik (with many images) to built a probability map & use in Cellprofiler. You could check here for that.
PFA pipeline too.

islets_fl.cpproj (646.2 KB)

Fujifilm Wako Automation (Consultant)
For CellProfiler training or optimised pipeline write to,

Read more on our site.
Yokogawa CV8000 - The Ultimate in Confocal HCS

1 Like