0

我正在尝试在 ImageJ 中对文件夹中的所有文件运行 Thunderstorm 插件。执行本地化并获得结果后,我想将结果导出到 csv 文件中,以便 csv 文件的第一部分包含图像名称。这是我的脚本:

    dir=getDirectory("Choose a Directory");
    datapaths=getFileList(dir);
      for(i = 0; i < datapaths.length; i++) { 
       if (endsWith(datapaths[i], ".tif")) {
        open(datapaths[i]);
        run("Run analysis", "filter=[Wavelet filter (B-Spline)] scale=2.0 order=3 detector=[Local maximum] connectivity=4-neighbourhood threshold=std(Wave.F1) estimator=[PSF: Gaussian] sigma=0.8 fitradius=2 method=[Maximum likelihood] full_image_fitting=false mfaenabled=true keep_same_intensity=false nmax=2 fixed_intensity=true expected_intensity=500:2500 pvalue=1.0E-6 renderer=[No Renderer] magnification=5.0 avg=0 colorizez=false threed=false repaint=50");
        run("Export results", "filepath=["+datapaths[i]+"data.csv] fileformat=[CSV (comma separated)] sigma=true intensity=true offset=true saveprotocol=true x=true y=true bkgstd=true id=false uncertainty=true frame=true");
    }
   }

我确定我在“导出结果”、“filepath=[”+datapaths[i]+“data.csv] 部分中犯了一些错误。即使浏览了有关该主题的 8 个帖子,我也无法修复这个错误。请指教。

谢谢,

4

1 回答 1

0

这是解决方案。

    dir=getDirectory("Choose a Directory");
    datapaths=getFileList(dir);
    for(i = 0; i < datapaths.length; i++) { 
       if (endsWith(datapaths[i], ".tif")) {
          dpaths=dir + datapaths[i];
          open(datapaths[i]);
          run("Run analysis", "filter=[Wavelet filter (B-Spline)] scale=2.0 order=3 detector=[Local maximum] connectivity=4-neighbourhood threshold=std(Wave.F1) estimator=[PSF: Gaussian] sigma=0.8 fitradius=2 method=[Maximum likelihood] full_image_fitting=false mfaenabled=true keep_same_intensity=false nmax=2 fixed_intensity=true expected_intensity=500:2500 pvalue=1.0E-6 renderer=[No Renderer] magnification=5.0 avg=0 colorizez=false threed=false repaint=50");
          run("Export results", "filepath=["+dpaths+"data.xls] fileformat=[XLS (tab separated)] sigma=true intensity=true offset=true saveprotocol=true x=true y=true bkgstd=true id=false uncertainty=true frame=true");
          print(dir + dpaths);
          }
       }
于 2017-06-18T23:47:50.180 回答