Skip to content

Instantly share code, notes, and snippets.

@mutterer
Last active February 18, 2021 20:39
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/035ade419bf9c96475ce to your computer and use it in GitHub Desktop.
Save mutterer/035ade419bf9c96475ce to your computer and use it in GitHub Desktop.
Hexagon_rois_average.ijm
run("Fresh Start");
run("Options...", "iterations=1 count=1 black");
run("Boats");
setBatchMode(true);
run("Duplicate...","title="+getTitle);
makeOval(100,100,300,300);
w=getWidth;h=getHeight;
roiManager("add");
newImage("temp", "8-bit black", w, h, 1);
size = 10;
for (y=0;y<h/size;y++)
for (x=0;x<w/size;x++)
setPixel (x*size+(y%2)*size/2,y*size,255);
run("Voronoi");
setThreshold(0,1)
run("Make Binary");
roiManager("select",0);
run("Analyze Particles...", "display exclude clear add");
close();
setOption("Show All",true);
run("Restore Selection");
roiManager("add");
for (i=0;i<nResults-1;i++) {
roiManager("select",i);
run("Enlarge...", "enlarge=0.5");
getStatistics(area, mean, min, max, std, histogram);
setColor(mean);
fill();
}
setOption("Show All",false);
run("Select None");
setBatchMode(false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment