Analyse Particles

analyze-particles

#1

I am Ahsan Ali, and am new on ImageJ. I have an issue regarding the Particle Analyse.

The summary of “Particle Analyse” gives the following information “count, area, and average size”.

I want to get the standard deviation also on this table/Summary file.

Please inform that is it possible to get standard deviation on it. It will be very helpful for me if I get an answer.

Thanks alot,
Best Regards,
Ahsan


#2

Dear @ahsanali,

You can activate this feature under Analyze ►Set Measurements.
But since you are by default measureing on the binary image you need to also redirect the measurement in the very same parameter setup to the actual original image from where you want to catch the pixel values. Otherwise, your StdDev will most likely be 0 since all pixels it considers per object analyzed are white or black.


#3

Good day Ahsan,

as always if one is new to a tool or method it is best to study the User Manual/Guide — no?

Here it is:
https://imagej.nih.gov/ij/docs/guide/index.html

Most important concerning your question is:
https://imagej.nih.gov/ij/docs/guide/146-30.html#toc-Subsection-30.7

Regards

Herbie


#4

Hi!
Thank you very much for the answer. I did this as you told. But in this case m getting the standard deviation value on Result sheet not on the Summary sheet.
I want standard deviation on Summay sheet.
Is it possible?


#5

Hi Herbie,
Thank you the answer. I read the manual and in every case i did not get success. .
In the mention linked, i checked it but there also written “Result Table” and i want the standard deviation value on Summary table/sheet…


#6

Not intrinsically to my knowledge.


#7

Ahsan,

you are looking for the standard deviation of what?

Here is what I get for the test-sample “blobs.tif”:
ScreenShot
(Only the last rows are shown.)

What’s wrong with this?

Regards

Herbie


#9

Again Ahsan,

you are looking for the standard deviation of what?

Clueless

Herbie


#11

Ahsan,

why not simply compute this value and enter it to the Summary Table?

Regards

Herbie


#13

Good day Ahsan!

I hope understand what i mean.

I think I do, but not sure you understand what I’ve proposed.

You could write e.g. an ImageJ-macro that computes the STD of the area measurements and that writes the result to the summary table.

Have success

Herbie

PS:
Here is a macro that does just that:

requires( "1.52h" );
setBatchMode(true);
run("Blobs (25K)");
run("Set Measurements...", "area redirect=None decimal=3");
setOption("BlackBackground", true);
setAutoThreshold("Default");
run("Convert to Mask");
run("Analyze Particles...", "display clear summarize");
selectWindow("Results");
a = Table.getColumn("Area");
close("Results");
Array.getStatistics(a, mi, mx, mn, std);
selectWindow("Summary");
Table.set("STD", nResults, std);
Table.update;
setBatchMode(false);
exit();

ScreenShot

Paste the above macro code to an empty macro window (Plugins >> New >> Macro) and run it.
(You need an open internet connection to load the demo image.)


#14

Hi Herbie,

Thank you very much. I got your point. I try your macro will let you know.
Once again thanks alot.


#15

Hi Herbie,

This is my original macro.

May be you can put the macro that you sent me here then i try to run.
Is it possible?

// Save As Tiff & Pinholemeasurement black glassmat
//
// This macro prompts the user to save as TIF.
// Add it to the ImageJ/macros/Plugin
// After then it makes an pinholemeasurement created by AA

// macro “Pinhole - black glassmat” {
// run(“Input/Output…”, “tif”);
// saveAs(“tif” );
// }
run(“8-bit”);
makeRectangle(1608, 3380, 1500, 1500);
run(“Crop”);
run(“Enhance Contrast”, “saturated=0.5 normalize”);
setAutoThreshold();
//run(“Threshold…”);
//setTool(11);
setThreshold(0, 85);
run(“Convert to Mask”);
run(“Analyze Particles…”, “size=0-Infinity circularity=0.00-1.00 show=Nothing display include summarize record”);

{
run(“Input/Output…”, “txt”);
saveAs(“txt”);
}

//cleanUp();

