问题
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