如何从 Python 3.4.2 控制 ImageJ

how to control ImageJ from Python 3.4.2

我正在尝试使用 Python 3.4.2 来控制 ImageJ

我想做的是来自 python 代码 , 我想向 imageJ 发送命令以分析一些图像、检测边缘、对比度、噪声等 这里有一个类似的问题 How to connect ImageJ to python? 但是没有答案,比如"install this, and control the Find Edges button with this command"

我想知道我该怎么做,有人可以帮助我吗

我找到了这个 link, and this link,他们说可以使用 "import ij" 但是没有我可以使用或安装的 ij 库。

还有 ImageJ website 在 "How can I call ImageJ from my software?" 中指出 "If your software is written in another language such as C or Python, there are many ways to integrate Java functionality. You must choose which one is best for your particular requirements." 但没有具体说明

这个 Google webpage 说 "py4ij" 我可以用 python "Py4IJ - Python for ImageJ - plugin and IDE that allows Python and Jython access to the ImageJ"

控制 imagej

但我不确定如何运行,求助

作为 Imagej 的替代品是斐济,但我不确定 python 是否可以控制它,或者我必须使用 Fiji, and Fiji tutorial

我最后的选择是使用 OpenCV 进行图像处理,但我实际上需要使用 ImageJ 或 Fiji,因此 OpenCV 不是有效答案

谢谢

编辑

根据第一个答案,建议写一个CellProfiler的RunImageJ模块,但我的问题是我必须安装CellProfiler吗?来自 here, following the examples here and here and running the module

或者我应该遵循 this link

的原生 Python 想法

无论如何第一个答案link讲的是Jython,但是我不会用Jython,它的最新版本是基于python2.7的,我用的是3.4,还有jython 没有开发 3.x

帮助

最近在新的 ImageJ 论坛上讨论了 Python 与 ImageJ 的集成;请参阅 Python scripting 主题。

虽然它侧重于从 ImageJ 调用 NumPy 等原生代码包装的 Python 模块,但一些解决方案也解决了相反的方向(从 Python 调用 ImageJ),特别是CellProfiler 的 RunImageJ 模块。正如那里所讨论的那样,专门的程序员可以从那里开始,并为社区的利益拥护一个更通用的解决方案。

一般来说,Python page, particularly the section on limitations 上的 ImageJ wiki 上讨论了这个问题。