0

我确实imagej在不同的数据集上运行了数百次插件。我使用一个调用imagej每个数据集的 shell 脚本:

#!/usr/bin/env bash
FIJI=/home/user_name/Fiji.app/ImageJ-linux64
MACRO=/home/user_name/fiji_macros/Peakfit_macro.ijm
DATASRC=$(realpath data_folders.txt)
CWD=$(pwd)
while read DIR
do
    cd ${DIR}
    ${FIJI} --no-splash --console -macro ${MACRO}
done < ${DATASRC}
cd ${CWD}

宏调用创建结果窗口的插件,然后宏将其内容写入文件。

是否有(插件独立)方法来防止结果窗口在前台弹出?也许打开它最小化或在后台?

宏如下所示:

ImgNumber=0;
ImgFormat= ".tif";
Settings="/home/user_name/peakfit/gdsc.smlm.settings.xml"
//determine working directory
WorkDir = exec("pwd");
// get rid of the "\n" at the end
WorkDir = substring(WorkDir, 0, lengthOf(WorkDir)-1);

list = getFileList(WorkDir);
params = " <plugin parameters>";

setBatchMode(true);
//loop to sequentially open images
for (i=0; i<list.length; i=i+1) {
    if (endsWith(list[i], ImgFormat)) {
        ImgNumber=ImgNumber+1;
        full = WorkDir + File.separator + list[i];
        open(full);
        print(full + " loaded.");
        run("Peak Fit", "config_file=" + Settings + params);
        // save result to csv;
        selectWindow("Fit Results");
        saveAs("results", full + ".peakfit.csv");
        // close images
        close("*");
        // close results window
        close("Fit Results");
    }
}

print("All done - " + ImgNumber + " images processed");
// save logfile
LogName = "peakfit.log"; 
selectWindow("Log");
saveAs("text", WorkDir + File.separator + LogName);
// exit
eval("script", "System.exit(0);");
4

0 回答 0