Posted by
Wayne Rasband-2 on
Dec 13, 2018; 2:39am
URL: http://imagej.273.s1.nabble.com/Analyze-Particles-Overlay-problems-tp5021557p5021565.html
> On Dec 12, 2018, at 5:12 AM, Stein Rørvik <
[hidden email]> wrote:
>
> I want to run Analyze Particles on a stack, but only on specific slices.
> I want the results (which particles were analyzed or not) to be shown as an overlay.
> If I say yes to process all slices, the results are as expected:
> There is an individual overlay for each slice.
>
> But if I want to analyze a single slice, the result overlay is "global"; that is, one overlay for the entire stack. So when I process another slice, the previous result overlay is lost. I think the overlay should have been applied to a single slice position in this case as well.
>
> Am I missing an option somewhere? Or is this a bug?
It’s a bug that is fixed in the daily build (1.52j26). The following example runs the particle analyzer on two slices of a stack and set the overlay color to red.
-wayne
run("T1 Head (2.4M, 16-bits)");
setThreshold(150, 65535);
setSlice(60);
run("Analyze Particles...", "size=400 show=Overlay slice");
setThreshold(250, 65535);
setSlice(62);
run("Analyze Particles...", "size=400 show=Overlay slice");
resetThreshold;
for (i=0; i<Overlay.size; i++) {
Overlay.activateSelection(i);
Roi.setStrokeColor("red");
Roi.setStrokeWidth(1);
}
Roi.remove;
Overlay.setFontSize(18);
run("In [+]"); run("In [+]”);
> Also, I cannot figure out where in the preferences/options to set the result overlay colors (outline color and label color), nor how to do this in a macro.
>
> Demo macro, illustrating what I want to do:
> ------------------------------
>
> //analyze entire stack
> run("T1 Head (2.4M, 16-bits)");
> setThreshold(350, 65535);
> run("Analyze Particles...", "size=10-Infinity pixel show=Overlay stack");
> setSlice(nSlices/2);
> //results are as expected; an individual overlay for each slice
>
> //analyze slice 30 and 60
> run("T1 Head (2.4M, 16-bits)");
> setThreshold(350, 65535);
> setSlice(30);
> run("Analyze Particles...", "size=10-Infinity pixel show=Overlay slice");
> setSlice(60);
> run("Analyze Particles...", "size=10-Infinity pixel show=Overlay slice");
>
> setSlice(30);
> //problem: overlay is per stack, not per slice, so the result overlay for slice 30 was lost
>
> run("Tile");
>
> ------------------------------
>
> I am using daily build ImageJ 1.52j with Java 1.6 on Windows 7/64-bit.
>
>
> Stein
>
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html