ImageJ で開いた画像の処理にヘルプが必要

ImageJ で開いた画像の処理にヘルプが必要

私は、画像内の粒子領域を分析し、結果ウィンドウの領域列を自動的にクリップボードにコピーし、すべてのウィンドウを閉じるかどうかを尋ねるウィンドウを表示するマクロを作成しました (これまでに見たさまざまなマクロに基づいています)。

このマクロを ImageJ で開いた画像に適用して、すべての結果 (主に領域) を 1 つの結果ウィンドウに表示できるかどうか知りたいです。フォルダーには、菌株ごとに結果を個別に取得するために、互いに個別に分析する必要がある画像セット (微生物の異なる菌株) が含まれているため、バッチ処理機能は使用できません。

これが現時点での私のマクロです。見苦しいのは承知していますが、かなりうまく機能します。

run("8-bit");
run("Threshold...");
waitForUser;
getThreshold(lower,upper);
if (lower==-1)
    exit("Threshold was not set");
run("Convert to Mask");
run("Fill Holes");
run("Set Scale...", "distance=2.87 known=1 unit=µm global");
run("Analyze Particles...", "size=30-Infinity display exclude add");
close();
closeWin("ROI Manager");
closeWin("Threshold");
closeWin("Log");
String.resetBuffer;
  for (i=0; i<nResults; i++)
      String.append(getResult("Area", i) + "\n");
  String.copy(String.buffer);
waitForUser("Work done", "WORK DONE: Close all windows?");
if (isOpen("Results")) {
         selectWindow("Results"); 
         run("Close" );

function closeWin(winName)
{
    if (isOpen(winName)) 
    {
        selectWindow(winName);
        run("Close");
    }
}

答え1

最終的に私はそれを行うことができました、もし誰かが興味を持っているなら、ここにコードがあります:

for (i=1; i<=nImages; i++) {
    selectImage(i);
    run("8-bit");
    run("Threshold...");
    waitForUser;
    getThreshold(lower,upper);
    if (lower==-1)
        exit("Threshold was not set");
    run("Convert to Mask");
    run("Fill Holes");
    run("Set Scale...", "distance=2.87 known=1 unit=µm global");
    run("Analyze Particles...", "size=30-Infinity display exclude add");
}
close("*");
closeWin("ROI Manager");
closeWin("Threshold");
closeWin("Log");
String.resetBuffer;
  for (i=0; i<nResults; i++)
      String.append(getResult("Area", i) + "\n");
  String.copy(String.buffer);
waitForUser("Work done", "WORK DONE: Close all windows?");
if (isOpen("Results")) {
         selectWindow("Results"); 
         run("Close" );

function closeWin(winName)
{
    if (isOpen(winName)) 
    {
        selectWindow(winName);
        run("Close");
    }
}

関連情報