Analysis of Neurospheres

Hello ImageSC Community,

I m asking for help to analyse these B/W pictures of Neurospheres. The goal is first to mark all Neurospheres and then sort all Neurospheres between 50 and 300 ym.

I tried the fiji plugin Clji and got from this original (A) to (B) by the following script

1621_SVZ-ko-stitch.czi - 1621_SVZ-ko-stitch.czi #01-Müll.tif (1.2 MB)
CLIJx Image of 1621_SVZ-ko-stitch.czi - 1621_SVZ-ko-stitch.czi #01-1 Crop.tif (753.8 KB)
Sobel of Gaussian Blur2D of Divide By Gaussian Background of CLIJx Image of 1621_SVZ-ko-stitch.czi - 1621_SVZ-ko-stitch.czi #01.tif (6.2 MB)

// To make this script run in Fiji, please activate 
// the clij and clij2 update sites in your Fiji 
// installation. Read more: https://clij.github.io

// Generator version: 0.5.0.6

// Init GPU
run("CLIJ2 Macro Extensions", "cl_device=");

// Load image from disc 
open("C:/Users/Grafikuser/Desktop/1621_SVZ-ko-stitch.czi - 1621_SVZ-ko-stitch.czi #01-M�ll.tif");
image_1 = getTitle();
Ext.CLIJ2_pushCurrentZStack(image_1);

// Copy
Ext.CLIJ2_copy(image_1, image_copy_2);
Ext.CLIJ2_release(image_1);

Ext.CLIJ2_pull(image_copy_2);

// Divide By Gaussian Background
sigmaX = 2;
sigmaY = 2;
sigmaZ = 2;
Ext.CLIJx_divideByGaussianBackground(image_copy_2, image_divide_by_gaussian_background_3, sigmaX, sigmaY, sigmaZ);
Ext.CLIJ2_release(image_copy_2);

Ext.CLIJ2_pull(image_divide_by_gaussian_background_3);

// Gaussian Blur2D
sigma_x = 2;
sigma_y = 2;
Ext.CLIJ2_gaussianBlur2D(image_divide_by_gaussian_background_3, image_gaussian_blur2d_4, sigma_x, sigma_y);
Ext.CLIJ2_release(image_divide_by_gaussian_background_3);

Ext.CLIJ2_pull(image_gaussian_blur2d_4);

I am having a lot of trouble getting the current image through a threshold to a good binarized image.
The small garbage like fibers and older apoptosis cells always come inside the threshold and the normal watershed (Fiji) does not cut the neurosphere where it should.

Hope you have fun with my little problem
Max

Hi @Vogt_without_i
I’m a great CLIJ fan (@haesleinhuepf knows).
But in your case ‘clij-ing’ your procedure is not the first step to go, I think.

With the following IJ1 macro

run("Subtract Background...", "rolling=50 light");
setAutoThreshold("Minimum");

you get this result from your test image

Is this want you want to detect and measure?

But even this is not the first step.
The illumination in your test image is very inhomogeneous. You should definitely take a look at it and try to optimize it.

Hi @phaub

Substract BG is actually quite nice. The problem is that there are still some balls that only reach the threshold halfway and crush the ferette diameter, circul. a. co

1621_SVZ-ko-stitch.czi - 1621_SVZ-ko-stitch.czi #01.tif (1.1 MB)
1621_SVZ-ko-stitch.czi.tif (870.3 KB)

And the small blob under the big black blob in the upper right corner is also relevant, or on the right side of the 2 blobs in the lower right corner.

I know the problem with illumination, but was able to solve it with other settings on the microscope.

Can you pleace remove the link to this commercial platform in your post!

You can not expect that clusters of your objects are sperated by a simple threshold. You need to use more sophisticated methods.

And you can’t expect a simple threshold to segment the inner / darker structures of your objects, while at the same time this threshold is used to segment lighter structures.
At least you need two thresholds.

sorry, it wasn’t deliberate.

You are absolutely right. I can’t expect this, but I ran out of ideas. I tried your idea with 2 thresholds and got this result:

run("Subtract Background...", "rolling=25 light");

run("8-bit");
run("Duplicate...", " ");

 //PIC 1
run("Median...", "radius=2");
run("Auto Local Threshold", "method=Phansalkar radius=15 parameter_1=0 parameter_2=0 white");

run("Invert");
run("Dilate");
run("Dilate");

//duplic. "PIC2"

run("Auto Local Threshold", "method=Niblack radius=15 parameter_1=0 parameter_2=0 white");

imageCalculator("Divide create", "PIC2","PIC1");

run("Convert to Mask");
run("Watershed");


run("Create Selection");
selectWindow("1621_SVZ-ko-stitch.czi - 1621_SVZ-ko-stitch.czi #28");
run("Restore Selection");

So there is still 1 wrongly segmented sphere in this area and I get this garbage in the upper corner and in the lower area - do you think there is a way to just mark sharp outlines (like most of the neurospheres) and use this as another criterion to sort the selection?

Feeling honored by your help
Max

Hi @Vogt_without_i

I also had to segment neurospheres and for that I used ilastik, just as an alternative to using thresholding algorithms.

Additionally, you can use shape descriptors to reject elongated objects (e.g., aspect ratio in Fiji). For that you could use the Extended Particle Analyzer from BioVoxxel. You’ll need to add the BioVoxxel update site.

Hope this helps. Best,

1 Like

Hi @pau,

Thanks for this great idea! There are so many image analysis porgrams or add-ons. So its hard to find the best way for the own problem. And it looks like ilastik is the way of the minor resistance in this case.

So if i get you right: you would say: PixelClassification - then Object Classification with segmentation and analyze the segmentation by the size/diameter/area , right ?

Hi @Vogt_without_i

Glad it helps.

I only use pixel classification to generate a probability map. Then I switch to Fiji, I smooth the image corresponding to the neurosphere probability and perform the segmentation using a thresholding algorithm and watershed to separate merged objects. Then you can reject false positives using some object metrics, such as the aforementioned aspect ratio.

Note that if you use object classification in ilastik it is not possible to apply a watershed algorithm to separate merged neurospheres. I would say that you don’t need object classification in this case, unless you plan to reject false positives using an ilastik classifier.

If you prefer the object classification strategy you will need to ensure that touching neurospheres are properly separeted. I never tried this, but you could train a pixel classifier with 3 classes: background, neurospheres and neurosphere edges (make sure that you include exeples of edges between touching neurospheres, since the goal is to obtain independent instances for the object classification). If this doesn’t work, I would suggest you to continue the image processing in Fiji, as I did.

Best,

1 Like

works very well! Thanks for your help :+1:

1 Like