Posted by
David Pirotte on
Sep 29, 2015; 6:37am
URL: http://imagej.273.s1.nabble.com/imagej-scripting-using-kawa-can-t-use-plugins-tp5014487.html
Hello,
Scripting using higher level languages such as Kawa [an/or Clojure], I
can't make things happen so that I can use plugins
I am using Kawa (1) but please note that what is described in this report
also fails using clojure, since the problem is 'with/within' the ImageJ 'eco
system' itself (2), not 'with/within' these higher level languages.
1] Short story:
No matter what higher level programing language I use, I am unable to use any
plugins, neither using Kawa nor using Clojure.
I generally can do most, but not everything, of what is defined in the imagej core
jar (3) - but nothing that is defined in plugins.
A quick look at the imagej launcher code [note that my java knowledge is close to
zero], and it appears that, indeed, an impressive bit of magic occurs at launching
time:
I wonder if someone else did solve this problem [even if for clojure] and
would be happy to share the solution with me?
2] Example - "Non-local Means Denoising" (4)
Attached: nlm-small.png a small image to test
Code: ij-core.scm a kawa scheme very short snipset
( here -> )
http://paste.lisp.org/+3CB7 [ see at the end of ij-core.scm for a session example if would like to try
[ it, in which case you need kawa of course, then you would compile the
[ ij-core.scm file like this:
[ kawa -C ij-core.scm
[ -> ij$Mncore.class
My directory setting is:
~/lpdi/projects/kawa
images/
nlm-small.png
jars/
ij-1.49v.jar
ij.jar -> ij-1.49v.jar
NL_Means_1_3.jar
nl-mean.jar -> NL_Means_1_3.jar
ij-core.scm
ij$Mncore.class
Then cd to this location and here a trace of a simple session:
export CLASSPATH=.:./jars/ij.jar:./jars/nl-mean.jar
kawa
(import (ij-core))
(define iplus1 (ij-open "nlm-small.png"))
(ij-show iplus1)
(ij-run iplus1 "Non-local Means Denoising" "sigma=3")
->
Unrecognized command: "Non-local Means Denoising"
#!null
But Kawa sees the classes, here:
(module-classes "jars/nl-mean.jar")
->
jars/nl-mean.jar:
META-INF/
META-INF/MANIFEST.MF
de/
de/biomedical_imaging/
de/biomedical_imaging/ij/
de/biomedical_imaging/ij/nlMeansPlugin/
de/biomedical_imaging/ij/nlMeansPlugin/FastMathStuff.class
de/biomedical_imaging/ij/nlMeansPlugin/NLMeansDenoising_$WorkerDouble.class
de/biomedical_imaging/ij/nlMeansPlugin/NLMeansDenoising_$WorkerInt.class
de/biomedical_imaging/ij/nlMeansPlugin/NLMeansDenoising_.class
plugins.config
Plugins.config
...
Plugins, "Non-local Means Denoising", de.biomedical_imaging.ij.nlMeansPlugin.NLMeansDenoising_
Thanks for some usefull hint(s),
Cheers,
David
(1) menu driven, parameterized strings arguments
(2)
https://www.gnu.org/software/kawa/(3) I'm currently using ij149v.jar
(4)
https://github.com/thorstenwagner/ij-nl-means--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html