Segmentation of islets in fluorescence image

Hi,

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
image

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");
call("trainableSegmentation.Weka_Segmentation.getResult");

// Visualisation in black/white
selectWindow("Classified image");
run("Grays");
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");
run("Invert");

// 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
selectWindow("Image1-1.tif");
run("Restore Selection");
selectWindow("Classified image");

Not perfect, but the strategy might have potential.

Let us know how it goes!

Cheers,
Robert

2 Likes

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:

2 Likes

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.

1 Like

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:
https://github.com/clij/clij2-docs/blob/master/src/main/macro/processTiles3D.ijm

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:

Cheers,
Robert

4 Likes

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: https://www.biorxiv.org/content/10.1101/2020.03.20.000133v1

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

Best,

Andreas

2 Likes

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)

4 Likes

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.
Best,

Andreas

3 Likes

Here the result after probability and size thresholding.

4 Likes

Hey @Andreas-Mueller-Micr,

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

Thanks!

Cheers,
Tobert

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.

Best,

Andi

2 Likes

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

2 Likes

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

Best,

Andreas

1 Like