Skip to content

Instantly share code, notes, and snippets.

@tarokiritani
Created March 10, 2017 15:09
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 tarokiritani/ecfb9cc706db9ef9f773f4f6ff35fa1f to your computer and use it in GitHub Desktop.
Save tarokiritani/ecfb9cc706db9ef9f773f4f6ff35fa1f to your computer and use it in GitHub Desktop.
a helper imagej macro for counting objects in 3D
roiManager("Show All");
run("Remove Overlay");
for (i=0; i<roiManager("count"); i++){
roiManager("select",i);
roiManager("Measure");
x=getResult("X");
y=getResult("Y");
z=getResult("Slice");
for (j=-14; j<14; j++){
setSlice(z+j);
makeRectangle(x-10,y-10,20,20);
run("Add Selection...");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment