debug macro about the argument from command line?

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

debug macro about the argument from command line?

nickxtsui
Dear Folks:
I am wondering is there anyway to debug Fiji macro from command line?
For example, is following command is input:

fiji D:\fiji\macros\myFFTmacro.ijm D:\inputImage\ --headless

where inside D:\inputIMage\ there are two images that should be processed
FFT by this macro.

Inside the macro, there is
filePath = getArgument;

So in this case, how can I debug macro regarding the argument input from
the command line?
Thanks a lot.
Nick

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

Re: debug macro about the argument from command line?

ctrueden
Hi Nick,

> I am wondering is there anyway to debug Fiji macro from command line?

Why not debug it interactively using the Script Editor, which has several
features intended to facilitate debugging? Then, once it is working, run it
headlessly as you described.

Otherwise, if you must do it headlessly via the command line (e.g., while
SSHed to a remote server), you would approach it the same way you debug
anything: using the Edit / Run / Debug development cycle.

Have the macro file open in e.g. vim, make some edits to add print
statements, then execute the macro -- e.g., in vim:
    :map <F5> :!D:\fiji\macros\myFFTmacro.ijm D:\inputImage\ --headless

Then press F5 every time you want to run it. Check the output, make further
modifications to the macro, etc.

Regards,
Curtis


On Tue, Jan 21, 2014 at 4:28 PM, Nick X. Tsui <[hidden email]> wrote:

> Dear Folks:
> I am wondering is there anyway to debug Fiji macro from command line?
> For example, is following command is input:
>
> fiji D:\fiji\macros\myFFTmacro.ijm D:\inputImage\ --headless
>
> where inside D:\inputIMage\ there are two images that should be processed
> FFT by this macro.
>
> Inside the macro, there is
> filePath = getArgument;
>
> So in this case, how can I debug macro regarding the argument input from
> the command line?
> Thanks a lot.
> Nick
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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

Re: debug macro about the argument from command line?

nickxtsui
Curtis:
Thanks a lot. That certainly helps!
Nick


On Tue, Jan 21, 2014 at 5:44 PM, Curtis Rueden <[hidden email]> wrote:

> Hi Nick,
>
> > I am wondering is there anyway to debug Fiji macro from command line?
>
> Why not debug it interactively using the Script Editor, which has several
> features intended to facilitate debugging? Then, once it is working, run it
> headlessly as you described.
>
> Otherwise, if you must do it headlessly via the command line (e.g., while
> SSHed to a remote server), you would approach it the same way you debug
> anything: using the Edit / Run / Debug development cycle.
>
> Have the macro file open in e.g. vim, make some edits to add print
> statements, then execute the macro -- e.g., in vim:
>     :map <F5> :!D:\fiji\macros\myFFTmacro.ijm D:\inputImage\ --headless
>
> Then press F5 every time you want to run it. Check the output, make further
> modifications to the macro, etc.
>
> Regards,
> Curtis
>
>
> On Tue, Jan 21, 2014 at 4:28 PM, Nick X. Tsui <[hidden email]> wrote:
>
> > Dear Folks:
> > I am wondering is there anyway to debug Fiji macro from command line?
> > For example, is following command is input:
> >
> > fiji D:\fiji\macros\myFFTmacro.ijm D:\inputImage\ --headless
> >
> > where inside D:\inputIMage\ there are two images that should be processed
> > FFT by this macro.
> >
> > Inside the macro, there is
> > filePath = getArgument;
> >
> > So in this case, how can I debug macro regarding the argument input from
> > the command line?
> > Thanks a lot.
> > Nick
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> >
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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