Login  Register

Re: Analyze particle & Flood fill

Posted by Gabriel Landini on Dec 10, 2005; 12:51pm
URL: http://imagej.273.s1.nabble.com/Analyze-particle-Flood-fill-tp3704248p3704251.html

Hi Pilippe,

On Saturday 10 December 2005 09:25, Philippe Grosjean wrote:

> Yes, wasn't it what I said: flood fill eliminates holes in the blobs.

The problem is that the language to describe the procedure is unclear (at
least to me).
You suggested to change the option to "Fill holes":

>option should better be spelled '[] Fill holes'

"Eliminate" may mean that they are "not counted as set" but (in binary images)  
that "they are filled with the foreground colour". If holes usually contain
"not set", in a binary image one eliminates the "not set" by doing
not(not(set))==set. (i.e. inverting the "not-set").
"Flood fill" is I guess flood filling the particle and probably means that
holes are not counted as area.
But if you run the Binary>Fill holes, then they are filled with the foreground
colour and they become part of the particle. So it is still a confusing
terminology.

If one calculates the area of a slice of cheese before and after filling the
holes, I would tend to think that the one without holes (i.e. "filled") has a
larger area (or, if the holes are there, there is less cheese!). :-)

> Hummm, I just double-check this (I use to check myself, and not to trust
> the documentation too much, and I remember I did not care about "Limit
> to threshold" in particle analysis, but don't remember why). Here is the
> result on a particle with a hole in it:
>                  Area   Mean  Skew    Kurt
> FF - LTT        6569   209   -0.579  -0.122
> FF - no LTT     6569   209   -0.579  -0.122
> no FF - LTT     6815   210   -0.471  -0.155
> no FF - no LTT  6815   210   -0.471  -0.155

This is odd. I double checked too and my results do not agree with yours:

//Test_1 "Limit" and "not Flooding"
run("Colors...", "foreground=white background=black selection=yellow");
run("Options...", "iterations=1 black count=1");
newImage("test", "8-bit Black", 200, 200, 1);
makeOval(40, 28, 139, 139);
run("Draw");
run("Select None");
run("Dilate");
setAutoThreshold();
run("Set Measurements...", "area limit redirect=None decimal=3");
run("Analyze Particles...", "size=1-999999 circularity=0.00-1.00 show=Nothing
display clear record");
//--------------------------
        Area XStart Ystart
1 1668 100 27

//--------------------------

//Test_2 "not Limit" and "not Flooding"
run("Colors...", "foreground=white background=black selection=yellow");
run("Options...", "iterations=1 black count=1");
newImage("test", "8-bit Black", 200, 200, 1);
makeOval(40, 28, 139, 139);
run("Draw");
run("Select None");
run("Dilate");
setAutoThreshold();
run("Set Measurements...", "area redirect=None decimal=3");
run("Analyze Particles...", "size=1-999999 circularity=0.00-1.00 show=Nothing
display clear record");
//--------------------------
        Area XStart Ystart
1 16036 100 27

//--------------------------
// Test_3 "Limit" and "Flooding"
run("Colors...", "foreground=white background=black selection=yellow");
run("Options...", "iterations=1 black count=1");
newImage("test", "8-bit Black", 200, 200, 1);
makeOval(40, 28, 139, 139);
run("Draw");
run("Select None");
run("Dilate");
setAutoThreshold();
run("Set Measurements...", "area limit redirect=None decimal=3");
run("Analyze Particles...", "size=1-999999 circularity=0.00-1.00 flood
show=Nothing display clear record");
//--------------------------
        Area XStart Ystart
1 1668 100 27

//--------------------------
// Test_4 "Not Limit" and "Flooding"
run("Colors...", "foreground=white background=black selection=yellow");
run("Options...", "iterations=1 black count=1");
newImage("test", "8-bit Black", 200, 200, 1);
makeOval(40, 28, 139, 139);
run("Draw");
run("Select None");
run("Dilate");
setAutoThreshold();
run("Set Measurements...", "area  redirect=None decimal=3");
run("Analyze Particles...", "size=1-999999 circularity=0.00-1.00 flood
show=Nothing display clear record");
//--------------------------
        Area XStart Ystart
1 1668 100 27
//--------------------------


Three of the tests return the same result, unlike the results you posted.

In the case of "Limit, not Flooding", the user may be thinking that by "not
flooding" is counting the area of the holes as part of the particle, but it
is not so. The "Limit" option seems to take precedence over the setting of
the "Flood" option.
In the examples above, it seems that if "Limit" is on, then "Flooding" setting
does not do anything.
That is why in the results above Test_1 gives the same result as Test_3 &
Test_4.

Would it be sensible to relegate "Limit" to just "Measure" and have no
influence over "Flooding"?

> This is when I redirect to a 8bit grayscale picture, but the result is
> the same without redirection (just Skew & Kurt is not usable in that case).

Maybe this is the source of problems.
The above is without redirecting & there is only a single binary image.

> So, this confirm to me that LTT (Limit to threshold) has no effect in
> particle analyzer. So, there is no clash between "Flood fill" and "Limit
> to threshold": they are used in different contexts.

And the above confirms to me that there is an effect :-)

Just for the record, I am using the latest 1.35j under suse linux with Java
1.5.0_06.

If it is not too much trouble could you run those test with your set up and
report what you get?

Regards,

Gabriel