// Action Bar description file :nuclei_counter
run("Action Bar","/plugins/ActionBar/nuclei_counter.txt");
exit();

<line>
<button>
label=stack
icon=noicon
arg=<macro>
run("Images to Stack");
setRGBWeights(0, 1, 0);
run("8-bit");
</macro>

<button>
label=next
icon=noicon
arg=<macro>
run("Next Slice [>]");
call ("ij.Prefs.set","NB.bgset",0);
resetThreshold();
run("Select None");
setTool(0);
</macro>

<button>
label=backgnd
icon=noicon
arg=<tool>
r=100;
getCursorLoc(x, y, z, modifiers);
makeOval(x-r/2,y-r/2,r,r);
getStatistics(area, mean, min, max, std, histogram);
call ("ij.Prefs.set","NB.bg",mean);
print ("Background set to :"+call ("ij.Prefs.get","NB.bg",0));
call ("ij.Prefs.set","NB.bgset",1);
</tool>

</line>

<line>
<button>
label=rect
icon=noicon
arg=<macro>
setTool(0);
</macro>

<button>
label=autoT
icon=noicon
arg=<macro>
if (selectionType()==0) resetThreshold();
getThreshold (up,low);
if ((up>-1)&&(low>-1)) run("Create Selection");
setAutoThreshold();
run ("Select None");
</macro>

<button>
label=crop
icon=noicon
arg=<macro>
getSelectionBounds(x, y, width, height);
t=getInfo("slice.label")+"-"+x+"-"+y+"-"+width+"-"+height;
run("Duplicate...", "title="+t);
</macro>

<button>
label=measure
icon=noicon
arg=<tool>
bgset = call ("ij.Prefs.get","NB.bgset",0);
if (bgset==0) exit ("use the BG tool before any measurement");
getCursorLoc(x, y, z, modifiers);
doWand(x,y);
run("Measure");
setResult ("BG",nResults-1,call ("ij.Prefs.get","NB.bg",0));
updateResults();
</tool>

<button>
label=reset
icon=noicon
arg=<macro>
resetThreshold();
run("Select None");
</macro>



</line>
// end of file
<onTop>
<DnD>
<startupAction>
run("Set Measurements...", "area mean standard min bounding integrated limit display redirect=None decimal=3");
</startupAction>
