4Quant / ImgLib2-Notebooks

Scala Notebooks showing off ImgLib2
2 stars 1 forks source link

JavaScript Engine Not Found #1

Open kmader opened 8 years ago

kmader commented 8 years ago

when running the equation operation in

ij.log().info("-------- Fill in an image with a formula --------")
val formula = "10 * (Math.cos(0.3*p[0]) + Math.sin(0.3*p[1]))"
val sinusoid = ij.op().image().equation(blank, formula)

The following error is thrown

[INFO] -------- Fill in an image with a formula --------
[ERROR] Cannot create plugin: class='org.scijava.plugins.scripting.javascript.JavaScriptScriptLanguage', name='JavaScript', priority=0.0, enabled=true, pluginType=ScriptLanguage
java.lang.IllegalArgumentException: No such script engine: javascript
at org.scijava.script.AdaptedScriptLanguage.findFactory(AdaptedScriptLanguage.java:151)
    at org.scijava.script.AdaptedScriptLanguage.<init>(AdaptedScriptLanguage.java:73)
    at org.scijava.plugins.scripting.javascript.JavaScriptScriptLanguage.<init>(JavaScriptScriptLanguage.java:59)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at java.lang.Class.newInstance(Class.java:442)
    at org.scijava.plugin.PluginInfo.createInstance(PluginInfo.java:302)
    at org.scijava.plugin.DefaultPluginService.createInstance(DefaultPluginService.java:236)
    at org.scijava.plugin.DefaultPluginService.createInstances(DefaultPluginService.java:225)
    at org.scijava.plugin.DefaultPluginService.createInstancesOfType(DefaultPluginService.java:216)
    at org.scijava.plugin.AbstractSingletonService.initInstances(AbstractSingletonService.java:123)
    at org.scijava.plugin.AbstractSingletonService.getInstances(AbstractSingletonService.java:72)
    at org.scijava.script.DefaultScriptService.initScriptLanguageIndex(DefaultScriptService.java:342)
    at org.scijava.script.DefaultScriptService.scriptLanguageIndex(DefaultScriptService.java:307)
    at org.scijava.script.DefaultScriptService.getIndex(DefaultScriptService.java:117)
    at org.scijava.script.DefaultScriptService.getLanguageByName(DefaultScriptService.java:132)
    at net.imagej.ops.image.equation.DefaultEquation.compute1(DefaultEquation.java:87)
    at net.imagej.ops.image.equation.DefaultEquation.compute1(DefaultEquation.java:67)
    at net.imagej.ops.special.AbstractUnaryHybridOp.run(AbstractUnaryHybridOp.java:59)
    at org.scijava.command.CommandModule.run(CommandModule.java:201)
    at net.imagej.ops.OpUtils.run(OpUtils.java:59)
    at net.imagej.ops.OpEnvironment.run(OpEnvironment.java:126)
    at net.imagej.ops.image.ImageNamespace.equation(ImageNamespace.java:165)
kmader commented 8 years ago

Temporary solution by adding customer JavaScript dependency

load.ivy("de.christophkraemer" % "rhino-script-engine" % "1.1.0")