Image Segmentation Black and White

Hello guys,

I am a new user of ImageJ Fiji, so I don`t have that much experience yet.

I need to analyze images of particles. (an image is attached)
I think it`s hard to identify them…the “better visible and bigger black points” scattered in the horizontal axis

In the end I would like to have a binary picture - only the black particles and white background.
I know that I need to convert it first into a 8bit image. I was trying to “delete” the useless background of the picture by using Treshold and Filters. But i haven`t got a good result yet.

Do you have any advice for me?
Or is that picture not that good to analyzse, so I should get a better one?
I hope someone can help me.

Best regards

1.tif (5.5 MB)

Hi
@student94
Please tell me if it fits.
Thank you in advance.
It’s up to you to choose X or Y or Z
You will need to have the plug-in:
https://www.optinav.info/Polynomial_Shading_Corrector.htm

run("Duplicate...", "title=1");
run("Invert");
run("Polynomial Shading Corrector", "degree_x=2 degree_y=2 regularization=2");
run("Color Transformer", "colour=XYZ");
setAutoThreshold("Intermodes dark");
//run("Threshold...");
setOption("BlackBackground", true);
run("Convert to Mask", "method=Intermodes background=Dark calculate black");
run("Stack to Images");
run("Tile");
1 Like

Hey Mathew,

thanks a lot for your answer!

After using the Color Transformer I have the image as you can see (attached).

For running AutoTreshold first i need to convert the image to 8 or 16bit.
And then in AutoTreshold I do only choose “Intermodes” at “Method”?
AutoTreshold

Threshold

I guess that I should use “Intermodes” at the “Treshold…” menu as well, or?

In the end I have something like that:

X seems to be the best result, but its still not perfect. I would like to delete all the small points, which arent any particles. Are there any filters useful by using the particle size or something similar?
Do you want me to change any options?

Best regards.

1 Like

@student94
First of all, thank you for your answer: it is nice to have a response back.
You will have to play with the “area” size of “Analyze Particles …”. (Step 2)

Macro slightly changed for the first part:

// Step 1
run("Duplicate...", "title=0");
run("Duplicate...", "title=1");
run("Invert");
rename("2");
selectWindow("2");
run("Polynomial Shading Corrector", "degree_x=2 degree_y=2 regularization=2");
run("Color Transformer", "colour=XYZ");
setAutoThreshold("Intermodes dark");
//run("Threshold...");
setOption("BlackBackground", true);
run("Convert to Mask", "method=Intermodes background=Dark calculate black");
run("Stack to Images");
run("Tile");
// Step 2
selectWindow("X");
run("Set Measurements...", "area limit add redirect=None decimal=2");
run("Analyze Particles...", "size=80-Infinity summarize add");
selectWindow("0");
roiManager("Show All without labels");
1 Like

Hey Mathew,

do I need to confirm anything in the roimanager? Seems that nothing happens.

I also played a little bit with the filter “minimum” and after it “find maxima…”
In my eyes it`s almost a good result, seems that nearly all particles are included. In the end I will export the list of X- and Y- coordinates.

What do you think about it?

I don’t understand this:

while you display (in the forum) the requested results (images).
Use my new macro.
Observe the image (0): the points are in red.