【发布时间】:2014-05-02 08:40:15
【问题描述】:
如何在 imageJ 中使用 exec(),http://fiji.sc/ImageJ_tricks#Execute_external_programs?我可以使用 exec() 函数来启动外部 python 程序,例如:
exec("python", d:\py\program1.py");
是否可以从 python 返回一个图像数组给 exec?
【问题讨论】:
如何在 imageJ 中使用 exec(),http://fiji.sc/ImageJ_tricks#Execute_external_programs?我可以使用 exec() 函数来启动外部 python 程序,例如:
exec("python", d:\py\program1.py");
是否可以从 python 返回一个图像数组给 exec?
【问题讨论】:
exec() 宏函数是 hard coded 以返回 STDOUT,如 Curtis Rueden 的 answer to a similar question on the ImageJ mailing list 中所述。
但是,您可以通过脚本编辑器直接在斐济内部运行Python (or, for that matter, Jython) scripts,或者将它们放入Fiji.app/plugins/ 文件夹中。
【讨论】:
对于任何有兴趣在 imageJ 中使用其他 python 库的人,exec() 可以完成工作。使用:
exec("python", "d:\\pathtoyour\\pythonprogram.py");
使用 imageJ 脚本编辑器将其保存为 .ijm 文件。然后可以将其作为插件安装,以从 imageJ 启动您的 python 程序。
【讨论】: