Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
737 views
in Technique[技术] by (71.8m points)

javascript - ImageJ jar file plugin shortcut creation - More help needed

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...