Hi Raghuram,<div><br></div><div>To run the macro from the UI you can run the regular menu command Plugins >> Macro >> Run ... (which is handled by the legacy layer).</div><div><br></div><div>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".<br>
<br><div class="gmail_quote">On Fri, Aug 10, 2012 at 10:32 AM, Curtis Rueden <span dir="ltr"><<a href="mailto:ctrueden@wisc.edu" target="_blank">ctrueden@wisc.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Raghuram,<div><br><div><div class="im"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>I am stuck trying to replicate this behavior on IJ2.</blockquote>
<br></div>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:</div><div> <a href="http://trac.imagej.net/ticket/12" target="_blank">http://trac.imagej.net/ticket/12</a></div>
<div class="im">
<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
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(..).</blockquote><div><br></div></div><div>In the future, there will be a ScriptService providing such functionality.</div>
<div><br></div><div>In the meantime, you should be able to execute your macro as-is in ImageJ2 via the legacy layer.</div><div><br></div><div>Regards,</div><div>Curtis</div><div><br></div><div><br><div class="gmail_quote">
<div><div class="h5">
On Mon, Jul 30, 2012 at 2:44 PM, raghuram sathyam <span dir="ltr"><<a href="mailto:raghuramsathyam@yahoo.com" target="_blank">raghuramsathyam@yahoo.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="h5">
<div><div style="font-size:12pt;font-family:times new roman,new york,times,serif"><div><div><div style="font-size:12pt;font-family:times new roman,new york,times,serif"><div>Hello <span>IJ</span> developers,</div><div>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.</div><div><br></div><div>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.<br></div><div><br></div><div>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(..).</div><div><br></div><div>Any pointers on how i can get this done will be very helpful.</div><span><font color="#888888"><div><br></div><div>-raghuram<br></div></font></span></div>
</div></div> </div></div>
<br></div></div>_______________________________________________<br>
ImageJ-devel mailing list<br>
<a href="mailto:ImageJ-devel@imagej.net" target="_blank">ImageJ-devel@imagej.net</a><br>
<a href="http://imagej.net/mailman/listinfo/imagej-devel" target="_blank">http://imagej.net/mailman/listinfo/imagej-devel</a><br>
<br></blockquote></div><br></div></div>
<br>_______________________________________________<br>
ImageJ-devel mailing list<br>
<a href="mailto:ImageJ-devel@imagej.net">ImageJ-devel@imagej.net</a><br>
<a href="http://imagej.net/mailman/listinfo/imagej-devel" target="_blank">http://imagej.net/mailman/listinfo/imagej-devel</a><br>
<br></blockquote></div><br></div>