Skip to content

Instantly share code, notes, and snippets.

@miura
Created October 18, 2012 11:06
Show Gist options
  • Save miura/3911066 to your computer and use it in GitHub Desktop.
Save miura/3911066 to your computer and use it in GitHub Desktop.
EMBO Hight-Throughput Microscopy Course, p11 final.ijm
// This part taken from "for loop macro"
orgName = getTitle();
run("Split Channels");
c1 = "C1-" + orgName;
c2 = "C2-" + orgName;
//newly added
selectWindow(c1);
c1ID = getImageID();
selectWindow(c2);
c2ID = getImageID();
//segmentation macro
options = "title=dup.tif duplicate range=1-” + nSlices;
run("Duplicate...", options);
dupID = getImageID();
run("Gaussian Blur...", "sigma=1.50 stack");
setAutoThreshold("Otsu dark");
run("Convert to Mask", "method=Otsu background=Dark calculate black");
setAutoThreshold("Otsu dark");
run("Analyze Particles...", "size=800-Infinity pixel circularity=0.00-1.00 show=Masks display exclude clear include stack");
dilateID = getImageID();
run("Invert LUT");
options = "title=erode.tif duplicate range=1-” + nSlices;
run("Duplicate...", options);
erodeID = getImageID();
run("Options...", "iterations=3 count=1 black edm=Overwrite do=Nothing");
selectImage(dilateID);
run("Dilate", "stack");
selectImage(erodeID);
run("Erode", "stack");
imageCalculator("Difference create stack", dilateID, erodeID);
// newly added
rimID = getImageID();
// This part taken from "for loop macro"
opt ="area mean standard min integrated stack limit redirect=["+c1+"] decimal=2";
run("Set Measurements...", opt);
selectImage(rimID); // changed from selectWindow to selectImage
for (i =0; i < nSlices; i++){
setSlice(i+1);
run("Create Selection");
run("Make Inverse");
run("Measure");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment