如何从当前文件夹的终端运行imageJ?

时间:2018-05-21 19:41:34

标签: terminal macros imagej fiji

我需要在macOS上从终端运行斐济(imageJ)脚本。使用下面的代码。

/Applications/Fiji.app/Contents/MacOS/ImageJ-macosx --headless -macro ~/desktop/testing.ijm.ijm

我需要运行的斐济脚本是

dir = getDirectory("Where I need help");
run("Image Sequence...", "open=dir");
path=dir+"needsave.avi";
run("AVI... ", "compression=JPEG frame=5 save=&path");
close();

但是我想将目录作为终端中的当前位置。 例如:

MYs-MBP:~ csh;
[MYs-MBP:~] cd desktop/test/test2
[MYs-MBP:~/desktop/test/test2] /Applications/Fiji.app/Contents/MacOS/ImageJ-macosx --headless -macro ~/desktop/testing.ijm.ijm

因此我将使用我编写的斐济脚本处理test2中的所有内容。

1 个答案:

答案 0 :(得分:1)

使用此宏命令:

cwd = call("java.lang.System.getProperty", "user.dir");

请注意,此问题已交叉发布到ImageJ邮件列表(1)和ImageJ论坛(2)。

将来,当交叉发布时,请链接到您提出问题的所有其他地方,以保护回答您问题的人的时间。