ImageJ jar file plugin shortcut creation - More help needed

爷,独闯天下 提交于 2019-12-11 18:13:08

问题


I've been trying to automate cell counting on ImageJ/Fiji using an plugin called ITCN. This problem has come up on the forum before (ImageJ jar file plugin shortcut creation) and I am having the same unresolved problem.

If I code a script using javascript as follows:

imp = IJ.getImage();

IJ.run(imp, "Invert", "");
IJ.run(imp, "16-bit", "");
IJ.run(imp, "8-bit", "");
IJ.run(imp, "Median...", "radius=2");

runner = new ITCN_Runner( imp,
                          11, /* width*/
                          5.5, /* minimum distance */
                          0.7, /* threshold */
                          true, /* detect dark peaks */
                          null /* mask ImagePlus */ )
runner.run()

then I get the error message:

ReferenceError: "ITCN_Runner" is not defined. (<Unknown source>#8) in <Unknown source> at line number 8

I am very (VERY!) new to programming and Fiji. So I am not quite sure what the problem is. Does anyone have any comments or suggestions?

Thanks so much for your help!

Eric


回答1:


Your are just missing to import the ITCN_Runner class at the very beginning of your Javascript:

importClass(Packages.ITCN_Runner);

(provided that ITCN_1_6_.jar is in your classpath, e.g. in ./Fiji.app/plugins/)

See the Javascript scripting documentation for more help.



来源:https://stackoverflow.com/questions/21997613/imagej-jar-file-plugin-shortcut-creation-more-help-needed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!