[ImageJ-devel] Macros and scripting in Imagej 2.0

Johannes Schindelin Johannes.Schindelin at gmx.de
Wed Sep 7 16:54:43 CDT 2011


Hi Grant,

On Wed, 7 Sep 2011, Grant B. Harris wrote:

> -- Scripting Languages
> 
> Our plan is to use the scripting engine in Java 6 (JSR-223 Scripting for 
> the Java Platform).  This enables us to be 
> polyglotic/language-agnostic... Jython, Closure, JavaScript, etc.

That's all good and well, but (correct me where I am wrong) JSR-223 does 
not support

	- single stepping
	- setting breakpoints
	- keeping states and evaluating incrementally
	- syntax highlighting

All of these are required for development. (We do not support any single 
stepping nor similar in the Fiji Script Editor yet, but that is something 
we need to fix).

> As mentioned in the chat, BeanShell is interesting for the fact that it 
> is syntactically very similar to the ImageJ Macro language - The Macro 
> Language is a DSL (domain specific language) for image processing and 
> manipulating the ImageJ environment.  "Porting" it to Beanshell (as 
> suggested by Dscho) sounds like a good idea.

But it is not at all without problems. The most urgent problem is that the 
macro language has this quite surprising feature that you can assign 
variables thusly:

	getDimensions(width, height, depth, channels, frames);

That is so out of line with C/Java like languages that it is impossible to 
support in Beanshell. I am currently looking into hacking the Beanshell 
interpreter to work around such problems, but it is hard.

Ciao,
Dscho





More information about the ImageJ-devel mailing list