Automating "XOR" analysis of dilated and eroded images

fiji
imagej
macro

#1

Hello ,

I am analyzing flourescence around bugs in cells. For this I make rings around bugs in which I quantitate the mean fluorescence intensity. My method runs fine for a single image which means I have is to individually process 100 files. I tried to automate this using macro.ijm but to do it for many files just isn’t working. Below is the recorded macro for one file:

open(“C:/alka/IF/21.9.17/21.9.17-tiff/input/Thresh-1.tif”);

run(“Dilate”);

saveAs(“Tiff”, “C:/alka/IF/21.9.17/21.9.17-tiff/output/Thresh-1-dil.tif”;);

run(“Erode”);

saveAs(“Tiff”, “C:/alka/IF/21.9.17/21.9.17-tiff/output/Thresh-1-ero.tif”);

open(“C:/alka/IF/21.9.17/21.9.17-tiff/output/Thresh-1-dil.tif”);

imageCalculator(“XOR create”, “Thresh-1-dil.tif”,“Thresh-1-ero.tif”);

selectWindow(“Result of Thresh-1-dil.tif”);

run(“ROI Manager…”);

roiManager(“Show All with labels”);

run(“Analyze Particles…”, “show=Outlines clear add”);

selectWindow(“Result of Thresh-1-dil.tif”);

selectWindow(“Drawing of Result of Thresh-1-dil.tif”);

open(“C:/alka/IF/21.9.17/21.9.17-tiff/violet/vio-1.tif”);

selectWindow(“Drawing of Result of Thresh-1-dil.tif”);

selectWindow(“vio-1.tif”);

run(“From ROI Manager”);

roiManager(“Measure”);

selectWindow(“Drawing of Result of Thresh-1-dil.tif”);

saveAs(“Results”, “C:/alka/IF/21.9.17/21.9.17-tiff/output/Results-1.csv”);

Can anyone please help to automate this for many files?

Thanks,

Alka.