0
我對imageJ中的批量圖像處理非常新穎。我有一個宏,它允許我在一個目錄中處理多個圖像。問題在於宏爲每個處理後的圖像生成一個單獨的摘要窗口,讓我手動將所有輸出數據編譯爲一個.csv或.xls。我寧願將所有彙總數據自動編譯爲一個文件。雖然我發現有幾個來源顯示如何做到這一點,但在我的情況下,它並沒有特別有用。如何保存多個彙總文件批處理宏imageJ
如果你能幫忙,我會非常感激。
下面是代碼的縮寫例如:
dir1 = getDirectory("Choose Source Directory ");
dir2 = getDirectory("Choose Destination directory");
list = getFileList(dir1);
setBatchMode(true);
for (i=0; i<list.length; i++){
print (list[i]);
open(dir1+list[i]);
name=File.nameWithoutExtension;
//Prepare the image by removing any scale and making 8-bit
run("Set Scale...", "distance=237.3933 known=1 pixel=1 unit=cm
global");
makeRectangle(4068, 5940, 1572, 1320);
run("Crop");
// Convert the image into RGB channels for proper thresholding
run("RGB Stack");
setSlice(3);
//Threshold
setAutoThreshold("Default");
// Analyze particles
// Provides total area of number of cotyledons in image
run("Analyze Particles...", "size=60-Infinity pixel display include
summarize");
run("Revert");
}
//Save the results
selectWindow("Summary");
saveAs("Results", dir2+"Results.xls");