Last active
February 18, 2021 20:39
-
-
Save mutterer/035ade419bf9c96475ce to your computer and use it in GitHub Desktop.
Hexagon_rois_average.ijm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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