ImageJ에서 열린 이미지를 처리하는 데 도움이 필요합니다.

ImageJ에서 열린 이미지를 처리하는 데 도움이 필요합니다.

나는 내 사진의 입자 영역을 분석하고 결과 창의 영역 열을 내 클립보드에 자동으로 복사하고 모든 창을 닫을 것인지 묻는 창을 표시하는 매크로(내가 본 다른 매크로를 기반으로)를 만들었습니다.

ImageJ에서 열린 사진에 이 매크로를 적용하고 단일 결과 창에서 모든 결과(주로 영역)를 얻을 수 있는지 알고 싶습니다. 내 폴더에는 각 균주에 대한 결과를 별도로 얻기 위해 서로 별도로(다른 미생물 균주) 분석해야 하는 사진 세트가 포함되어 있기 때문에 일괄 처리 기능을 사용할 수 없습니다.

현재 내 매크로는 다음과 같습니다. 정말 보기 흉하지만 상당히 잘 작동합니다.

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");
    }
}

관련 정보