Login  Register

Re: Disector counting frame Ooops Actually Count Frame Macro

Posted by Teresa W on May 21, 2010; 10:20am
URL: http://imagej.273.s1.nabble.com/Disector-counting-frame-tp3688237p3688241.html

Thanks guys for the interest, Fabrice, here's the Count Frame macro
(Subsampled a rectangle (0, 0, 356, 356) from my tiff image by using Contol-Shift-X)

saveAs("Tiff", "C:\\Documents and Settings\\Desktop\\scan.tif");
//setTool(0);
makeRectangle(0, 0, 236, 236);
run("Analyze Particles...", "size=0-Infinity circularity=0.00-1.00 show=Masks");
saveAs("Tiff", "C:\\Documents and Settings\\tfwegrzy\\Desktop\\Mask2.tif");
selectWindow("scan.tif");
//setTool(2);
makePolygon(356,0,236,0,236,236,0,236,0,356,356,356);
run("Analyze Particles...", "size=0-Infinity circularity=0.00-1.00 show=Masks");
saveAs("Tiff", "C:\\Documents and Settings\\Desktop\\Mask3.tif");
selectWindow("scan.tif");
run("Analyze Particles...", "size=0-Infinity circularity=0.00-1.00 show=Masks exclude");
selectWindow("Mask3.tif");
imageCalculator("Subtract", "Mask3.tif","Mask of scan.tif");
//run("Image Calculator...", "image1=Mask3.tif operation=Subtract image2=Mask of scan.tif");
run("Save", "save=[C:\\Documents and Settings\\Desktop\\Mask3.tif]");
imageCalculator("Add", "Mask2.tif","Mask3.tif");
//run("Image Calculator...", "image1=Mask2.tif operation=Add image2=Mask3.tif");
run("Save", "save=[C:\\Documents and Settings\\Desktop\\Mask2.tif]");
imageCalculator("Add", "Mask2.tif","Print_frame.tif");
//run("Image Calculator...", "image1=Mask2.tif operation=Add image2=Print_frame.tif");
run("Save", "save=[C:\\Documents and Settings\\Desktop\\Mask2.tif]");
run("Analyze Particles...", "size=0-Infinity circularity=0.00-1.00 show=Masks display exclude summarize");