Debugging macros in Fiji

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Debugging macros in Fiji

mafray
Hello,
quick question:
Is there a way to 'debug' macros in Fiji?  As in, going stepwise through a macro (in the IJ1 language) and seeing the info in the Debug window.

I've been doing this in ImageJ for a while, and recently switched over to Fiji (V. 2.0.0-rc-15/1.49j currently, on OS 10.10 currently), and I like the macro editor in Fiji, except for the loss of the 'Debug' menu and functionality.  Hopefully I'm just missing something.

I've tried opening macros by Plugins > Macros > Edit...   or by Plugins > New > Macros, and I can't see any menu options for debugging.  I've also tried starting the debug mode by using <command> D, or <control> or <option> D, etc. with a macro open, with no luck.

Thank you,
Michael Fray

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Debugging macros in Fiji

Rasband, Wayne (NIH/NIMH) [E]
> On Oct 29, 2014, at 10:54 AM, Michael Fray <[hidden email]> wrote:
>
> Hello,
> quick question:
> Is there a way to 'debug' macros in Fiji?  As in, going stepwise through a macro (in the IJ1 language) and seeing the info in the Debug window.
>
> I've been doing this in ImageJ for a while, and recently switched over to Fiji (V. 2.0.0-rc-15/1.49j currently, on OS 10.10 currently), and I like the macro editor in Fiji, except for the loss of the 'Debug' menu and functionality.  Hopefully I'm just missing something.
>
> I've tried opening macros by Plugins > Macros > Edit...   or by Plugins > New > Macros, and I can't see any menu options for debugging.  I've also tried starting the debug mode by using <command> D, or <control> or <option> D, etc. with a macro open, with no luck.

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.

-wayne

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Debugging macros in Fiji

dscho
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
Reply | Threaded
Open this post in threaded view
|

Re: Debugging macros in Fiji

mafray
Wayne,
Thank you for the instructions!  This worked well for me, and will help a
lot.

And thanks Johannes for attempting to bring the macro debug functionality
to ImageJ2, it would certainly be nice, but now I start to see why it's not
a trivial implementation.

Thanks again for the great product and support,
-Michael

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.
>

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