2017-09-15 11 views
0

imageJでバッチ処理を行うのは初めてです。私は1つのディレクトリに複数の画像を処理するマクロを持っています。問題は、マクロが処理された各イメージの個別要約ウィンドウを生成し、すべての出力データを1つの.csvまたは.xlsに手動でコンパイルすることです。すべての要約データを自動的に1つのファイルにコンパイルすることをお勧めします。私はこれを行う方法を示すいくつかの情報源を見つけましたが、それは私の状況では特に役に立ちませんでした。複数の要約ファイルを保存する方法バッチ処理マクロ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"); 

答えて

0

(とImageJの2.0.0-RC-61のMacOS 10.12.6オン/ 1.51n)、繰り返し集計を有する粒子を分析実行オプションをオンにすると、サマリーが既存のサマリウィンドウに追加され、最後に1つのファイルとして保存されます。例えば

、次のマクロは、二つの要約行を生成し、それらを保存します

setBatchMode(true); 
run("Blobs (25K)"); 
setAutoThreshold("Default"); 
run("Analyze Particles...", "size=60-Infinity pixel display include summarize"); 
run("Boats (356K)"); 
setAutoThreshold("Default"); 
run("Analyze Particles...", "size=60-Infinity pixel display include summarize"); 
selectWindow("Summary"); 
saveAs("Results", "/Users/curtis/Desktop/Results.xls"); 
関連する問題