Re: Radial profile ext to work with Macros

Posted by CARL Philippe (LBP) on
URL: http://imagej.273.s1.nabble.com/Radial-profile-ext-to-work-with-Macros-tp5005598p5006007.html

Dear all,
You will find an updated version of the Radial profile ext plugin implementing Macros recording and use under the following link:
http://punias.free.fr/Radial_Profile_Angle_Ext.jar
Please feel free to test it and give me feedback about it before I contact Wayne for an update on the ImageJ website.
Also there is a small bug within the code I don't really know how to solve concerning the plotting of the integration area by using the "b" hotkey in opposition to the associated button. Since by using the "b" hotkey the cone of the integration angle calculation is unwantedly drawn as by using the same code with the button it isn't drawn and thus the code behaves normally.
Dear Kota,
Could you please indicate me in what consist your bug correction on the original radial profile plugin?
Your plugin is quite different from the original one and thus it is difficult to track your correction.
I wish you all a happy New Year 2014!!!
My best regards,
Philippe

Le Mardi 3 Décembre 2013 12:12 CET, Jan Eglinger <[hidden email]> a écrit:

> Dear Philippe, Kota and all,
>
> On 03.12.2013, 9:47 AM, Philippe CARL wrote:
> > Dear all,
> > To say the truth the "Radial profile ext" was actually the very first plugin I had ever written under ImageJ, in what seems to me now to be almost an eternity ago.
> > And in this times I absolutely needed such a sharp tool in order to quantify some RICM pictures in a certain way for generating a part of a publication.
> > Also I had indeed not written the plugin for a macro (I even didn't know how to program macros at this time) use and the code may probably be quite improved.
> > So what I can propose is to look over the code in general to try to improve it, extend its capabilities for macros, look for the bug correction Kota made (this bug is quite probably as well within the "Radial profile ext" plugin) and then post this new plugin on a site for you guys to download and try it.
> > And if everybody agrees on the update we can then contact Wayne for him to update the posted code on the ImageJ website.
> > Thus please allow me a couple days (= 2-3) for doing this.
>
> Since Kota has made his plugin so nicely available via github, I would
> suggest that you fork that project and open a pull request with your
> changes [*1*]. (Since recently, you can even edit the files online,

> making it very easy to contribute.)
> That will also permit others (devlopers but also advanced users of the
> plugin) to contribute small changes if necessary.
>
> > Also I would like to ask whether the new plugin update and evaluation discussion should rather be continued within the ImageJ list or rather outside, in private, until a new updated plugin is available?
>
> After all, the plugin is made for its users, so I suggest that the
> discussion about possible enhancements stays on this list.
>
> Cheers,
> Jan
>
> [*1*]: https://help.github.com/articles/using-pull-requests
>
> > -----Message d'origine-----
> > De : ImageJ Interest Group [mailto:[hidden email]] De la part de Kota Miura
> > Envoyé : lundi 2 décembre 2013 13:42
> > À : [hidden email]
> > Objet : Re: Radial profile ext to work with Macros
> >
> > 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/target
> >
> >
> > that 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
> >
> >





--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html