Auto code completion for IJ macro

imagej

#41

I removed the "<a name=Dialog.getNumber></a>" from line 293, which was out of place, and the extra quote from line 2652.

I also added separate entries for close("*") and close("\\Others").


#42

We may want to devise a strategy for keeping mirror.imagej.net and wsr.imagej.net in sync. The content of mirror.imagej.net is layered into the toplevel imagej.net domain, so e.g. https://imagej.net/developer/macro/functions.html is the same file as https://mirror.imagej.net/developer/macro/functions.html. The entire mirror.imagej.net is refreshed nightly from imagej.nih.gov/ij by a Jenkins job.

@Wayne Maybe it would make sense to copy the contents of wsr.imagej.net over top the mirror after the mirror has completed? I.e.: we first mirror imagej.nih.gov/ij to mirror.imagej.net, then copy wsr.imagej.net over it to cover the situations where that content exists and is newer? How would you prefer things to be organized? I do not feel strongly, although I think users would like it if the content of the toplevel imagej.net domain was as reliable and up-to-date as possible.


#43

@ctrueden Just for curiosity: Might it be possible that the mirroring script/code commits the recent functions.html to github in case it detects changes? That would allow us removing the web pinging code from the autocompletion and get rid of the short hang when switching to macro language…


#44

It would make sense to copy these files and directories:

wsr.imagej.net//notes.html
wsr.imagej.net//developer/macro/functions.html
wsr.imagej.net//src
wsr.imagej.net//jars

The src and jars directories should be copied to
mirror.imagej.net/download/

These files are updated more frequently than the corresponding versions on imagej.nih.gov/ij, which I can’t easily update.

I would make more files available at wsr.imagej.net but I am unable to edit directories that contain an index.html file.


#45

@Wayne A command added in 1.51a5 but missing from the functions page is Roi.getContainedPoints().

Thanks,
Giovanni


#46

I added this description:

Roi.getContainedPoints(xpoints, ypoints)
Returns, as two arrays, the x and y coordinates of the pixels inside the current selection. Aborts the macro if there is no selection.

To the macro functions list at
http://wsr.imagej.net/developer/macro/functions.html


#47

Hi,
Very timely release for my macro imagej course. Work great on Ubuntu 18.04, and no problem reported during this week imageJ macro course with attendees on Mac OS X and Windows 7/10.

One autocomplete error:
FOR LOOP
for (i = 0; i < 10, i++) { -> replaces the second semicolon by a comma.

Bertrand


Bertrand Vernay, PhD
Imaging Facility Manager
http://www.crm.ed.ac.uk/facilities/imaging
MRC Centre for Regenerative Medicine
SCRM Building
The University of Edinburgh
Edinburgh bioQuarter
5 Little France Drive
Edinburgh
EH16 4UU

Office: +0044 (0)131 651 9543


#48

Thanks @Bertrand_Vernay!

This one is fixed in the version which will become part of Fiji. :slight_smile:


#49

Hi @haesleinhuepf

great release!

several more “hidden commands” that are missing.

print("\\Clear")
print("\\Update:<text>")
print("\\Update<n>:<text>")

and missing declarations macro "title"{ and var.

cheers,
Kota


#50

Hey @Kota,

thanks for the hint! I’ll list them. Regarding the var how does it work? I’ve never seen this thing… Is it for global variables or …?

Thanks!
Robert


#51

Hi @haesleinhuepf,
var may be ancient, but still useful :wink:


#52

Hey @eljonco,

thanks for the link. I really didn’t know that this exists :wink:

The really good thing about autocompletion is, you discover new things all the time :smile:

Cheers,
Robert


#53

thanks to @eljonco for answering.

@haesleinhuepf

When a macro file contains multiple macros each with macro declaration (“macro set”), presuming that the macro is used by [Plugins > Macros > Install…], global variables declared using var is used.


#54

Ok, its in.

Any more secret commands are welcome!

Furthermore, might there be people who would like to add custom/personalized snippets to the autocomplete plugin?:thinking:


#55

Just some feedback after the first macro user training I’ve been doing since the introduction of code completion in the script editor - this is plainly awesome! The boost in usability of the macro language is impressive, this has been - by far - the best training workshop on macro programming I’ve been giving ever.

:arrow_forward: Thanks a lot for your efforts @haesleinhuepf, @ctrueden, @imagejan, @frauzufall, @dnmason, @oburri, @Wayne, @Kota and whoever else has been contributing to this!

:beers: :beer: