Skip to content

Instantly share code, notes, and snippets.

@mutterer
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mutterer/9834369 to your computer and use it in GitHub Desktop.
Save mutterer/9834369 to your computer and use it in GitHub Desktop.
resetThreshold();
run("Remove Overlay");
n = roiManager("count");
Dialog.create("Choix");
Dialog.addChoice("paramètre", newArray("Area","Mean","Circ."),"");
Dialog.show();
param = Dialog.getChoice();
m=moy(param);
for (i=0;i<n;i++) {
roiManager("select",i);
if (getResult(param,i)<m) {
run("Properties... ", "name=[] position=none stroke=none width=0 fill=red");
} else {
run("Properties... ", "name=[] position=none stroke=none width=0 fill=green");
}
run("Add Selection...");
}
run("Select None");
function moy(param) {
n = roiManager("count");
t=0;
for (i=0;i<n;i++) {
t=t+getResult(param,i);
}
return (t/n);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment