http://imagej.273.s1.nabble.com/Writing-ImageJ-Macros-a-better-way-tp5020818p5020827.html
The debugger/breakpoint support was never completed, and removed in 2012.
> Would be nice if we didn't have to resort to such trickery.
> care of this component besides me. However, if you or your group have
> support toward getting the feature implemented. Otherwise, I will get
> on me personally to do it.
you to use a script language other than ImageJ macro. The macro language is
support beyond ImageJ only. My personal favorite is Groovy. For a list of
>
> Thanks Bram ... slick workaround. Would be nice if we didn't have to
> resort to such trickery.
> Does anyone know why the screenshots on this page show a "Breakpoints"
> menu in the Fiji Script Editor that doesn't appear to be in the software?
>
https://imagej.net/Using_the_Script_Editor>
> Alex
>
>
>
> On Wednesday, June 20, 2018, 3:15:39 PM PDT, Bram van den Broek <
>
[hidden email]> wrote:
>
> Hi Alex,
>
> Not sure if this is any help, but I tend to put 'waitForUser' statements
> at certain points in the code to check what's going on (or wrong). After
> many years of manual typing and deleting, I've only just made this into a
> function. Something like the code below. You can quickly disable the
> checkpoints by setting debug_mode to false.
>
> --------------------------------------------
> debug_mode = true;
> n=1;
>
> // code
> checkpoint("before filter");
> // more code
> checkpoint("after filter");
> // more code
> checkpoint("");
> // more code
>
> function checkpoint(message) {
> if(debug_mode==true) {
> setBatchMode("show"); //If you run your macro in Batch mode.
> print("Checkpoint "+n+" reached");
> waitForUser("Checkpoint "+n+": "+message);
> setBatchMode("hide"); //If you run your macro in Batch mode.
> n++;
> }
> }
> ------------------------------------------
>
> Best regards,
> Bram
>
> ------
> Bram van den Broek
> Advanced Microscopy and Image Analysis
> BioImaging Facility / Cell Biology
> The Netherlands Cancer Institute
>
>
>
>
>
> ________________________________________
> From: Alex <
[hidden email]>
> Sent: Wednesday, June 20, 2018 7:32 PM
> To:
[hidden email]
> Subject: Re: Writing ImageJ Macros a better way
>
> Brandon,
>
> Thanks ... I found a bbedit language module a while back so I've been able
> to look at the code with syntax highlighting. The biggest issue I can see
> with the Fiji Editor is that there's no debugger. The only way I could
> figure out how to debug was to copy the code back into the main ImageJ
> macro editor.
>
> I guess the one thing I'm looking for is some way to debug macros with an
> editor that provides real stop, step, step into, etc functionality. The
> macro editor's "run to insertion point" is a really clumsy way to do
> stops. When you've got lots of loops and sub-functions it really doesn't
> work well at all.
>
> Is there something I'm missing about the Fiji Editor?
> ThanksAlex
>
> On Wednesday, June 20, 2018, 8:55:59 AM PDT, Brandon Hurr <
>
[hidden email]> wrote:
>
> Alex,
>
> I'm very much in a similar boat to you. I'm skilled in R and can manage in
> python and C when I have to, but Java is hard for me for some reason. I
> typically write macros in the GUI editor in FIJI and I'm on a mac. My
> macros have increased in complexity and have become much more difficult to
> manage in recent years.
>
> The syntax highlighting in FIJI's editor is the best I've used so far. Most
> front end's don't seem to know what to do with ImageJ script, but they have
> better tools for refactoring. Secondarily, I've used textWrangler/BBedit
> with the module mentioned here:
>
http://imagej.1557.x6.nabble.com/BBEdit-language-module-for-> ImageJ-macros-td3686081.html
> It works pretty well and is easier on the eyes than FIJIs editor.
>
> Advice will vary a lot as each person works best in their own way, but one
> way that has helped me loads is to functionalize things as much as
> possible. If you have a piece of code that runs in many places, make a
> function out of it and use it instead. This abstracts pieces away from the
> core code and allows you to focus more on the flow of things. Then when you
> get a problem you can more easily focus on that piece. I used to have
> scripts that were 1500 lines long. Now the core loops and functions are
> more like 200 lines and the functions that run within that core are the
> other 1300 lines. You could even tear those pieces out into other scripts
> (functions script) or rewrite in Java for speed if you need it and can do
> that.
>
> I also know that FIJI can use python, javascript and other languages to run
> the core functions, but the documentation around this is not nearly as good
> as the imagej scripting language docs and examples that are on the
> internet. At least the last time I looked, which admittedly was a while
> ago.
>
> HTH,
> Brandon
>
>
>
> On Tue, Jun 19, 2018 at 3:33 PM Alex <
>
[hidden email]> wrote:
>
> > All,
> >
> > I know there's lots of information on the web but it seems very scattered
> > and unclear what's considered "best practice."
> > I've been writing ImageJ macros for some time using the ImageJ Macro
> > language and the built in script editor. Obviously this has it's
> > limitations. The scope of the Macro Language itself isn't really a
> problem
> > but some of my macros have become so complex that debugging and changing
> > them is very difficult.
> >
> > I'm pretty handy at Python, R, and C but don't have any experience with
> > Java. Also, I'm working on MacOS.
> > I've tired the Eclipse ImageJ plugin (
> >
https://github.com/Bio7/EclipseImageJ1Plugin) but it leaves a lot to be
> > desired as it's very clunky and still only seems to show variables and
> > their values in ImageJ itself.
> >
> > What would you consider the best way to write ImageJ macros in an IDE
> that
> > offers real debugging functionality? What's the best step-by-step
> resource
> > for learning out more advanced ImageJ macro programming techniques?
> > ThanksAlex
> >
> > --
> > 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>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>