Hi,
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. Radial Profile Ext I found this page Link here - Go to Chapter 11 which describes writing plugins with macro compatibility, but I don't really understand what needs changing. Many thanks for your time, Matt |
Any ideas?
|
Dear madtrick,
I'm the author of the Radial profile ext plugin (quite some years ago). What are you trying to do within a macro? Just launch the plugin or more? Best regards, Philippe On Donderdag 28 November 2013 17:51 CET, madtrick <[hidden email]> wrote: > Any ideas? > > > > -- > View this message in context: http://imagej.1557.x6.nabble.com/Radial-profile-ext-to-work-with-Macros-tp5005598p5005737.html > Sent from the ImageJ mailing list archive at Nabble.com. > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by madtrick
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 On 28.11.2013, 5:51 PM, madtrick wrote: > Any ideas? > > > > -- > View this message in context: http://imagej.1557.x6.nabble.com/Radial-profile-ext-to-work-with-Macros-tp5005598p5005737.html > Sent from the ImageJ mailing list archive at Nabble.com. > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.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/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 > > On 28.11.2013, 5:51 PM, madtrick wrote: > >> Any ideas? >> >> >> >> -- >> View this message in context: http://imagej.1557.x6.nabble. >> com/Radial-profile-ext-to-work-with-Macros-tp5005598p5005737.html >> Sent from the ImageJ mailing list archive at Nabble.com. >> >> -- >> ImageJ mailing list: http://imagej.nih.gov/ij/list.html >> >> > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- -------------------------------------------------------------*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 |
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. 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? Best regards, Philippe Philippe CARL Laboratoire de Biophotonique et Pharmacologie UMR 7213 CNRS - Université de Strasbourg Faculté de Pharmacie 74 route du Rhin 67401 ILLKIRCH Tel : +33(0)3 68 85 41 84 -----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 > > On 28.11.2013, 5:51 PM, madtrick wrote: > >> Any ideas? >> >> >> >> -- >> View this message in context: http://imagej.1557.x6.nabble. >> com/Radial-profile-ext-to-work-with-Macros-tp5005598p5005737.html >> Sent from the ImageJ mailing list archive at Nabble.com. >> >> -- >> ImageJ mailing list: http://imagej.nih.gov/ij/list.html >> >> > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- -------------------------------------------------------------*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 -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by Kota Miura
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 |
In reply to this post by CARL Philippe (LBP)
That would be fantastic! Thank you :)
|
In reply to this post by Jan Eglinger
Dear all,
Following the request of macro integration of the "Radial profile ext" plugin, I tried to move forward. Thus up to the following document: http://rsb.info.nih.gov/ij/docs/macro_reference_guide.pdf in order to have easily access to the built-in macro command recorder, the plugin should be using the ij.gui.GenericDialog class (I'm very happy to be aware of this now since I used already this knowledge for another project...). In the "Radial profile ext" plugin I haven't used this class but the GenericRecallableDialog class developped in the Contour_Plotter routine by Walter O'Dell PhD. And I used this class since with this class the window is non blocking (can actually be solved by using the NonBlockingGenericDialog class developed by Johannes Schindelin) but as well since it is possible to add more buttons in the window (the "Radial profile ext" plugin has 6 buttons) which seems can't be done with the NonBlockingGenericDialog class. Thus is there a way to use the NonBlockingGenericDialog class and implement more than 2 (= 6 in my case) buttons with it? Alternatively I need to stick with the GenericRecallableDialog class and thus implement calls to public static methods like described at the page 17 and 18 of the http://rsb.info.nih.gov/ij/docs/macro_reference_guide.pdf file. Unfortunately with the data indicated in this document I'm not able to move forward (for example where and how should the "Recorder.record" command be used?). Could some examples of such implementation be found somewhere for better understanding? I thank you very much in advance. Best regards, Philippe Philippe CARL Laboratoire de Biophotonique et Pharmacologie UMR 7213 CNRS - Université de Strasbourg Faculté de Pharmacie 74 route du Rhin 67401 ILLKIRCH Tel : +33(0)3 68 85 41 84 -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Philippe,
when recording, a GenericDialog records the values (including checkbox settings, Choice menu settings) after the user has pressed the 'OK' button. When running the macro, it fills in the values and behaves as if the user had pressed 'OK'. So it won't record pressing any other buttons, and when running the macro it won't simulate pressing any buttons. If this is ok for you, you can add a Panel with an arbitrary number of buttons to the GenericDialog. You have to add your class as an ActionListener for all the buttons and have an actionPerformed method that detects which button was pressed and reacts accordingly. The actionPerformed methods may modify input fields of the GenericDialog, e.g. change the numbers in the numeric fields (getText, setText). If your plugin implements ExtendedPlugInFilter and DialogListener you may also have a 'preview' checkbox. With preview on, you could e.g. show what a selection with given center coordinates would look like on the image (set a roi or overlay in the run(ip) method). Michael ________________________________________________________________ On Dec 18, 2013, at 15:05, Philippe CARL wrote: > Dear all, > Following the request of macro integration of the "Radial profile ext" plugin, I tried to move forward. > Thus up to the following document: > http://rsb.info.nih.gov/ij/docs/macro_reference_guide.pdf > in order to have easily access to the built-in macro command recorder, the plugin should be using the ij.gui.GenericDialog class (I'm very happy to be aware of this now since I used already this knowledge for another project...). > In the "Radial profile ext" plugin I haven't used this class but the GenericRecallableDialog class developped in the Contour_Plotter routine by Walter O'Dell PhD. > And I used this class since with this class the window is non blocking (can actually be solved by using the NonBlockingGenericDialog class developed by Johannes Schindelin) but as well since it is possible to add more buttons in the window (the "Radial profile ext" plugin has 6 buttons) which seems can't be done with the NonBlockingGenericDialog class. > Thus is there a way to use the NonBlockingGenericDialog class and implement more than 2 (= 6 in my case) buttons with it? > Alternatively I need to stick with the GenericRecallableDialog class and thus implement calls to public static methods like described at the page 17 and 18 of the http://rsb.info.nih.gov/ij/docs/macro_reference_guide.pdf file. > Unfortunately with the data indicated in this document I'm not able to move forward (for example where and how should the "Recorder.record" command be used?). > Could some examples of such implementation be found somewhere for better understanding? > I thank you very much in advance. > Best regards, > Philippe > > Philippe CARL > Laboratoire de Biophotonique et Pharmacologie > UMR 7213 CNRS - Université de Strasbourg > Faculté de Pharmacie > 74 route du Rhin > 67401 ILLKIRCH > Tel : +33(0)3 68 85 41 84 > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Dear Michael,
> when recording, a GenericDialog records the values (including checkbox settings, Choice menu settings) after the user has pressed the 'OK' button. > When running the macro, it fills in the values and behaves as if the user had pressed 'OK'. > So it won't record pressing any other buttons, and when running the macro it won't simulate pressing any buttons. > If this is ok for you, you can add a Panel with an arbitrary number of buttons to the GenericDialog. This could actually be fine and work (= code already implemented and working).... > The actionPerformed methods may modify input fields of the GenericDialog, e.g. change the numbers in the numeric fields (getText, setText). This is actually my next problem: how am I doing this? Let's say I have the following code defining the window: NonBlockingGenericDialog gd = new NonBlockingGenericDialog("Radial Profile Angle..."); gd.addStringField("Title: ", title); gd.addNumericField("Width: ", width, 0); gd.addNumericField("Height: ", height, 0); How can I then upon an action performed with a button defined by an added Panel change the value shown up in either the "Width: " or "Height: " NumericField? I thank you very much in advance for your answer and wish you a merry Christmas and happy NEW Year!!!. Best regards, Philippe -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Philippe,
you can get a Vector of the TextFields used for number input with Vector numericFields = gd.getNumericFields(); Assuming that you want a reference to the first numeric field: TextField tf0 = (TextField)(numericFields.elementAt(0)); Assuming that it should contain the variable 'width' you can use tf0.setText(Integer.toString(width)); [if 'width' is double, use one of the IJ.d2s functions to convert it to a String] Note that there is a nasty bug with Java on Mac computers (at least for modal dialogs, probably the same for the NonBlockingGenericDialog): If you do several changes at the same time (within a few milliseconds), only the first one will be shown, the other fields are not updated until the next change. [TextField.getText() correctly shows the new data. This bug does not only affect TextFields but also Checkboxes, etc. Mac users may have noticed that the 'preview' and 'wait' of some ImageJ functions with preview is sometimes displayed incorrectly due to this bug.] As a workaround, if you want to modify the contents of several TextFields at once, it is advisable to add an 'IJ.wait(100)' statement before the last modification. Enjoy Christmas time and best wishes for a good New Year! Michael ________________________________________________________________ On Dec 20, 2013, at 14:26, Philippe CARL wrote: > Dear Michael, > >> when recording, a GenericDialog records the values (including checkbox >> settings, Choice menu settings) after the user has pressed the 'OK' button. >> When running the macro, it fills in the values and behaves as if the user >> had pressed 'OK'. >> So it won't record pressing any other buttons, and when running the macro >> it won't simulate pressing any buttons. >> If this is ok for you, you can add a Panel with an arbitrary number of >> buttons to the GenericDialog. >> > This could actually be fine and work (= code already implemented and > working).... > >> The actionPerformed methods may modify input fields of the GenericDialog, >> e.g. change the numbers in the numeric fields (getText, setText). >> > This is actually my next problem: how am I doing this? > Let's say I have the following code defining the window: > NonBlockingGenericDialog gd = new NonBlockingGenericDialog("Radial Profile > Angle..."); > gd.addStringField("Title: ", title); > gd.addNumericField("Width: ", width, 0); > gd.addNumericField("Height: ", height, 0); > How can I then upon an action performed with a button defined by an added > Panel change the value shown up in either the "Width: " or "Height: " > NumericField? > > I thank you very much in advance for your answer and wish you a merry > Christmas and happy NEW Year!!!. > > Best regards, > > Philippe > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by Jan Eglinger
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 |
Hi Philippe,
I apologize for being too lazy to respond. The large difference is not really a big difference. I converted the original plugin to separate plugin implementation and the core processing part to ease the use of the plugin from scripts, and also fixed a bug. I will find time to see your code to do the same thing, and it probably then will be the merge of two works, mine and yours. ... and I wish for a Happy New Year to you as well, including all the subscribers of this list. It's only another 30 minutes left for this year n Japan, where I am now staying. a+ and Cheers, Kota On Tue, Dec 31, 2013 at 8:24 AM, CARL Philippe (PHA) < [hidden email]> wrote: > 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 > -- -------------------------------------------------------------*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 |
In reply to this post by Jan Eglinger
Dear all,
Following the request a couple of months ago of macros implementation of the Radial profile ext plugin, I have submitted a version to Wayne who has updated it on the ImageJ website. http://imagej.nih.gov/ij/plugins/radial-profile-ext.html This version takes into account the bug correction found and discussed by Kota Miura. It also and especially introduces several new functionalities which are the results of some fruitful back and forth discussions with Michael Schmid which lasted over several days and from which I learned really a lot. Thus I would like to specially thank him here. Thus enjoy and feel free to contact me again about this plugin or other purposes. Best regards Philippe Philippe CARL Laboratoire de Biophotonique et Pharmacologie UMR 7213 CNRS - Université de Strasbourg Faculté de Pharmacie 74 route du Rhin 67401 ILLKIRCH Tel : +33(0)3 68 85 41 84 -----Message d'origine----- De : ImageJ Interest Group [mailto:[hidden email]] De la part de Jan Eglinger Envoyé : mardi 3 décembre 2013 12:12 À : [hidden email] Objet : Re: Radial profile ext to work with Macros 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 -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Dear Philippe,
Thanks for the update to radial-profile-ext. I came across your earlier version several years ago, but was unable to employ it as desired due to the lack of macro compatibility. I have tested the new version in a few basic macros and it is great. As a suggestion, for time/stack measurements, it would be nice to have the option to output the plot as intensity vs time rather than an individual plot at each time point. eg. +++- vs Secondly, I can't work out how to access the data through a macro. Any suggestions here? What I am trying to develop is a macro that will take a list of co-ordinates and measure the radial profile at each given point outputting the data to a single updated results file. Cheers, James |
Dear James,
I'm happy that you like the work that has been implemented in the new version of the radial-profile-ext plugin. Following your request, please download an even newer version (from this morning) under the following link: http://punias.free.fr/Radial_Profile_Angle_Ext.jar In this version I have now added MacroExtension features which are illustrated in the following macro: run("Radial Profile Angle", "x_center=200 y_center=200 radius=200 starting_angle=0 integration_angle=180 use_spatial_calibration"); print(Ext.getBinSize); print(Ext.getStackSize); print(Ext.getXValue(0)); // XValue [Ext.getBinSize] print(Ext.getYValue(0, 0)); // YValue[Ext.getStackSize][Ext.getBinSize] Is this newer version completely answering your issue or do you need additional methods? In the case you validate this version I will then ask Wayne to make a new update on the ImageJ Website. My best regards, Philippe -----Message d'origine----- De : ImageJ Interest Group [mailto:[hidden email]] De la part de JimmiB Envoyé : mardi 11 février 2014 01:15 À : [hidden email] Objet : Re: Radial profile ext to work with Macros Dear Philippe, Thanks for the update to radial-profile-ext. I came across your earlier version several years ago, but was unable to employ it as desired due to the lack of macro compatibility. I have tested the new version in a few basic macros and it is great. As a suggestion, for time/stack measurements, it would be nice to have the option to output the plot as intensity vs time rather than an individual plot at each time point. eg. +++- +++<http://imagej.1557.x6.nabble.com/file/n5006479/Radial_Plot_IvT.jpg> vs <http://imagej.1557.x6.nabble.com/file/n5006479/Profile_Plot_Fvt.png> Secondly, I can't work out how to access the data through a macro. Any suggestions here? What I am trying to develop is a macro that will take a list of co-ordinates and measure the radial profile at each given point outputting the data to a single updated results file. Cheers, James -- View this message in context: http://imagej.1557.x6.nabble.com/Radial-profile-ext-to-work-with-Macros-tp50 05598p5006479.html Sent from the ImageJ mailing list archive at Nabble.com. -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi again,
I guess by having "the option to output the plot as intensity vs time rather than an individual plot at each time point" you probably wanted something similar to what can now be done with the following macro, isn't it?: run("Radial Profile Angle", "x_center=200 y_center=200 radius=200 starting_angle=0 integration_angle=180 use_spatial_calibration calculate_radial_profile_on_stack"); run("Clear Results"); for(i = 0; i != Ext.getStackSize; i++) { setResult("Time", i, i); for(j = 0; j != Ext.getBinSize; j++) setResult(Ext.getXValue(j), i, Ext.getYValue(i, j)); } updateResults(); My best regards, Philippe -----Message d'origine----- De : ImageJ Interest Group [mailto:[hidden email]] De la part de Philippe CARL Envoyé : mardi 11 février 2014 13:34 À : [hidden email] Objet : Re: Radial profile ext to work with Macros Dear James, I'm happy that you like the work that has been implemented in the new version of the radial-profile-ext plugin. Following your request, please download an even newer version (from this morning) under the following link: http://punias.free.fr/Radial_Profile_Angle_Ext.jar In this version I have now added MacroExtension features which are illustrated in the following macro: run("Radial Profile Angle", "x_center=200 y_center=200 radius=200 starting_angle=0 integration_angle=180 use_spatial_calibration"); print(Ext.getBinSize); print(Ext.getStackSize); print(Ext.getXValue(0)); // XValue [Ext.getBinSize] print(Ext.getYValue(0, 0)); // YValue[Ext.getStackSize][Ext.getBinSize] Is this newer version completely answering your issue or do you need additional methods? In the case you validate this version I will then ask Wayne to make a new update on the ImageJ Website. My best regards, Philippe -----Message d'origine----- De : ImageJ Interest Group [mailto:[hidden email]] De la part de JimmiB Envoyé : mardi 11 février 2014 01:15 À : [hidden email] Objet : Re: Radial profile ext to work with Macros Dear Philippe, Thanks for the update to radial-profile-ext. I came across your earlier version several years ago, but was unable to employ it as desired due to the lack of macro compatibility. I have tested the new version in a few basic macros and it is great. As a suggestion, for time/stack measurements, it would be nice to have the option to output the plot as intensity vs time rather than an individual plot at each time point. eg. +++- +++<http://imagej.1557.x6.nabble.com/file/n5006479/Radial_Plot_IvT.jpg> vs <http://imagej.1557.x6.nabble.com/file/n5006479/Profile_Plot_Fvt.png> Secondly, I can't work out how to access the data through a macro. Any suggestions here? What I am trying to develop is a macro that will take a list of co-ordinates and measure the radial profile at each given point outputting the data to a single updated results file. Cheers, James -- View this message in context: http://imagej.1557.x6.nabble.com/Radial-profile-ext-to-work-with-Macros-tp50 05598p5006479.html Sent from the ImageJ mailing list archive at Nabble.com. -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by JimmiB
Dear Phillipe,
Thankyou for your help and prompt response. I am in the process of testing the new update and will get back to you ASAP. re: > run("Radial Profile Angle", "x_center=200 y_center=200 radius=200 > starting_angle=0 integration_angle=180 use_spatial_calibration > calculate_radial_profile_on_stack"); > run("Clear Results"); > for(i = 0; i != Ext.getStackSize; i++) > { > setResult("Time", i, i); > for(j = 0; j != Ext.getBinSize; j++) > setResult(Ext.getXValue(j), i, Ext.getYValue(i, > j)); > } > updateResults(); When I run this I get a results list with Time = Slice# and The intensity of the first radius. This looks good. How do i get this to plot, or add the other radius. Apologies, I have no experience with the Ext. commands. I was also wondering if you could clarify exactly what the starting angle (*seems pretty self explanatory)* and integration angle - (*Does this define the number of sections the measurements are broken down into? each half of the ROI is analysed and then averaged to give the final result?)* are. Also, What defines the size and number of the radii Cheers, James *Dr James Burchfield* The Garvan Institute of Medical Research 384 Victoria Street Darlinghurst, NSW, 2010 Australia Email: [hidden email] Phone:+61 2 92958229 Web: *www.garvan.org.au <http://www.garvan.org.au>* On Wed, Feb 12, 2014 at 12:23 AM, Philippe CARL <[hidden email]>wrote: > Hi again, > I guess by having "the option to output the plot as intensity vs time > rather > than an individual plot at each time point" you probably wanted something > similar to what can now be done with the following macro, isn't it?: > run("Radial Profile Angle", "x_center=200 y_center=200 radius=200 > starting_angle=0 integration_angle=180 use_spatial_calibration > calculate_radial_profile_on_stack"); > run("Clear Results"); > for(i = 0; i != Ext.getStackSize; i++) > { > setResult("Time", i, i); > for(j = 0; j != Ext.getBinSize; j++) > setResult(Ext.getXValue(j), i, Ext.getYValue(i, > j)); > } > updateResults(); > My best regards, > Philippe > > -----Message d'origine----- > De : ImageJ Interest Group [mailto:[hidden email]] De la part de > Philippe CARL Envoyé : mardi 11 février 2014 13:34 À : [hidden email] > Objet : Re: Radial profile ext to work with Macros > > Dear James, > I'm happy that you like the work that has been implemented in the new > version of the radial-profile-ext plugin. > Following your request, please download an even newer version (from this > morning) under the following link: > http://punias.free.fr/Radial_Profile_Angle_Ext.jar > In this version I have now added MacroExtension features which are > illustrated in the following macro: > run("Radial Profile Angle", "x_center=200 y_center=200 radius=200 > starting_angle=0 integration_angle=180 use_spatial_calibration"); > print(Ext.getBinSize); > print(Ext.getStackSize); > print(Ext.getXValue(0)); // XValue > [Ext.getBinSize] > print(Ext.getYValue(0, 0)); // > YValue[Ext.getStackSize][Ext.getBinSize] > Is this newer version completely answering your issue or do you need > additional methods? > In the case you validate this version I will then ask Wayne to make a new > update on the ImageJ Website. > My best regards, > Philippe > > -----Message d'origine----- > De : ImageJ Interest Group [mailto:[hidden email]] De la part de > JimmiB > Envoyé : mardi 11 février 2014 01:15 À : [hidden email] Objet : Re: > Radial profile ext to work with Macros > > Dear Philippe, > Thanks for the update to radial-profile-ext. I came across your earlier > version several years ago, but was unable to employ it as desired due to > the > lack of macro compatibility. I have tested the new version in a few basic > macros and it is great. > As a suggestion, for time/stack measurements, it would be nice to have the > option to output the plot as intensity vs time rather than an individual > plot at each time point. eg. > +++- > +++<http://imagej.1557.x6.nabble.com/file/n5006479/Radial_Plot_IvT.jpg> > vs > <http://imagej.1557.x6.nabble.com/file/n5006479/Profile_Plot_Fvt.png> > > Secondly, I can't work out how to access the data through a macro. Any > suggestions here? > > What I am trying to develop is a macro that will take a list of > co-ordinates > and measure the radial profile at each given point outputting the data to a > single updated results file. > > Cheers, > > James > > > > > > > -- > View this message in context: > > http://imagej.1557.x6.nabble.com/Radial-profile-ext-to-work-with-Macros-tp50 > 05598p5006479.html > Sent from the ImageJ mailing list archive at Nabble.com. > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Dear James
> When I run this I get a results list with Time = Slice# and The intensity of the first radius. > This looks good. Ok good... > How do i get this to plot, or add the other radius. Getting the data in a result table or plot is not very different in terms of use of the "Ext." methods ; nevertheless, the following macro will do the job you are looking for: for(rad = 200; rad <= 210; rad += 10) raduisPlot(rad); function raduisPlot(radius) { selectWindow("confocal-series.tif"); run("Radial Profile Angle", "x_center=200 y_center=200 radius=" + radius + " starting_angle=0 integration_angle=180 use_spatial_calibration calculate_radial_profile_on_stack"); color = newArray("black", "blue", "cyan", "darkGray", "gray", "green", "lightGray", "magenta", "orange", "pink", "red", "yellow"); xValues = newArray(Ext.getStackSize); yValues = newArray(Ext.getStackSize); Plot.create("Radius = " + radius, "Time", "Fluorescence (A.U.)", xValues, yValues); Plot.setLimits(0, Ext.getStackSize, 0, 150); for(j = 0; j != Ext.getBinSize; j++) { for(i = 0; i != Ext.getStackSize; i++) { xValues[i] = i; yValues[i] = Ext.getYValue(i, j); } Plot.add("line", xValues, yValues); Plot.setColor(color[j % 12]); } Plot.show(); } > I was also wondering if you could clarify exactly what the starting angle (*seems pretty self explanatory)* and integration angle - (*Does this define the number of sections the measurements are broken down into? > each half of the ROI is analysed and then averaged to give the final result?)* are. I have added an "Application" tab at the bottom of the plugin Website that can be found under the following link: http://punias.free.fr/radial-profile-ext.html is this new addition answering clearly your questions now or do you still have some doubts or misunderstanding? > Also, What defines the size and number of the radii Cheers, James I'm afraid that I don't understand this question. Do you want to know what the values of "Ext.getStackSize" and "Ext.getBinSize" are or something else? Best regards, Philippe -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |