ilastik / ilastik4ij

ImageJ plugins to run ilastik workflows
MIT License
22 stars 17 forks source link

Consider macro example instead of Java code for batch processing in README #16

Closed imagejan closed 5 years ago

imagejan commented 5 years ago

The "Java macro" example in the README is a poor choice because of following reasons:

I suggest to replace the code by a real macro, and supplement it with code in a supported scripting language such as Groovy, to illustrate more advanced interaction with this plugin's API (if applicable).

I'll try to come up with an illustrative example when I find the time.

wolny commented 5 years ago

I've chosen vanilla Java instead of the ImageJ's macro language, cause I couldn't make string interpolations work in the macro, e.g.:

name = ...
for (i=0; i<list.length; i++) {
  run("Command", "param1=$sname param2=output$i"
}

just won't work and I wanted to avoid ugly string concatenations.

imagejan commented 5 years ago

run("Command", "param1=$sname param2=output$i"

This works (see also the docs):

param1=&name

(mind the & instead of $) but something like output$i will not work in macros.

String concatenations are a common thing in macros, why do risk to lose the largest part of ImageJ users, just to have "nice-looking" Java code?

While I share some of the concerns about the IJ macro language, I'd suggest to include a Groovy example. Java is really the worst choice IMHO, when talking about "macro"-like batch processing without an IDE.

wolny commented 5 years ago

String concatenations are a common thing in macros, why do risk to lose the largest part of ImageJ users, just to have "nice-looking" Java code?

totally agree with the above. It should not be hard to rewrite the Java script example with the macro language and Groovy so we should do just that. Thanks