> Dear All,
> I have particles (as white=255) with holes NOT included and some
> particles
> inside others, and a Result table.
> I want to label particles (fill the whole particle with a value) with
> some
> measure, for example Circularity.
> I first convert my image of particles to 32-bit.
>
> I would then like to floodFill each particle with its circularity ( a
> real
> number). My problem is that setForegroundColor(r, g, b) cannot be set
> to a
> real value. This does not seem to be the right solution.
>
> I can also divide my particles by 255 (then particles=1, background
> =0),
> select each particle with doWand, and multiply it by its Circularity.
> But
> then particles inside my particle are also multiplied.
>
> Any idea of how I could solve this problem ?
> Thanks in advance,
> Simon
Here is a macro that flood fills particles with their circularity. It
requires the v1.41d daily build, which fixes a bug in the setColor()
macro function that caused to always convert the argument to an
integer.
requires("1.41d");
run("Blobs (25K)");
run("Make Binary");
run("Set Measurements...", "area perimeter circularity decimal=3");
run("Analyze Particles...", "show=Nothing clear record");
run("32-bit");
for (i=0; i<nResults; i++) {
x = getResult('XStart', i);
y = getResult('YStart', i);
circularity = getResult('Circ.', i);
setColor(circularity);
floodFill(x, y);
}
run("Select None");
resetMinAndMax;
-wayne