imageJ宏导出结果到csv

时间:2017-06-18 12:01:24

标签: csv macros export imagej fiji

我正在尝试在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个帖子,我也是无法解决这个错误。请告知。

谢谢,

1 个答案:

答案 0 :(得分: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);
          }
       }