Login  Register

Re: Debugging macros in Fiji

Posted by dscho on Oct 30, 2014; 9:43am
URL: http://imagej.273.s1.nabble.com/Debugging-macros-in-Fiji-tp5010227p5010238.html

Dear Wayne,

On Wed, 29 Oct 2014, Rasband, Wayne (NIH/NIMH) [E] wrote:

> > On Oct 29, 2014, at 10:54 AM, Michael Fray <[hidden email]> wrote:
> >
> > Is there a way to 'debug' macros in Fiji?
>
> Open the macro in the Fiji Script Editor, type cmd-A (Select All), cmd-C
> (Copy), close the Script Editor and type cmd-V (Paste). The macro will
> open in an ImageJ macro editor window (named “Clipboard”) that has a
> Debug menu. On Linux and Windows, use the control key instead for
> keyboard shortcuts.

I know that you are reluctant to discuss code openly on this mailing list,
but I hope you'll forgive me.

Some time ago, I tried to integrate the debug mode of ImageJ 1.x' macro
language into the broader context of ImageJ2's script editor (and more
broadly even, into the context of SciJava scripting). The big road block I
hit rather hard with my own head is the fact that ImageJ 1.x' macro
language interpreter is tightly intertwined with ImageJ 1.x' text editor:

https://github.com/imagej/imagej1/blob/80effce0f832e2682ae3f4f51c6defdc55d53686/ij/macro/Interpreter.java#L221

Read: the macro interpreter *requires* an ImageJ 1.x text editor to
support debugging macros, it cannot accept any other editor.

In other words, the debugging support of the macro interpreter is
unfortunately too entangled with ImageJ 1.x' GUI code to make it possible
to be used in more advanced GUIs such as the ImageJ2 script editor.

I would be *delighted* if you could do something about that problem, say,
by providing a Java interface (maybe call it "ij.macro.DebuggerGUI") that
is used by the macro editor exclusively to interact with the GUI, and that
is implemented by ij.plugin.frame.Editor but can be implemented by an
adapter for the ImageJ2 script editor just as well?

Ciao,
Johannes

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html