Python 3.x 从python以无头模式运行带有输入参数的ImageJ宏
我想从命令行调用imageJ宏。它使用文本文件作为输入。文本文件包含指向6个图像的路径。基于此,我使用以下命令Python 3.x 从python以无头模式运行带有输入参数的ImageJ宏,python-3.x,subprocess,imagej,Python 3.x,Subprocess,Imagej,我想从命令行调用imageJ宏。它使用文本文件作为输入。文本文件包含指向6个图像的路径。基于此,我使用以下命令 ./ImageJ-win64 --headless --console -macro E:\GitProgramSandboxes\headless.ijm 'input=E:\filelist.txt' filelist.txt包含图像文件的路径,如下所示 E:/20200828-220235-image-136000.png E:/20200828-220240-image-13
./ImageJ-win64 --headless --console -macro E:\GitProgramSandboxes\headless.ijm 'input=E:\filelist.txt'
filelist.txt包含图像文件的路径,如下所示
E:/20200828-220235-image-136000.png
E:/20200828-220240-image-136000.png
E:/20200828-220245-image-135000.png
E:/20200828-220252-image-126000.png
E:/20200828-220257-image-136000.png
E:/20200828-220302-image-126000.png
但是当我调用上面的命令时,宏抛出错误
Macro Error: Error: file not found in line 4
filestring = File . openAsString ( pathfile <)> ;
最后,如何使用subprocess在Python中传递此命令行参数
//headless
pathfile = getArgument();
setBatchMode(true);
filestring=File.openAsString(pathfile);
flist=split(filestring, "\n");