[ImageJ-devel] Macros and scripting in Imagej 2.0
Bill Mohler
wmohler at neuron.uchc.edu
Wed Sep 7 15:30:53 CDT 2011
As a user and avid amateur developer in ImageJ1, I would vote that some
version of the current macro language be preserved/supported/developed
in ImageJ2. There is a learning curve to adopting new scripting
language syntax and rules that I would like to avoid when possible. Not
sure if that's really the question here. Curtis has told me that IJ1
support for macros will be retained in IJ2, but it would be great if the
beanshell port actually kept the macro language alive and growing in
IJ2. Am I hoping for more than can happen, or is that what Dscho and
Grant are discussing here?
Thanks,
Bill
On 9/7/11 4:18 PM, Grant B. Harris wrote:
> All --
>
> Following-up on Lee's message this morning and some of the chatter on
> the chat, I'm adding my two (perhaps even three) cent's worth...
>
> -- Scripting Languages
>
> Our plan is to use the scripting engine in Java 6 (JSR-223 Scripting for
> the Java Platform). This enables us to be
> polyglotic/language-agnostic... Jython, Closure, JavaScript, etc.
>
> As mentioned in the chat, BeanShell is interesting for the fact that it
> is syntactically very similar to the ImageJ Macro language - The Macro
> Language is a DSL (domain specific language) for image processing and
> manipulating the ImageJ environment. "Porting" it to Beanshell (as
> suggested by Dscho) sounds like a good idea. And it seems that that
> process could produce a layer (i.e. API) that could be accessed by any
> scripting language that works with JSR-223.
>
> (Note that MicroManager also uses BeanShell -
> http://valelab.ucsf.edu/~MM/MMwiki/index.php/Example_Beanshell_scripts)
>
> -- Macro Recording
>
> Our EventBus-based architecture enables straight-forward macro recording
> events. A simple experiment/example is the
> imagej.ui.swing.plugins.SwingScriptRecorder. It records plugin/module
> invocations and their parameter values, and then generates a chunk of
> Java-like code.
>
> It remains to be decided how to handle
> (this applies to undo/redo as well)
>
> -- Code/Script Generation
>
> The plan is to have a Code Generation API which will enable the
> generation of code/script in a variety of languages.
> In imagej.ext.script there is a very simple CodeGenerator with a
> JavaCodeGenerator implementation.
>
> -- Script Execution
>
> A simple example of programmatic invocation of a plugins is in
> imagej.core.plugins.debug.InvokePluginTest which passes the parameters
> using varargs.
>
> Using the JSR-223 Scripting engine, scripts can easily access Java
> classes. The 'layer' I mentioned earlier would ease the script-writers
> effort by providing wrappers to commonly used classes/objects and services.
>
> I'm interested to here other thoughts on these issues.
>
> (See my links and references on scripting here:
> http://dev.imagejdev.org/gbh/arch/Scripting.html)
>
>
>
> Grant B. Harris
> ---------------------------------------------------------
> Scientific Informatics Analyst, Cellular Dynamics Program
> Marine Biological Laboratory, Woods Hole, Mass. 02543
> gharris at mbl.edu
>
>
> On 9/7/2011 8:55 AM, Lee Kamentsky wrote:
>> Hi all,
>> What are the plans and timeline for bringing macros and scripting into
>> ImageJ 2.0? I'm looking for a way to programatically run a script from
>> CellProfiler. I'm guessing that, as a first pass, I create a legacy
>> plugin for some ImageJ 1.0 plugin that takes the script as its
>> argument - I could really use pointers on how to do this. Also, I'm
>> not sure where scripting is on the roadmap and what the planned
>> architecture is. I'd opt for a macro / scripting service. As a start,
>> that sort of thing could talk to the legacy code, but would end up
>> using the same interfaces to talk to the IJ2 code. I'm also guessing
>> that the IJ1 scripting engine might only need minor modifications to
>> reference displays instead of ImagePlus.
>>
>> --Lee
>>
>> _______________________________________________
>> ImageJ-devel mailing list
>> ImageJ-devel at imagejdev.org
>> http://imagejdev.org/mailman/listinfo/imagej-devel
> _______________________________________________
> ImageJ-devel mailing list
> ImageJ-devel at imagejdev.org
> http://imagejdev.org/mailman/listinfo/imagej-devel
> .
>
--
William A. Mohler
Associate Professor
Dept. of Genetics and Developmental Biology
University of Connecticut Health Center
*Physical Address:***
Room R1159
Cell and Genome Sciences Building
400 Farmington Ave.
Farmington, CT
*Mail Address:*
MC-6403
263 Farmington Ave.
Farmington, CT06030-6403
wmohler at neuron.uchc.edu <mailto:wmohler at neuron.uchc.edu>
*Mobile: (860) 985-2719*
skype: wmohler
Office: (860) 679-1833, room R1159
Lab: (860) 679-1834, room R1265
Fax: (314) 689-1833
http://genetics.uchc.edu/Faculty/assoc_professors/mohler.html
PThink before you print
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20110907/50367912/attachment.html>
More information about the ImageJ-devel
mailing list