[ImageJ-devel] running macros on ImageJ2

Barry DeZonia bdezonia at gmail.com
Mon Aug 13 11:13:11 CDT 2012


Hi Raghuram,

To run the macro from the UI you can run the regular menu command Plugins
>> Macro >> Run ... (which is handled by the legacy layer).

To run the macro programmatically you should be able to run the macro via
the LegacyService's runLegacyPlugin() command. You would pass the plugin
name as "ij.plugin.Macro_Runner" and the argument as "thePathToMyMacro.ijm".

On Fri, Aug 10, 2012 at 10:32 AM, Curtis Rueden <ctrueden at wisc.edu> wrote:

> Hi Raghuram,
>
>
>> I am stuck trying to replicate this behavior on IJ2.
>
>
> Full support for macros and scripting with ImageJ2 is scheduled for the
> next beta (or beta5 if we run out of time). See this ticket for details:
>     http://trac.imagej.net/ticket/12
>
>
>> I looked at the code for the ScriptPlugin.java and various other files in
>> the plugins.script package but have no clue on how to get similar
>> functionality as IJ.runMacroFile(..).
>
>
> In the future, there will be a ScriptService providing such functionality.
>
> In the meantime, you should be able to execute your macro as-is in ImageJ2
> via the legacy layer.
>
> Regards,
> Curtis
>
>
> On Mon, Jul 30, 2012 at 2:44 PM, raghuram sathyam <
> raghuramsathyam at yahoo.com> wrote:
>
>> Hello IJ developers,
>> I have been using a macro for processing multiple choice surveys for a
>> while. I wrote this macro from scratch (it was not recorded on the UI) for
>> IJ1 and it works very well on IJ1. I have been trying to migrate to IJ2 so
>> that i can move my processing to the cloud.
>>
>> I have also written some java code to preprocess the images i receive and
>> use IJ as a library within my code. I use IJ.runMacroFile(...) to run the
>> macro that i wrote for further image processing using IJ. I use the results
>> returned by the IJ.runMacroFile(...) for my output.
>>
>> I am stuck trying to replicate this behavior on IJ2.  I looked at the
>> code for the ScriptPlugin.java and various other files in the
>> plugins.script package but have no clue on how to get similar functionality
>> as IJ.runMacroFile(..).
>>
>> Any pointers on how i can get this done will be very helpful.
>>
>> -raghuram
>>
>> _______________________________________________
>> ImageJ-devel mailing list
>> ImageJ-devel at imagej.net
>> http://imagej.net/mailman/listinfo/imagej-devel
>>
>>
>
> _______________________________________________
> ImageJ-devel mailing list
> ImageJ-devel at imagej.net
> http://imagej.net/mailman/listinfo/imagej-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20120813/aa1f74a2/attachment.html>


More information about the ImageJ-devel mailing list