首页 > 解决方案 > FIJI / ImageJ:如何在另一个插件中使用一个插件的类?

问题描述

我想使用这个类——它在ImageJAuto_Threshold中实现了“Auto Threshold”插件。根据http://imagej.net/Writing_plugins#The_Context,我可以访问其他插件功能,例如使用LogService

@Parameter
private LogService logService;

然而,这并不适用于所有事情。我试过了

@Parameter
private Auto_Threshold AutoThreshold

但这不起作用。我从https://github.com/fiji/Auto_Threshold/blob/Auto_Threshold-1.16.5/src/main/java/fiji/threshold/Auto_Threshold.java的源代码中看到该类存在于fiji.threshold包中。当然,我可以将该代码复制到我的源目录并使用该包。这是最好的做法,还是有更正式的方式来依赖另一个插件?

谢谢,罗里

标签: pluginsimagejfiji

解决方案


您可以使用 CommandService 可能:

@Parameter
private CommandService cs;

然后每当你想做某事时:

cs.run(OtherPlugin.class, true, ...)

推荐阅读