Posted by
Jan Eglinger on
URL: http://imagej.273.s1.nabble.com/Radial-profile-ext-to-work-with-Macros-tp5005598p5005760.html
Dear Matt,
> Any ideas?
>
your original post was not accepted by the mailing list [1], presumably
because you didn't confirm it. That might be a reason why you didn't get
an answer for a little while.
I am copying some of your original question here for the convenience of
readers joining the discussion at a later point.
> I have very limited experience with Java and I was wondering if
> someone had updated the Radial profile EXT plugin to enable macros to
> work with it? More specifically, its the Radial profile angle plugin,
> which was posted in 2006 and hasn't been updated since.
>
http://rsb.info.nih.gov/ij/plugins/radial-profile-ext.htmlSince the plugin makes use of ImageJ's GenericDialog in a non-standard
way to create its own user interface (thereby preventing the built-in
recordability of the command), you have to resort to one of the more
powerful scripting languages like Javascript [2] or Python [3] to
interact with the plugin from within a macro.
In addition the Radial_Profile_Angle_Ext class tightly couples parameter
initialization with the display of its dialog. I'd suggest to add a
helper method setParameters(Sa, Ia, X0, Y0, mR) to the plugin, such as:
public void setParameters(int mSa, int mIa, Double mX0, Double mY0,
Double mmR) {
Sa = mSa;
Ia = mIa;
X0 = mX0;
Y0 = mY0;
mR = mmR;
setCosSin();
}
(mind the line breaks introduced by the mailer)
After adding the above code and compiling the java file via "Compile and
Run", you should be able to execute the following javascript (with an
image open and any active selection):
importClass(Packages.Radial_Profile_Angle_Ext);
rp = new Radial_Profile_Angle_Ext();
imp = IJ.getImage();
ip = imp.getProcessor();
rp.setup("", imp);
rp.setParameters(180, 40, 77.5, 108.5, 57.5);
rp.doRadialDistribution(ip);
and you should see a profile plot without any dialog showing up.
Hope that helps,
Jan
[1]:
http://imagej.1557.x6.nabble.com/Radial-profile-ext-to-work-with-Macros-td5005598.html[2]:
http://fiji.sc/Javascript_Scripting[3]:
http://fiji.sc/Jython_ScriptingOn 28.11.2013, 5:51 PM, madtrick wrote:
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html