Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scripting language for ImageJ macros #7

Closed
ctrueden opened this Issue May 6, 2014 · 1 comment

Comments

Projects
None yet
2 participants
@ctrueden
Copy link
Member

ctrueden commented May 6, 2014

By bundling ImageJ1 with the ImageJ2 distribution, we can support the IJ1 macro language as is with full backward compatibility. This is great, but users will want more: they want to "mix and match" IJ2 API calls within existing macros. This feature will be an excellent way for people to begin migrating existing workflows into IJ2 without needing to switch all at once.

One way to provide such capabilities would be to port the IJ1 macro language functions on top of BeanShell. This approach would be very powerful because it would allow IJ2 macros to harness the full IJ1 and IJ2 Java APIs, in addition to all the existing macro functions. It would also provide object oriented capabilities, required anyway by IJ2.

The macro language is largely syntactically compatible with BeanShell, with four notable exceptions:

  1. Passing uninitialized variables to built-in functions for side-effect assignments. E.g.: getSelectionCoordinates.
  2. The function keyword for declaring subroutines.
  3. Functions with no arguments not needing parentheses.
  4. The (disabled by default) expandable array syntax.

We have already solved 1), and are confident that 2) and 3) will be very easy. 4) is more difficult but enabling it in IJ1 issues a warning about IJ2 compatibility so that users are aware of the consequences.

Alternately, we can simply delegate to ImageJ1's macro evaluator, though this approach would largely lose the ability to mix and match macro code with ImageJ2 API calls.

Either way, this feature will take the form of a new ScriptLanguage for ImageJ macros, bundled as part of imagej-legacy.

Migrated-From: http://trac.imagej.net/ticket/837

@ctrueden ctrueden changed the title BeanShell-based IJ2 macro language Add scripting language for ImageJ macro language May 6, 2014

@ctrueden ctrueden changed the title Add scripting language for ImageJ macro language Add scripting language for ImageJ macros May 6, 2014

@ctrueden ctrueden self-assigned this May 6, 2014

@ctrueden ctrueden added this to the imagej-2.0.0 milestone May 6, 2014

@dscho

This comment has been minimized.

Copy link
Member

dscho commented May 26, 2014

Addressed in 9ad1002.

@dscho dscho closed this May 26, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.