// Closes the “Results” and “Log” windows and all image windows
//function cleanUp() {
// requires(“1.30e”);
// if (isOpen(“Results”)) {
// selectWindow(“Results”);
// run(“Close” );
// {
// if (isOpen(“Summary”)) {
// selectWindow(“Summary”);
// run(“Close” );
// }
// while (nImages()>0) {
// selectImage(nImages());
// run(“Close”);
// }
//}

Thanks alot


#16

May be you can put the macro that you sent me here then i try to run.
Is it possible?

Yes I can,

but your macro is a mess. Are you sure about what you are doing?

For example:
You set an undefined automatic threshold and then set a fixed one.
This is not only strange but fix thresholds should not be used for scientific work because they don’t generalize and they lead to results that are difficult to reproduce.

For the time being replace your code line

run(“Analyze Particles…”, “size=0-Infinity circularity=0.00-1.00 show=Nothing display include summarize record”);

with

run("Analyze Particles...", "display clear summarize");
selectWindow("Results");
a = Table.getColumn("Area");
close("Results");
Array.getStatistics(a, mi, mx, mn, std);
selectWindow("Summary");
Table.set("STD", nResults, std);
Table.update;

Please learn how to code ImageJ-macros:
https://imagej.nih.gov/ij/developer/macro/macros.html
https://imagej.nih.gov/ij/developer/macro/functions.html

Good luck

Herbie


#17

Hi Herbie,

Thank you for helping. Yes herbie we want to see the pore size at fixed threshold for white surface. We measure the 0-85 (black to gray) hole. It indicates the level of porosity of my system…

Herbie, i added as you mentioned like this:

// Save As Tiff & Pinholemeasurement black glassmat
//
// This macro prompts the user to save as TIF.
// Add it to the ImageJ/macros/Plugin
// After then it makes an pinholemeasurement created by AA

// macro “Pinhole - black glassmat” {
// run(“Input/Output…”, “tif”);
// saveAs(“tif” );
// }
run(“8-bit”);
makeRectangle(1608, 3380, 1500, 1500);
run(“Crop”);
run(“Enhance Contrast”, “saturated=0.5 normalize”);
setAutoThreshold();
//run(“Threshold…”);
//setTool(11);
setThreshold(0, 85);
run(“Convert to Mask”);
run(“Analyze Particles…”, “display clear summarize”);
selectWindow(“Results”);
a = Table.getColumn(“Area”);
close(“Results”);
Array.getStatistics(a, mi, mx, mn, std);
selectWindow(“Summary”);
Table.set(“STD”, nResults, std);
Table.update;

{
run(“Input/Output…”, “txt”);
saveAs(“txt”);
}

//cleanUp();

// Closes the “Results” and “Log” windows and all image windows
//function cleanUp() {
// requires(“1.30e”);
// if (isOpen(“Results”)) {
// selectWindow(“Results”);
// run(“Close” );
// {
// if (isOpen(“Summary”)) {
// selectWindow(“Summary”);
// run(“Close” );
// }
// while (nImages()>0) {
// selectImage(nImages());
// run(“Close”);
// }
//}
but still i did not get the STD on summary sheet.
Your idea will be very helpfull for me…

image
image
image


#18

Yes herbie we want to see the pore size at fixed threshold for white surface. We measure the 0-85 (black to gray) hole. It indicates the level of porosity of my system…

You didn’t get the point …

Does my demo macro run for you?
Did you really try?

Please update your ImageJ installation to the current version 1.52h.

Herbie


#20

On the 1.46r version the plugins contains the text file and its working but in the 1.52h is not possible. can you guide me what should i have to do for updated version so that i can install plugins.

I have no idea what you mean.
What plugins are you speaking of?
What text file do you mean?
What is working exactly and what is not?

Macro is working, when i install the macro then there is no problem but you know macro is install only for short time and then agin recall when the software has closed.

Please learn about “startup macros” and how to call a macro by a keyboard shortcut.
For this purpose please study: https://imagej.nih.gov/ij/developer/macro/macros.html

It’s your turn now

Herbie