Posted by
Kota Miura on
URL: http://imagej.273.s1.nabble.com/Radial-profile-ext-to-work-with-Macros-tp5005598p5005761.html
Hi Matt, Carl, Jan & all,
On Mon, Dec 2, 2013 at 1:02 PM, Jan Eglinger <
[hidden email]> wrote:
> 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.html>
> Since 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_Scripting>
>
here is another upgraded version of the Radial Profile plugin,
https://github.com/cmci/RadialProfileV2/tree/master/targetthat allows having options to the macro command e.g.
run("Radial Profile", "x=148 y=125 radius=80");
Original version had some bug in the measurement for the value in the last
index of the profile, and this is fixed in my version as well.
Maybe Carl's extended version could be merged at some point.
Cheers,
Kota
--
-------------------------------------------------------------*Dr. Kota Miura*
Scientist & IT Engineer
Centre for Molecular and Cellular Imaging,
European Molecular Biology Laboratory
Meyerhofstr. 1
69117 Heidelberg
GERMANY
Tel +49 6221 387 404
Mobile +49 160 95001177
Fax +49 6221 387 512
http://cmci.embl.de-------------------------------------------------------------
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html