Hi all,
I'd like to use the Radial Profile Extended plugin on a stack of 3 images. I hope that if i have a selection in the image the plugin used within a macro will use this selection for the x,y and radius values as is the case for the built in Radial Profile plugin? Unfortunately though i get an error when running the extended plugin within a macro. I only seem to get the error when running the plugin on the stack. Below is the macro code and the error. Thanks for the help, Matt run("Radial Profile Angle", "use"); run("Clear Results"); for(j = 0; j != Ext.getStackSize; j++) { for(i2 = 0; i2 != Ext.getBinSize; i2++) { setResult("Slice", j * Ext.getBinSize + i2, j + 1); setResult("X" , j * Ext.getBinSize + i2, Ext.getXValue(i2)); setResult("Y" , j * Ext.getBinSize + i2, Ext.getYValue(j, i2)); } } updateResults(); ------------------------------------------------------ (Fiji Is Just) ImageJ 2.0.0-rc-14/1.49i2; Java 1.6.0_65 [64-bit]; Mac OS X 10.8.5; 91MB of 2015MB (4%) java.lang.ArrayIndexOutOfBoundsException: 1 at Radial_Profile_Angle_Ext.handleExtension(Radial_Profile_Angle_Ext.java:513) at ij.macro.ExtensionDescriptor.dispatch(ExtensionDescriptor.java:288) at ij.macro.Functions.doExt(Functions.java:4261) at ij.macro.Functions.getStringFunction(Functions.java:267) at ij.macro.Interpreter.getStringTerm(Interpreter.java:1284) at ij.macro.Functions.getString(Functions.java:336) at ij.macro.Functions.setResult(Functions.java:1160) at ij.macro.Functions.doFunction(Functions.java:137) at ij.macro.Interpreter.doStatement(Interpreter.java:227) at ij.macro.Interpreter.doBlock(Interpreter.java:599) at ij.macro.Interpreter.doStatement(Interpreter.java:269) at ij.macro.Interpreter.doFor(Interpreter.java:526) at ij.macro.Interpreter.doStatement(Interpreter.java:251) at ij.macro.Interpreter.doBlock(Interpreter.java:599) at ij.macro.Interpreter.doStatement(Interpreter.java:269) at ij.macro.Interpreter.doFor(Interpreter.java:526) at ij.macro.Interpreter.doStatement(Interpreter.java:251) at ij.macro.Interpreter.doStatements(Interpreter.java:215) at ij.macro.Interpreter.run(Interpreter.java:112) at ij.macro.Interpreter.run(Interpreter.java:82) at ij.macro.Interpreter.run(Interpreter.java:93) at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:153) at ij.IJ.runMacro(IJ.java:119) at ij.IJ.runMacro(IJ.java:108) at net.imagej.legacy.IJ1Helper.runMacro(IJ1Helper.java:782) at net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:116) at net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:156) at org.scijava.script.ScriptModule.run(ScriptModule.java:175) at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167) at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126) at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65) at org.scijava.thread.DefaultThreadService$2.call(DefaultThreadService.java:164) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:695) -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Dear Matt,
I thank you very much for using the Radial Profile Extended plugin. So I looked at your code and actually the problem comes from the way you launch the plugin: run("Radial Profile Angle", "use"); This instruction is quite incomplete and comes probably from a problem in the recording. Nevertheless, by launching this instruction you are not applying the plugin on the stack and thus, since you try later on to explore the values calculated on the stack, you get an out of bonds error (java.lang.ArrayIndexOutOfBoundsException: 1). So please try the following code: run("Bat Cochlea Volume (19K)"); run("Radial Profile Angle", "x_center=60.50 y_center=76.50 radius=68.50 starting_angle=0 integration_angle=180 calculate_radial_profile_on_stack"); run("Clear Results"); for(j = 0; j != Ext.getStackSize; j++) { for(i2 = 0; i2 != Ext.getBinSize; i2++) { setResult("Slice", j * Ext.getBinSize + i2, j + 1); setResult("X" , j * Ext.getBinSize + i2, Ext.getXValue(i2)); setResult("Y" , j * Ext.getBinSize + i2, Ext.getYValue(j, i2)); } } updateResults(); Which uses your code on the "Bat Cochlea Volume (19K)" data and should work. My 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 Matt Pearson Envoyé : mercredi 4 mars 2015 22:13 À : [hidden email] Objet : Radial Profile Angle plugin error Hi all, I'd like to use the Radial Profile Extended plugin on a stack of 3 images. I hope that if i have a selection in the image the plugin used within a macro will use this selection for the x,y and radius values as is the case for the built in Radial Profile plugin? Unfortunately though i get an error when running the extended plugin within a macro. I only seem to get the error when running the plugin on the stack. Below is the macro code and the error. Thanks for the help, Matt run("Radial Profile Angle", "use"); run("Clear Results"); for(j = 0; j != Ext.getStackSize; j++) { for(i2 = 0; i2 != Ext.getBinSize; i2++) { setResult("Slice", j * Ext.getBinSize + i2, j + 1); setResult("X" , j * Ext.getBinSize + i2, Ext.getXValue(i2)); setResult("Y" , j * Ext.getBinSize + i2, Ext.getYValue(j, i2)); } } updateResults(); ------------------------------------------------------ (Fiji Is Just) ImageJ 2.0.0-rc-14/1.49i2; Java 1.6.0_65 [64-bit]; Mac OS X 10.8.5; 91MB of 2015MB (4%) java.lang.ArrayIndexOutOfBoundsException: 1 at Radial_Profile_Angle_Ext.handleExtension(Radial_Profile_Angle_Ext.java:513) at ij.macro.ExtensionDescriptor.dispatch(ExtensionDescriptor.java:288) at ij.macro.Functions.doExt(Functions.java:4261) at ij.macro.Functions.getStringFunction(Functions.java:267) at ij.macro.Interpreter.getStringTerm(Interpreter.java:1284) at ij.macro.Functions.getString(Functions.java:336) at ij.macro.Functions.setResult(Functions.java:1160) at ij.macro.Functions.doFunction(Functions.java:137) at ij.macro.Interpreter.doStatement(Interpreter.java:227) at ij.macro.Interpreter.doBlock(Interpreter.java:599) at ij.macro.Interpreter.doStatement(Interpreter.java:269) at ij.macro.Interpreter.doFor(Interpreter.java:526) at ij.macro.Interpreter.doStatement(Interpreter.java:251) at ij.macro.Interpreter.doBlock(Interpreter.java:599) at ij.macro.Interpreter.doStatement(Interpreter.java:269) at ij.macro.Interpreter.doFor(Interpreter.java:526) at ij.macro.Interpreter.doStatement(Interpreter.java:251) at ij.macro.Interpreter.doStatements(Interpreter.java:215) at ij.macro.Interpreter.run(Interpreter.java:112) at ij.macro.Interpreter.run(Interpreter.java:82) at ij.macro.Interpreter.run(Interpreter.java:93) at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:153) at ij.IJ.runMacro(IJ.java:119) at ij.IJ.runMacro(IJ.java:108) at net.imagej.legacy.IJ1Helper.runMacro(IJ1Helper.java:782) at net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:116) at net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:156) at org.scijava.script.ScriptModule.run(ScriptModule.java:175) at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167) at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126) at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65) at org.scijava.thread.DefaultThreadService$2.call(DefaultThreadService.java:164 ) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.ja va:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:9 18) at java.lang.Thread.run(Thread.java:695) -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Philippe,
Thanks for your email. I have tried the code you pasted and use the bat cochlea stack as an example but this still doesn't work for me either in FIJI or Imagej1. In Fiji i get the same exception error and when i try in imagej1 I get this error: Unrecognised Ext function in line 3. for (j = 0; j != Ext.getStackSize; j++) I doesn't seem to like the Ext.getStackSize for some reason. I'm running imagej 1.48v and FIJI 1.49i2. Thanks for the help again, Matt On 5 Mar 2015, at 07:48, Philippe CARL <[hidden email]> wrote: > Dear Matt, > I thank you very much for using the Radial Profile Extended plugin. > So I looked at your code and actually the problem comes from the way you > launch the plugin: run("Radial Profile Angle", "use"); > This instruction is quite incomplete and comes probably from a problem in > the recording. > Nevertheless, by launching this instruction you are not applying the plugin > on the stack and thus, since you try later on to explore the values > calculated on the stack, you get an out of bonds error > (java.lang.ArrayIndexOutOfBoundsException: 1). > So please try the following code: > run("Bat Cochlea Volume (19K)"); > run("Radial Profile Angle", "x_center=60.50 y_center=76.50 > radius=68.50 starting_angle=0 integration_angle=180 > calculate_radial_profile_on_stack"); > run("Clear Results"); > for(j = 0; j != Ext.getStackSize; j++) > { > for(i2 = 0; i2 != Ext.getBinSize; i2++) > { > setResult("Slice", j * Ext.getBinSize + i2, > j + 1); > setResult("X" , j * Ext.getBinSize + i2, > Ext.getXValue(i2)); > setResult("Y" , j * Ext.getBinSize + i2, > Ext.getYValue(j, i2)); > } > } > updateResults(); > Which uses your code on the "Bat Cochlea Volume (19K)" data and should work. > My 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 Matt > Pearson > Envoyé : mercredi 4 mars 2015 22:13 > À : [hidden email] > Objet : Radial Profile Angle plugin error > > Hi all, > > I'd like to use the Radial Profile Extended plugin on a stack of 3 images. > I hope that if i have a selection in the image the plugin used within a > macro will use this selection for the x,y and radius values as is the case > for the built in Radial Profile plugin? Unfortunately though i get an error > when running the extended plugin within a macro. I only seem to get the > error when running the plugin on the stack. Below is the macro code and the > error. > > Thanks for the help, > > Matt > > > > run("Radial Profile Angle", "use"); > run("Clear Results"); > for(j = 0; j != Ext.getStackSize; j++) > { > for(i2 = 0; i2 != Ext.getBinSize; i2++) > { > setResult("Slice", j * Ext.getBinSize + i2, > j + 1); > setResult("X" , j * Ext.getBinSize + i2, > Ext.getXValue(i2)); > setResult("Y" , j * Ext.getBinSize + i2, > Ext.getYValue(j, i2)); > } > } > updateResults(); > > ------------------------------------------------------ > > (Fiji Is Just) ImageJ 2.0.0-rc-14/1.49i2; Java 1.6.0_65 [64-bit]; Mac OS X > 10.8.5; 91MB of 2015MB (4%) > > java.lang.ArrayIndexOutOfBoundsException: 1 > at > Radial_Profile_Angle_Ext.handleExtension(Radial_Profile_Angle_Ext.java:513) > at > ij.macro.ExtensionDescriptor.dispatch(ExtensionDescriptor.java:288) > at ij.macro.Functions.doExt(Functions.java:4261) > at ij.macro.Functions.getStringFunction(Functions.java:267) > at ij.macro.Interpreter.getStringTerm(Interpreter.java:1284) > at ij.macro.Functions.getString(Functions.java:336) > at ij.macro.Functions.setResult(Functions.java:1160) > at ij.macro.Functions.doFunction(Functions.java:137) > at ij.macro.Interpreter.doStatement(Interpreter.java:227) > at ij.macro.Interpreter.doBlock(Interpreter.java:599) > at ij.macro.Interpreter.doStatement(Interpreter.java:269) > at ij.macro.Interpreter.doFor(Interpreter.java:526) > at ij.macro.Interpreter.doStatement(Interpreter.java:251) > at ij.macro.Interpreter.doBlock(Interpreter.java:599) > at ij.macro.Interpreter.doStatement(Interpreter.java:269) > at ij.macro.Interpreter.doFor(Interpreter.java:526) > at ij.macro.Interpreter.doStatement(Interpreter.java:251) > at ij.macro.Interpreter.doStatements(Interpreter.java:215) > at ij.macro.Interpreter.run(Interpreter.java:112) > at ij.macro.Interpreter.run(Interpreter.java:82) > at ij.macro.Interpreter.run(Interpreter.java:93) > at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:153) > at ij.IJ.runMacro(IJ.java:119) > at ij.IJ.runMacro(IJ.java:108) > at net.imagej.legacy.IJ1Helper.runMacro(IJ1Helper.java:782) > at > net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:116) > at > net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:156) > at org.scijava.script.ScriptModule.run(ScriptModule.java:175) > at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167) > at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126) > at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65) > at > org.scijava.thread.DefaultThreadService$2.call(DefaultThreadService.java:164 > ) > at > java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) > at java.util.concurrent.FutureTask.run(FutureTask.java:138) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.ja > va:895) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:9 > 18) > at java.lang.Thread.run(Thread.java:695) > > > -- > The University of Edinburgh is a charitable body, registered in Scotland, > with registration number SC005336. > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Dear Matt,
I'm as well using Fiji on a daily basis and this with the last released version (i.e. 1.49p) and the code is working fine. I tried as well to run it as well under ImageJ (1.49p) and it is as well working even if on the first run I had to replace run("Radial Profile Angle", "x_center=60.50 y_center=76.50 radius=68.50 starting_angle=0 integration_angle=180 calculate_radial_profile_on_stack"); by run("Radial Profile Angle", "x_center=60.50 y_center=76.50 radius=68.50 starting_angle=0 integration_angle=180"); in order to the macro to be run on the stack which is quite strange for me. In all cases I would recommend you to update to the last version since there was a bug connected with the Radial Profile Extended plugin that has been fixed by Wayne (Thanks to Philippe Carl, fixed a bug that caused plugins using the NonBlockingGenericDialog to hang when they were called using the run() macro function). And if ImageJ is not recognizing the Ext function, this means that the following code: if (IJ.macroRunning()) Functions.registerExtensions(this); Within the plugin has not been launched. Could it be that the plugin has not been launched within a macro? I hope this helps you to go further. My best regards, Philippe -----Message d'origine----- De : ImageJ Interest Group [mailto:[hidden email]] De la part de Matt Pearson Envoyé : jeudi 5 mars 2015 09:22 À : [hidden email] Objet : Re: Radial Profile Angle plugin error Hi Philippe, Thanks for your email. I have tried the code you pasted and use the bat cochlea stack as an example but this still doesn't work for me either in FIJI or Imagej1. In Fiji i get the same exception error and when i try in imagej1 I get this error: Unrecognised Ext function in line 3. for (j = 0; j != Ext.getStackSize; j++) I doesn't seem to like the Ext.getStackSize for some reason. I'm running imagej 1.48v and FIJI 1.49i2. Thanks for the help again, Matt On 5 Mar 2015, at 07:48, Philippe CARL <[hidden email]> wrote: > Dear Matt, > I thank you very much for using the Radial Profile Extended plugin. > So I looked at your code and actually the problem comes from the way > you launch the plugin: run("Radial Profile Angle", "use"); This > instruction is quite incomplete and comes probably from a problem in > the recording. > Nevertheless, by launching this instruction you are not applying the > plugin on the stack and thus, since you try later on to explore the > values calculated on the stack, you get an out of bonds error > (java.lang.ArrayIndexOutOfBoundsException: 1). > So please try the following code: > run("Bat Cochlea Volume (19K)"); > run("Radial Profile Angle", "x_center=60.50 y_center=76.50 > radius=68.50 starting_angle=0 integration_angle=180 > calculate_radial_profile_on_stack"); > run("Clear Results"); > for(j = 0; j != Ext.getStackSize; j++) > { > for(i2 = 0; i2 != Ext.getBinSize; i2++) > { > setResult("Slice", j * Ext.getBinSize + i2, > setResult("X" , j * Ext.getBinSize + i2, > Ext.getXValue(i2)); > setResult("Y" , j * Ext.getBinSize + i2, > Ext.getYValue(j, i2)); > } > } > updateResults(); > Which uses your code on the "Bat Cochlea Volume (19K)" data and should work. > My 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 > Matt Pearson Envoyé : mercredi 4 mars 2015 22:13 À : > [hidden email] Objet : Radial Profile Angle plugin error > > Hi all, > > I'd like to use the Radial Profile Extended plugin on a stack of 3 images. > I hope that if i have a selection in the image the plugin used within > a macro will use this selection for the x,y and radius values as is > the case for the built in Radial Profile plugin? Unfortunately though > i get an error when running the extended plugin within a macro. I > only seem to get the error when running the plugin on the stack. > Below is the macro code and the error. > > Thanks for the help, > > Matt > > > > run("Radial Profile Angle", "use"); > run("Clear Results"); > for(j = 0; j != Ext.getStackSize; j++) > { > for(i2 = 0; i2 != Ext.getBinSize; i2++) > { > setResult("Slice", j * Ext.getBinSize + i2, > setResult("X" , j * Ext.getBinSize + i2, > Ext.getXValue(i2)); > setResult("Y" , j * Ext.getBinSize + i2, > Ext.getYValue(j, i2)); > } > } > updateResults(); > > ------------------------------------------------------ > > (Fiji Is Just) ImageJ 2.0.0-rc-14/1.49i2; Java 1.6.0_65 [64-bit]; Mac > OS X 10.8.5; 91MB of 2015MB (4%) > > java.lang.ArrayIndexOutOfBoundsException: 1 > at > > at > ij.macro.ExtensionDescriptor.dispatch(ExtensionDescriptor.java:288) > at ij.macro.Functions.doExt(Functions.java:4261) > at ij.macro.Functions.getStringFunction(Functions.java:267) > at ij.macro.Interpreter.getStringTerm(Interpreter.java:1284) > at ij.macro.Functions.getString(Functions.java:336) > at ij.macro.Functions.setResult(Functions.java:1160) > at ij.macro.Functions.doFunction(Functions.java:137) > at ij.macro.Interpreter.doStatement(Interpreter.java:227) > at ij.macro.Interpreter.doBlock(Interpreter.java:599) > at ij.macro.Interpreter.doStatement(Interpreter.java:269) > at ij.macro.Interpreter.doFor(Interpreter.java:526) > at ij.macro.Interpreter.doStatement(Interpreter.java:251) > at ij.macro.Interpreter.doBlock(Interpreter.java:599) > at ij.macro.Interpreter.doStatement(Interpreter.java:269) > at ij.macro.Interpreter.doFor(Interpreter.java:526) > at ij.macro.Interpreter.doStatement(Interpreter.java:251) > at ij.macro.Interpreter.doStatements(Interpreter.java:215) > at ij.macro.Interpreter.run(Interpreter.java:112) > at ij.macro.Interpreter.run(Interpreter.java:82) > at ij.macro.Interpreter.run(Interpreter.java:93) > at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:153) > at ij.IJ.runMacro(IJ.java:119) > at ij.IJ.runMacro(IJ.java:108) > at net.imagej.legacy.IJ1Helper.runMacro(IJ1Helper.java:782) > at > net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:116) > at > net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:156) > at org.scijava.script.ScriptModule.run(ScriptModule.java:175) > at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167) > at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126) > at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65) > at > org.scijava.thread.DefaultThreadService$2.call(DefaultThreadService.ja > va:164 > ) > at > java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) > at java.util.concurrent.FutureTask.run(FutureTask.java:138) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecu > tor.ja > va:895) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor. > java:9 > 18) > at java.lang.Thread.run(Thread.java:695) > > > -- > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Philippe,
I have now updated FIJI to 1.49p and tried running it on an up to date PC as well as a Mac (what i normally use) to see if somehow there was a difference but i still get the out of bounds exception, i think i have pasted the code as you have it. run("Bat Cochlea Volume (19K)"); run("Radial Profile Angle", "x_center=60.50 y_center=76.50 radius=68.50 starting_angle=0 integration_angle=180 calculate_radial_profile_on_stack"); run("Clear Results"); for(j = 0; j != Ext.getStackSize; j++) { for(i2 = 0; i2 != Ext.getBinSize; i2++) { setResult("Slice", j * Ext.getBinSize + i2,j + 1); setResult("X" , j * Ext.getBinSize + i2,Ext.getXValue(i2)); setResult("Y" , j * Ext.getBinSize + i2,Ext.getYValue(j, i2)); } } updateResults(); ( Can you think ok anything else that could be different between our setups? The fact it occurs on now 3 different workstations i've tried. Its the same exception error from what i can see ArrayIndexOutOfBounds. Thanks again, Matt On 5 Mar 2015, at 09:26, Philippe CARL wrote: > Dear Matt, > I'm as well using Fiji on a daily basis and this with the last released > version (i.e. 1.49p) and the code is working fine. > I tried as well to run it as well under ImageJ (1.49p) and it is as well > working even if on the first run I had to replace > run("Radial Profile Angle", "x_center=60.50 y_center=76.50 radius=68.50 > starting_angle=0 integration_angle=180 calculate_radial_profile_on_stack"); > by > run("Radial Profile Angle", "x_center=60.50 y_center=76.50 radius=68.50 > starting_angle=0 integration_angle=180"); > in order to the macro to be run on the stack which is quite strange for me. > In all cases I would recommend you to update to the last version since there > was a bug connected with the Radial Profile Extended plugin that has been > fixed by Wayne (Thanks to Philippe Carl, fixed a bug that caused plugins > using the NonBlockingGenericDialog to hang when they were called using the > run() macro function). > And if ImageJ is not recognizing the Ext function, this means that the > following code: > if (IJ.macroRunning()) > Functions.registerExtensions(this); > Within the plugin has not been launched. Could it be that the plugin has not > been launched within a macro? > I hope this helps you to go further. > My best regards, > Philippe > > -----Message d'origine----- > De : ImageJ Interest Group [mailto:[hidden email]] De la part de Matt > Pearson > Envoyé : jeudi 5 mars 2015 09:22 > À : [hidden email] > Objet : Re: Radial Profile Angle plugin error > > Hi Philippe, > > Thanks for your email. I have tried the code you pasted and use the bat > cochlea stack as an example but this still doesn't work for me either in > FIJI or Imagej1. In Fiji i get the same exception error and when i try in > imagej1 I get this error: > > Unrecognised Ext function in line 3. > for (j = 0; j != Ext.getStackSize; j++) > > I doesn't seem to like the Ext.getStackSize for some reason. > > I'm running imagej 1.48v and FIJI 1.49i2. > > Thanks for the help again, > > Matt > > > > > > On 5 Mar 2015, at 07:48, Philippe CARL <[hidden email]> wrote: > >> Dear Matt, >> I thank you very much for using the Radial Profile Extended plugin. >> So I looked at your code and actually the problem comes from the way >> you launch the plugin: run("Radial Profile Angle", "use"); This >> instruction is quite incomplete and comes probably from a problem in >> the recording. >> Nevertheless, by launching this instruction you are not applying the >> plugin on the stack and thus, since you try later on to explore the >> values calculated on the stack, you get an out of bonds error >> (java.lang.ArrayIndexOutOfBoundsException: 1). >> So please try the following code: >> run("Bat Cochlea Volume (19K)"); >> run("Radial Profile Angle", "x_center=60.50 y_center=76.50 >> radius=68.50 starting_angle=0 integration_angle=180 >> calculate_radial_profile_on_stack"); >> run("Clear Results"); >> for(j = 0; j != Ext.getStackSize; j++) >> { >> for(i2 = 0; i2 != Ext.getBinSize; i2++) >> { >> setResult("Slice", j * Ext.getBinSize + i2, > j + 1); >> setResult("X" , j * Ext.getBinSize + i2, >> Ext.getXValue(i2)); >> setResult("Y" , j * Ext.getBinSize + i2, >> Ext.getYValue(j, i2)); >> } >> } >> updateResults(); >> Which uses your code on the "Bat Cochlea Volume (19K)" data and should > work. >> My 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 >> Matt Pearson Envoyé : mercredi 4 mars 2015 22:13 À : >> [hidden email] Objet : Radial Profile Angle plugin error >> >> Hi all, >> >> I'd like to use the Radial Profile Extended plugin on a stack of 3 images. >> I hope that if i have a selection in the image the plugin used within >> a macro will use this selection for the x,y and radius values as is >> the case for the built in Radial Profile plugin? Unfortunately though >> i get an error when running the extended plugin within a macro. I >> only seem to get the error when running the plugin on the stack. >> Below is the macro code and the error. >> >> Thanks for the help, >> >> Matt >> >> >> >> run("Radial Profile Angle", "use"); >> run("Clear Results"); >> for(j = 0; j != Ext.getStackSize; j++) >> { >> for(i2 = 0; i2 != Ext.getBinSize; i2++) >> { >> setResult("Slice", j * Ext.getBinSize + i2, > j + 1); >> setResult("X" , j * Ext.getBinSize + i2, >> Ext.getXValue(i2)); >> setResult("Y" , j * Ext.getBinSize + i2, >> Ext.getYValue(j, i2)); >> } >> } >> updateResults(); >> >> ------------------------------------------------------ >> >> (Fiji Is Just) ImageJ 2.0.0-rc-14/1.49i2; Java 1.6.0_65 [64-bit]; Mac >> OS X 10.8.5; 91MB of 2015MB (4%) >> >> java.lang.ArrayIndexOutOfBoundsException: 1 >> at >> > Radial_Profile_Angle_Ext.handleExtension(Radial_Profile_Angle_Ext.java:513) >> at >> ij.macro.ExtensionDescriptor.dispatch(ExtensionDescriptor.java:288) >> at ij.macro.Functions.doExt(Functions.java:4261) >> at ij.macro.Functions.getStringFunction(Functions.java:267) >> at ij.macro.Interpreter.getStringTerm(Interpreter.java:1284) >> at ij.macro.Functions.getString(Functions.java:336) >> at ij.macro.Functions.setResult(Functions.java:1160) >> at ij.macro.Functions.doFunction(Functions.java:137) >> at ij.macro.Interpreter.doStatement(Interpreter.java:227) >> at ij.macro.Interpreter.doBlock(Interpreter.java:599) >> at ij.macro.Interpreter.doStatement(Interpreter.java:269) >> at ij.macro.Interpreter.doFor(Interpreter.java:526) >> at ij.macro.Interpreter.doStatement(Interpreter.java:251) >> at ij.macro.Interpreter.doBlock(Interpreter.java:599) >> at ij.macro.Interpreter.doStatement(Interpreter.java:269) >> at ij.macro.Interpreter.doFor(Interpreter.java:526) >> at ij.macro.Interpreter.doStatement(Interpreter.java:251) >> at ij.macro.Interpreter.doStatements(Interpreter.java:215) >> at ij.macro.Interpreter.run(Interpreter.java:112) >> at ij.macro.Interpreter.run(Interpreter.java:82) >> at ij.macro.Interpreter.run(Interpreter.java:93) >> at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:153) >> at ij.IJ.runMacro(IJ.java:119) >> at ij.IJ.runMacro(IJ.java:108) >> at net.imagej.legacy.IJ1Helper.runMacro(IJ1Helper.java:782) >> at >> net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:116) >> at >> net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:156) >> at org.scijava.script.ScriptModule.run(ScriptModule.java:175) >> at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167) >> at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126) >> at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65) >> at >> org.scijava.thread.DefaultThreadService$2.call(DefaultThreadService.ja >> va:164 >> ) >> at >> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) >> at java.util.concurrent.FutureTask.run(FutureTask.java:138) >> at >> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecu >> tor.ja >> va:895) >> at >> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor. >> java:9 >> 18) >> at java.lang.Thread.run(Thread.java:695) >> >> >> -- >> The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. >> >> -- >> ImageJ mailing list: http://imagej.nih.gov/ij/list.html >> >> -- >> ImageJ mailing list: http://imagej.nih.gov/ij/list.html >> > > > -- > The University of Edinburgh is a charitable body, registered in Scotland, > with registration number SC005336. > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- Matt Pearson Microscopy Facility MRC Human Genetics Unit IGMM University of Edinburgh Crewe Road EH4 2XU -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Dear Matt,
I have good and bad news... The good news is that I know how to solve your issue... The bad news is that I just have found a bug (either in my plugin or in ImageJ) that I don't know how to solve. Like I said previously, if you are getting an out of bounds error (or if you prefer an ArrayIndexOutOfBounds exception) this means that you are not running the plugin on the stack but only on a single slice. Thus I launched the following code: run("Bat Cochlea Volume (19K)"); run("Radial Profile Angle", "x_center=60.50 y_center=76.50 radius=68.50 starting_angle=0 integration_angle=180 calculate_radial_profile_on_stack"); run("Bat Cochlea Volume (19K)"); run("Radial Profile Angle", "x_center=60.50 y_center=76.50 radius=68.50 starting_angle=0 integration_angle=180"); So up to me the first part of the code should run the plugin over the whole stack as the second part should only run it over the first slice. But very surprisingly both parts of the code are running the plugin either on the stack or only the first slice depending on how the code had been launched the last time it had been used "manually" (i.e. outside of a macro). Thus in order to solve your issue you just need to run the plugin manually, select the calculate_radial_profile_on_stack option and press "Calculate Radial Profile and Exit". Once done you should then be able to run the macro over the whole stack within your macro. But from the results obtained from macro higher it means that the instruction " calculate_radial_profile_on_stack" within the macro code is completely ignored since it is actually taking the values of the last used state and I don't know how to solve this issue. My best regards, Philippe -----Message d'origine----- De : ImageJ Interest Group [mailto:[hidden email]] De la part de PEARSON Matthew Envoyé : jeudi 5 mars 2015 15:27 À : [hidden email] Objet : Re: Radial Profile Angle plugin error Hi Philippe, I have now updated FIJI to 1.49p and tried running it on an up to date PC as well as a Mac (what i normally use) to see if somehow there was a difference but i still get the out of bounds exception, i think i have pasted the code as you have it. run("Bat Cochlea Volume (19K)"); run("Radial Profile Angle", "x_center=60.50 y_center=76.50 radius=68.50 starting_angle=0 integration_angle=180 calculate_radial_profile_on_stack"); run("Clear Results"); for(j = 0; j != Ext.getStackSize; j++) { for(i2 = 0; i2 != Ext.getBinSize; i2++) { setResult("Slice", j * Ext.getBinSize + i2,j + 1); setResult("X" , j * Ext.getBinSize + i2,Ext.getXValue(i2)); setResult("Y" , j * Ext.getBinSize + i2,Ext.getYValue(j, i2)); } } updateResults(); ( Can you think ok anything else that could be different between our setups? The fact it occurs on now 3 different workstations i've tried. Its the same exception error from what i can see ArrayIndexOutOfBounds. Thanks again, Matt On 5 Mar 2015, at 09:26, Philippe CARL wrote: > Dear Matt, > I'm as well using Fiji on a daily basis and this with the last > released version (i.e. 1.49p) and the code is working fine. > I tried as well to run it as well under ImageJ (1.49p) and it is as > well working even if on the first run I had to replace run("Radial > Profile Angle", "x_center=60.50 y_center=76.50 radius=68.50 > starting_angle=0 integration_angle=180 > calculate_radial_profile_on_stack"); > by > run("Radial Profile Angle", "x_center=60.50 y_center=76.50 > radius=68.50 > starting_angle=0 integration_angle=180"); in order to the macro to be > run on the stack which is quite strange for me. > In all cases I would recommend you to update to the last version since > there was a bug connected with the Radial Profile Extended plugin that > has been fixed by Wayne (Thanks to Philippe Carl, fixed a bug that > caused plugins using the NonBlockingGenericDialog to hang when they > were called using the > run() macro function). > And if ImageJ is not recognizing the Ext function, this means that the > following code: > if (IJ.macroRunning()) > Functions.registerExtensions(this); > Within the plugin has not been launched. Could it be that the plugin > has not been launched within a macro? > I hope this helps you to go further. > My best regards, > Philippe > > -----Message d'origine----- > De : ImageJ Interest Group [mailto:[hidden email]] De la part de > Matt Pearson Envoyé : jeudi 5 mars 2015 09:22 À : [hidden email] > Objet : Re: Radial Profile Angle plugin error > > Hi Philippe, > > Thanks for your email. I have tried the code you pasted and use the > bat cochlea stack as an example but this still doesn't work for me > either in FIJI or Imagej1. In Fiji i get the same exception error and > when i try in > imagej1 I get this error: > > Unrecognised Ext function in line 3. > for (j = 0; j != Ext.getStackSize; j++) > > I doesn't seem to like the Ext.getStackSize for some reason. > > I'm running imagej 1.48v and FIJI 1.49i2. > > Thanks for the help again, > > Matt > > > > > > On 5 Mar 2015, at 07:48, Philippe CARL <[hidden email]> wrote: > >> Dear Matt, >> I thank you very much for using the Radial Profile Extended plugin. >> So I looked at your code and actually the problem comes from the way >> you launch the plugin: run("Radial Profile Angle", "use"); This >> instruction is quite incomplete and comes probably from a problem in >> the recording. >> Nevertheless, by launching this instruction you are not applying the >> plugin on the stack and thus, since you try later on to explore the >> values calculated on the stack, you get an out of bonds error >> (java.lang.ArrayIndexOutOfBoundsException: 1). >> So please try the following code: >> run("Bat Cochlea Volume (19K)"); >> run("Radial Profile Angle", "x_center=60.50 y_center=76.50 >> radius=68.50 starting_angle=0 integration_angle=180 >> calculate_radial_profile_on_stack"); >> run("Clear Results"); >> for(j = 0; j != Ext.getStackSize; j++) >> { >> for(i2 = 0; i2 != Ext.getBinSize; i2++) >> { >> setResult("Slice", j * Ext.getBinSize + i2, > j + 1); >> setResult("X" , j * Ext.getBinSize + i2, >> Ext.getXValue(i2)); >> setResult("Y" , j * Ext.getBinSize + i2, >> Ext.getYValue(j, i2)); >> } >> } >> updateResults(); >> Which uses your code on the "Bat Cochlea Volume (19K)" data and >> should > work. >> My 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 >> Matt Pearson Envoyé : mercredi 4 mars 2015 22:13 À : >> [hidden email] Objet : Radial Profile Angle plugin error >> >> Hi all, >> >> I'd like to use the Radial Profile Extended plugin on a stack of 3 >> I hope that if i have a selection in the image the plugin used within >> a macro will use this selection for the x,y and radius values as is >> the case for the built in Radial Profile plugin? Unfortunately >> though i get an error when running the extended plugin within a >> macro. I only seem to get the error when running the plugin on the stack. >> Below is the macro code and the error. >> >> Thanks for the help, >> >> Matt >> >> >> >> run("Radial Profile Angle", "use"); >> run("Clear Results"); >> for(j = 0; j != Ext.getStackSize; j++) >> { >> for(i2 = 0; i2 != Ext.getBinSize; i2++) >> { >> setResult("Slice", j * Ext.getBinSize + i2, > j + 1); >> setResult("X" , j * Ext.getBinSize + i2, >> Ext.getXValue(i2)); >> setResult("Y" , j * Ext.getBinSize + i2, >> Ext.getYValue(j, i2)); >> } >> } >> updateResults(); >> >> ------------------------------------------------------ >> >> (Fiji Is Just) ImageJ 2.0.0-rc-14/1.49i2; Java 1.6.0_65 [64-bit]; Mac >> OS X 10.8.5; 91MB of 2015MB (4%) >> >> java.lang.ArrayIndexOutOfBoundsException: 1 >> at >> > Radial_Profile_Angle_Ext.handleExtension(Radial_Profile_Angle_Ext.java > :513) >> at >> ij.macro.ExtensionDescriptor.dispatch(ExtensionDescriptor.java:288) >> at ij.macro.Functions.doExt(Functions.java:4261) >> at ij.macro.Functions.getStringFunction(Functions.java:267) >> at ij.macro.Interpreter.getStringTerm(Interpreter.java:1284) >> at ij.macro.Functions.getString(Functions.java:336) >> at ij.macro.Functions.setResult(Functions.java:1160) >> at ij.macro.Functions.doFunction(Functions.java:137) >> at ij.macro.Interpreter.doStatement(Interpreter.java:227) >> at ij.macro.Interpreter.doBlock(Interpreter.java:599) >> at ij.macro.Interpreter.doStatement(Interpreter.java:269) >> at ij.macro.Interpreter.doFor(Interpreter.java:526) >> at ij.macro.Interpreter.doStatement(Interpreter.java:251) >> at ij.macro.Interpreter.doBlock(Interpreter.java:599) >> at ij.macro.Interpreter.doStatement(Interpreter.java:269) >> at ij.macro.Interpreter.doFor(Interpreter.java:526) >> at ij.macro.Interpreter.doStatement(Interpreter.java:251) >> at ij.macro.Interpreter.doStatements(Interpreter.java:215) >> at ij.macro.Interpreter.run(Interpreter.java:112) >> at ij.macro.Interpreter.run(Interpreter.java:82) >> at ij.macro.Interpreter.run(Interpreter.java:93) >> at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:153) >> at ij.IJ.runMacro(IJ.java:119) >> at ij.IJ.runMacro(IJ.java:108) >> at net.imagej.legacy.IJ1Helper.runMacro(IJ1Helper.java:782) >> at >> net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:116) >> at >> net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:156) >> at org.scijava.script.ScriptModule.run(ScriptModule.java:175) >> at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167) >> at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126) >> at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65) >> at >> org.scijava.thread.DefaultThreadService$2.call(DefaultThreadService.j >> a >> va:164 >> ) >> at >> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) >> at java.util.concurrent.FutureTask.run(FutureTask.java:138) >> at >> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec >> u >> tor.ja >> va:895) >> at >> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor. >> java:9 >> 18) >> at java.lang.Thread.run(Thread.java:695) >> >> >> -- >> The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. >> >> -- >> ImageJ mailing list: http://imagej.nih.gov/ij/list.html >> >> -- >> ImageJ mailing list: http://imagej.nih.gov/ij/list.html >> > > > -- > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- Matt Pearson Microscopy Facility MRC Human Genetics Unit IGMM University of Edinburgh Crewe Road EH4 2XU -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. -- 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 PEARSON Matthew
Hi philippe,
Ah I see, I haven't had a chance to give this a try yet but I will tomorrow. Thanks for looking into this. I just have a couple more questions if I may. If I run the plugin manually, it doesn't seem to automatically input the x y and radius values from an active selection on the image? If not, can the plugin take variables as the x,y and radius inputs? As it takes the last values used when run manually i guess variables wouldnt work? Many thanks again, Matt -------- Original message -------- From: Philippe CARL <[hidden email]> Date:05/03/2015 16:15 (GMT+00:00) To: [hidden email] Subject: Re: Radial Profile Angle plugin error Dear Matt, I have good and bad news... The good news is that I know how to solve your issue... The bad news is that I just have found a bug (either in my plugin or in ImageJ) that I don't know how to solve. Like I said previously, if you are getting an out of bounds error (or if you prefer an ArrayIndexOutOfBounds exception) this means that you are not running the plugin on the stack but only on a single slice. Thus I launched the following code: run("Bat Cochlea Volume (19K)"); run("Radial Profile Angle", "x_center=60.50 y_center=76.50 radius=68.50 starting_angle=0 integration_angle=180 calculate_radial_profile_on_stack"); run("Bat Cochlea Volume (19K)"); run("Radial Profile Angle", "x_center=60.50 y_center=76.50 radius=68.50 starting_angle=0 integration_angle=180"); So up to me the first part of the code should run the plugin over the whole stack as the second part should only run it over the first slice. But very surprisingly both parts of the code are running the plugin either on the stack or only the first slice depending on how the code had been launched the last time it had been used "manually" (i.e. outside of a macro). Thus in order to solve your issue you just need to run the plugin manually, select the calculate_radial_profile_on_stack option and press "Calculate Radial Profile and Exit". Once done you should then be able to run the macro over the whole stack within your macro. But from the results obtained from macro higher it means that the instruction " calculate_radial_profile_on_stack" within the macro code is completely ignored since it is actually taking the values of the last used state and I don't know how to solve this issue. My best regards, Philippe -----Message d'origine----- De : ImageJ Interest Group [mailto:[hidden email]] De la part de PEARSON Matthew Envoyé : jeudi 5 mars 2015 15:27 À : [hidden email] Objet : Re: Radial Profile Angle plugin error Hi Philippe, I have now updated FIJI to 1.49p and tried running it on an up to date PC as well as a Mac (what i normally use) to see if somehow there was a difference but i still get the out of bounds exception, i think i have pasted the code as you have it. run("Bat Cochlea Volume (19K)"); run("Radial Profile Angle", "x_center=60.50 y_center=76.50 radius=68.50 starting_angle=0 integration_angle=180 calculate_radial_profile_on_stack"); run("Clear Results"); for(j = 0; j != Ext.getStackSize; j++) { for(i2 = 0; i2 != Ext.getBinSize; i2++) { setResult("Slice", j * Ext.getBinSize + i2,j + 1); setResult("X" , j * Ext.getBinSize + i2,Ext.getXValue(i2)); setResult("Y" , j * Ext.getBinSize + i2,Ext.getYValue(j, i2)); } } updateResults(); ( Can you think ok anything else that could be different between our setups? The fact it occurs on now 3 different workstations i've tried. Its the same exception error from what i can see ArrayIndexOutOfBounds. Thanks again, Matt On 5 Mar 2015, at 09:26, Philippe CARL wrote: > Dear Matt, > I'm as well using Fiji on a daily basis and this with the last > released version (i.e. 1.49p) and the code is working fine. > I tried as well to run it as well under ImageJ (1.49p) and it is as > well working even if on the first run I had to replace run("Radial > Profile Angle", "x_center=60.50 y_center=76.50 radius=68.50 > starting_angle=0 integration_angle=180 > calculate_radial_profile_on_stack"); > by > run("Radial Profile Angle", "x_center=60.50 y_center=76.50 > radius=68.50 > starting_angle=0 integration_angle=180"); in order to the macro to be > run on the stack which is quite strange for me. > In all cases I would recommend you to update to the last version since > there was a bug connected with the Radial Profile Extended plugin that > has been fixed by Wayne (Thanks to Philippe Carl, fixed a bug that > caused plugins using the NonBlockingGenericDialog to hang when they > were called using the > run() macro function). > And if ImageJ is not recognizing the Ext function, this means that the > following code: > if (IJ.macroRunning()) > Functions.registerExtensions(this); > Within the plugin has not been launched. Could it be that the plugin > has not been launched within a macro? > I hope this helps you to go further. > My best regards, > Philippe > > -----Message d'origine----- > De : ImageJ Interest Group [mailto:[hidden email]] De la part de > Matt Pearson Envoyé : jeudi 5 mars 2015 09:22 À : [hidden email] > Objet : Re: Radial Profile Angle plugin error > > Hi Philippe, > > Thanks for your email. I have tried the code you pasted and use the > bat cochlea stack as an example but this still doesn't work for me > either in FIJI or Imagej1. In Fiji i get the same exception error and > when i try in > imagej1 I get this error: > > Unrecognised Ext function in line 3. > for (j = 0; j != Ext.getStackSize; j++) > > I doesn't seem to like the Ext.getStackSize for some reason. > > I'm running imagej 1.48v and FIJI 1.49i2. > > Thanks for the help again, > > Matt > > > > > > On 5 Mar 2015, at 07:48, Philippe CARL <[hidden email]> wrote: > >> Dear Matt, >> I thank you very much for using the Radial Profile Extended plugin. >> So I looked at your code and actually the problem comes from the way >> you launch the plugin: run("Radial Profile Angle", "use"); This >> instruction is quite incomplete and comes probably from a problem in >> the recording. >> Nevertheless, by launching this instruction you are not applying the >> plugin on the stack and thus, since you try later on to explore the >> values calculated on the stack, you get an out of bonds error >> (java.lang.ArrayIndexOutOfBoundsException: 1). >> So please try the following code: >> run("Bat Cochlea Volume (19K)"); >> run("Radial Profile Angle", "x_center=60.50 y_center=76.50 >> radius=68.50 starting_angle=0 integration_angle=180 >> calculate_radial_profile_on_stack"); >> run("Clear Results"); >> for(j = 0; j != Ext.getStackSize; j++) >> { >> for(i2 = 0; i2 != Ext.getBinSize; i2++) >> { >> setResult("Slice", j * Ext.getBinSize + i2, > j + 1); >> setResult("X" , j * Ext.getBinSize + i2, >> Ext.getXValue(i2)); >> setResult("Y" , j * Ext.getBinSize + i2, >> Ext.getYValue(j, i2)); >> } >> } >> updateResults(); >> Which uses your code on the "Bat Cochlea Volume (19K)" data and >> should > work. >> My 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 >> Matt Pearson Envoyé : mercredi 4 mars 2015 22:13 À : >> [hidden email] Objet : Radial Profile Angle plugin error >> >> Hi all, >> >> I'd like to use the Radial Profile Extended plugin on a stack of 3 >> I hope that if i have a selection in the image the plugin used within >> a macro will use this selection for the x,y and radius values as is >> the case for the built in Radial Profile plugin? Unfortunately >> though i get an error when running the extended plugin within a >> macro. I only seem to get the error when running the plugin on the stack. >> Below is the macro code and the error. >> >> Thanks for the help, >> >> Matt >> >> >> >> run("Radial Profile Angle", "use"); >> run("Clear Results"); >> for(j = 0; j != Ext.getStackSize; j++) >> { >> for(i2 = 0; i2 != Ext.getBinSize; i2++) >> { >> setResult("Slice", j * Ext.getBinSize + i2, > j + 1); >> setResult("X" , j * Ext.getBinSize + i2, >> Ext.getXValue(i2)); >> setResult("Y" , j * Ext.getBinSize + i2, >> Ext.getYValue(j, i2)); >> } >> } >> updateResults(); >> >> ------------------------------------------------------ >> >> (Fiji Is Just) ImageJ 2.0.0-rc-14/1.49i2; Java 1.6.0_65 [64-bit]; Mac >> OS X 10.8.5; 91MB of 2015MB (4%) >> >> java.lang.ArrayIndexOutOfBoundsException: 1 >> at >> > Radial_Profile_Angle_Ext.handleExtension(Radial_Profile_Angle_Ext.java > :513) >> at >> ij.macro.ExtensionDescriptor.dispatch(ExtensionDescriptor.java:288) >> at ij.macro.Functions.doExt(Functions.java:4261) >> at ij.macro.Functions.getStringFunction(Functions.java:267) >> at ij.macro.Interpreter.getStringTerm(Interpreter.java:1284) >> at ij.macro.Functions.getString(Functions.java:336) >> at ij.macro.Functions.setResult(Functions.java:1160) >> at ij.macro.Functions.doFunction(Functions.java:137) >> at ij.macro.Interpreter.doStatement(Interpreter.java:227) >> at ij.macro.Interpreter.doBlock(Interpreter.java:599) >> at ij.macro.Interpreter.doStatement(Interpreter.java:269) >> at ij.macro.Interpreter.doFor(Interpreter.java:526) >> at ij.macro.Interpreter.doStatement(Interpreter.java:251) >> at ij.macro.Interpreter.doBlock(Interpreter.java:599) >> at ij.macro.Interpreter.doStatement(Interpreter.java:269) >> at ij.macro.Interpreter.doFor(Interpreter.java:526) >> at ij.macro.Interpreter.doStatement(Interpreter.java:251) >> at ij.macro.Interpreter.doStatements(Interpreter.java:215) >> at ij.macro.Interpreter.run(Interpreter.java:112) >> at ij.macro.Interpreter.run(Interpreter.java:82) >> at ij.macro.Interpreter.run(Interpreter.java:93) >> at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:153) >> at ij.IJ.runMacro(IJ.java:119) >> at ij.IJ.runMacro(IJ.java:108) >> at net.imagej.legacy.IJ1Helper.runMacro(IJ1Helper.java:782) >> at >> net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:116) >> at >> net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:156) >> at org.scijava.script.ScriptModule.run(ScriptModule.java:175) >> at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167) >> at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126) >> at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65) >> at >> org.scijava.thread.DefaultThreadService$2.call(DefaultThreadService.j >> a >> va:164 >> ) >> at >> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) >> at java.util.concurrent.FutureTask.run(FutureTask.java:138) >> at >> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec >> u >> tor.ja >> va:895) >> at >> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor. >> java:9 >> 18) >> at java.lang.Thread.run(Thread.java:695) >> >> >> -- >> The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. >> >> -- >> ImageJ mailing list: http://imagej.nih.gov/ij/list.html >> >> -- >> ImageJ mailing list: http://imagej.nih.gov/ij/list.html >> > > > -- > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- Matt Pearson Microscopy Facility MRC Human Genetics Unit IGMM University of Edinburgh Crewe Road EH4 2XU -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. -- 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 Matt,
I'm not sure whether I have correctly understand your question but I guess you want to know whether the different parameters (x, y, radius, starting/integration angle) are correctly taken into account and the answer is YES... But it is not the case of the CheckBox calculate_radial_profile_on_stack and I guess the same problem will as well applying to use_spatial_calibration. I looked in the code yesterday and have really no explanation about the origin of this different behavior between the numericFields and checkboxes... Thus if somebody has a clue about this issue I'm very interested about his lights. Nevertheless I hope that my help of yesterday helps you already to go further until this issue is completely corrected. My best regards, Philippe -----Message d'origine----- De : ImageJ Interest Group [mailto:[hidden email]] De la part de Matt Pearson Envoyé : jeudi 5 mars 2015 23:55 À : [hidden email] Objet : Re: Radial Profile Angle plugin error Hi philippe, Ah I see, I haven't had a chance to give this a try yet but I will tomorrow. Thanks for looking into this. I just have a couple more questions if I may. If I run the plugin manually, it doesn't seem to automatically input the x y and radius values from an active selection on the image? If not, can the plugin take variables as the x,y and radius inputs? As it takes the last values used when run manually i guess variables wouldnt work? Many thanks again, Matt -------- Original message -------- From: Philippe CARL <[hidden email]> Date:05/03/2015 16:15 (GMT+00:00) To: [hidden email] Subject: Re: Radial Profile Angle plugin error Dear Matt, I have good and bad news... The good news is that I know how to solve your issue... The bad news is that I just have found a bug (either in my plugin or in ImageJ) that I don't know how to solve. Like I said previously, if you are getting an out of bounds error (or if you prefer an ArrayIndexOutOfBounds exception) this means that you are not running the plugin on the stack but only on a single slice. Thus I launched the following code: run("Bat Cochlea Volume (19K)"); run("Radial Profile Angle", "x_center=60.50 y_center=76.50 radius=68.50 starting_angle=0 integration_angle=180 calculate_radial_profile_on_stack"); run("Bat Cochlea Volume (19K)"); run("Radial Profile Angle", "x_center=60.50 y_center=76.50 radius=68.50 starting_angle=0 integration_angle=180"); So up to me the first part of the code should run the plugin over the whole stack as the second part should only run it over the first slice. But very surprisingly both parts of the code are running the plugin either on the stack or only the first slice depending on how the code had been launched the last time it had been used "manually" (i.e. outside of a macro). Thus in order to solve your issue you just need to run the plugin manually, select the calculate_radial_profile_on_stack option and press "Calculate Radial Profile and Exit". Once done you should then be able to run the macro over the whole stack within your macro. But from the results obtained from macro higher it means that the instruction " calculate_radial_profile_on_stack" within the macro code is completely ignored since it is actually taking the values of the last used state and I don't know how to solve this issue. My best regards, Philippe -----Message d'origine----- De : ImageJ Interest Group [mailto:[hidden email]] De la part de PEARSON Matthew Envoyé : jeudi 5 mars 2015 15:27 À : [hidden email] Objet : Re: Radial Profile Angle plugin error Hi Philippe, I have now updated FIJI to 1.49p and tried running it on an up to date PC as well as a Mac (what i normally use) to see if somehow there was a difference but i still get the out of bounds exception, i think i have pasted the code as you have it. run("Bat Cochlea Volume (19K)"); run("Radial Profile Angle", "x_center=60.50 y_center=76.50 radius=68.50 starting_angle=0 integration_angle=180 calculate_radial_profile_on_stack"); run("Clear Results"); for(j = 0; j != Ext.getStackSize; j++) { for(i2 = 0; i2 != Ext.getBinSize; i2++) { setResult("Slice", j * Ext.getBinSize + i2,j + 1); setResult("X" , j * Ext.getBinSize + i2,Ext.getXValue(i2)); setResult("Y" , j * Ext.getBinSize + i2,Ext.getYValue(j, i2)); } } updateResults(); ( Can you think ok anything else that could be different between our setups? The fact it occurs on now 3 different workstations i've tried. Its the same exception error from what i can see ArrayIndexOutOfBounds. Thanks again, Matt On 5 Mar 2015, at 09:26, Philippe CARL wrote: > Dear Matt, > I'm as well using Fiji on a daily basis and this with the last > released version (i.e. 1.49p) and the code is working fine. > I tried as well to run it as well under ImageJ (1.49p) and it is as > well working even if on the first run I had to replace run("Radial > Profile Angle", "x_center=60.50 y_center=76.50 radius=68.50 > starting_angle=0 integration_angle=180 > calculate_radial_profile_on_stack"); > by > run("Radial Profile Angle", "x_center=60.50 y_center=76.50 > radius=68.50 > starting_angle=0 integration_angle=180"); in order to the macro to be > run on the stack which is quite strange for me. > In all cases I would recommend you to update to the last version since > there was a bug connected with the Radial Profile Extended plugin that > has been fixed by Wayne (Thanks to Philippe Carl, fixed a bug that > caused plugins using the NonBlockingGenericDialog to hang when they > were called using the > run() macro function). > And if ImageJ is not recognizing the Ext function, this means that the > following code: > if (IJ.macroRunning()) > Functions.registerExtensions(this); > Within the plugin has not been launched. Could it be that the plugin > has not been launched within a macro? > I hope this helps you to go further. > My best regards, > Philippe > > -----Message d'origine----- > De : ImageJ Interest Group [mailto:[hidden email]] De la part de > Matt Pearson Envoyé : jeudi 5 mars 2015 09:22 À : [hidden email] > Objet : Re: Radial Profile Angle plugin error > > Hi Philippe, > > Thanks for your email. I have tried the code you pasted and use the > bat cochlea stack as an example but this still doesn't work for me > either in FIJI or Imagej1. In Fiji i get the same exception error and > when i try in > imagej1 I get this error: > > Unrecognised Ext function in line 3. > for (j = 0; j != Ext.getStackSize; j++) > > I doesn't seem to like the Ext.getStackSize for some reason. > > I'm running imagej 1.48v and FIJI 1.49i2. > > Thanks for the help again, > > Matt > > > > > > On 5 Mar 2015, at 07:48, Philippe CARL <[hidden email]> wrote: > >> Dear Matt, >> I thank you very much for using the Radial Profile Extended plugin. >> So I looked at your code and actually the problem comes from the way >> you launch the plugin: run("Radial Profile Angle", "use"); This >> instruction is quite incomplete and comes probably from a problem in >> the recording. >> Nevertheless, by launching this instruction you are not applying the >> plugin on the stack and thus, since you try later on to explore the >> values calculated on the stack, you get an out of bonds error >> (java.lang.ArrayIndexOutOfBoundsException: 1). >> So please try the following code: >> run("Bat Cochlea Volume (19K)"); >> run("Radial Profile Angle", "x_center=60.50 y_center=76.50 >> radius=68.50 starting_angle=0 integration_angle=180 >> calculate_radial_profile_on_stack"); >> run("Clear Results"); >> for(j = 0; j != Ext.getStackSize; j++) >> { >> for(i2 = 0; i2 != Ext.getBinSize; i2++) { setResult("Slice", j * >> Ext.getBinSize + i2, > j + 1); >> setResult("X" , j * Ext.getBinSize + i2, >> Ext.getXValue(i2)); >> setResult("Y" , j * Ext.getBinSize + i2, >> Ext.getYValue(j, i2)); >> } >> } >> updateResults(); >> Which uses your code on the "Bat Cochlea Volume (19K)" data and >> should > work. >> My 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 >> Matt Pearson Envoyé : mercredi 4 mars 2015 22:13 À : >> [hidden email] Objet : Radial Profile Angle plugin error >> >> Hi all, >> >> I'd like to use the Radial Profile Extended plugin on a stack of 3 >> I hope that if i have a selection in the image the plugin used within >> a macro will use this selection for the x,y and radius values as is >> the case for the built in Radial Profile plugin? Unfortunately >> though i get an error when running the extended plugin within a >> macro. I only seem to get the error when running the plugin on the stack. >> Below is the macro code and the error. >> >> Thanks for the help, >> >> Matt >> >> >> >> run("Radial Profile Angle", "use"); >> run("Clear Results"); >> for(j = 0; j != Ext.getStackSize; j++) >> { >> for(i2 = 0; i2 != Ext.getBinSize; i2++) { setResult("Slice", j * >> Ext.getBinSize + i2, > j + 1); >> setResult("X" , j * Ext.getBinSize + i2, >> Ext.getXValue(i2)); >> setResult("Y" , j * Ext.getBinSize + i2, >> Ext.getYValue(j, i2)); >> } >> } >> updateResults(); >> >> ------------------------------------------------------ >> >> (Fiji Is Just) ImageJ 2.0.0-rc-14/1.49i2; Java 1.6.0_65 [64-bit]; Mac >> OS X 10.8.5; 91MB of 2015MB (4%) >> >> java.lang.ArrayIndexOutOfBoundsException: 1 at >> > Radial_Profile_Angle_Ext.handleExtension(Radial_Profile_Angle_Ext.java > :513) >> at >> ij.macro.ExtensionDescriptor.dispatch(ExtensionDescriptor.java:288) >> at ij.macro.Functions.doExt(Functions.java:4261) >> at ij.macro.Functions.getStringFunction(Functions.java:267) >> at ij.macro.Interpreter.getStringTerm(Interpreter.java:1284) >> at ij.macro.Functions.getString(Functions.java:336) >> at ij.macro.Functions.setResult(Functions.java:1160) >> at ij.macro.Functions.doFunction(Functions.java:137) >> at ij.macro.Interpreter.doStatement(Interpreter.java:227) >> at ij.macro.Interpreter.doBlock(Interpreter.java:599) >> at ij.macro.Interpreter.doStatement(Interpreter.java:269) >> at ij.macro.Interpreter.doFor(Interpreter.java:526) >> at ij.macro.Interpreter.doStatement(Interpreter.java:251) >> at ij.macro.Interpreter.doBlock(Interpreter.java:599) >> at ij.macro.Interpreter.doStatement(Interpreter.java:269) >> at ij.macro.Interpreter.doFor(Interpreter.java:526) >> at ij.macro.Interpreter.doStatement(Interpreter.java:251) >> at ij.macro.Interpreter.doStatements(Interpreter.java:215) >> at ij.macro.Interpreter.run(Interpreter.java:112) >> at ij.macro.Interpreter.run(Interpreter.java:82) >> at ij.macro.Interpreter.run(Interpreter.java:93) >> at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:153) >> at ij.IJ.runMacro(IJ.java:119) >> at ij.IJ.runMacro(IJ.java:108) >> at net.imagej.legacy.IJ1Helper.runMacro(IJ1Helper.java:782) >> at >> net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:116) >> at >> net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:156) >> at org.scijava.script.ScriptModule.run(ScriptModule.java:175) >> at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167) >> at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126) >> at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65) >> at >> org.scijava.thread.DefaultThreadService$2.call(DefaultThreadService.j >> a >> va:164 >> ) >> at >> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) >> at java.util.concurrent.FutureTask.run(FutureTask.java:138) >> at >> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec >> u >> tor.ja >> va:895) >> at >> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor. >> java:9 >> 18) >> at java.lang.Thread.run(Thread.java:695) >> >> >> -- >> The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. >> >> -- >> ImageJ mailing list: http://imagej.nih.gov/ij/list.html >> >> -- >> ImageJ mailing list: http://imagej.nih.gov/ij/list.html >> > > > -- > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- Matt Pearson Microscopy Facility MRC Human Genetics Unit IGMM University of Edinburgh Crewe Road EH4 2XU -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. -- 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 |
Hi Philippe,
Yes i think it does what i need. Thanks for your time and effort. All the best, Matt On 6 Mar 2015, at 08:06, Philippe CARL wrote: > Dear Matt, > I'm not sure whether I have correctly understand your question but I guess you want to know whether the different parameters (x, y, radius, starting/integration angle) are correctly taken into account and the answer is YES... > But it is not the case of the CheckBox calculate_radial_profile_on_stack and I guess the same problem will as well applying to use_spatial_calibration. > I looked in the code yesterday and have really no explanation about the origin of this different behavior between the numericFields and checkboxes... > Thus if somebody has a clue about this issue I'm very interested about his lights. > Nevertheless I hope that my help of yesterday helps you already to go further until this issue is completely corrected. > My best regards, > Philippe > > -----Message d'origine----- > De : ImageJ Interest Group [mailto:[hidden email]] De la part de Matt Pearson > Envoyé : jeudi 5 mars 2015 23:55 > À : [hidden email] > Objet : Re: Radial Profile Angle plugin error > > Hi philippe, > > Ah I see, I haven't had a chance to give this a try yet but I will tomorrow. Thanks for looking into this. I just have a couple more questions if I may. > > If I run the plugin manually, it doesn't seem to automatically input the x y and radius values from an active selection on the image? If not, can the plugin take variables as the x,y and radius inputs? As it takes the last values used when run manually i guess variables wouldnt work? > > Many thanks again, > > Matt > > > > > -------- Original message -------- > From: Philippe CARL <[hidden email]> > Date:05/03/2015 16:15 (GMT+00:00) > To: [hidden email] > Subject: Re: Radial Profile Angle plugin error > > Dear Matt, > I have good and bad news... > The good news is that I know how to solve your issue... > The bad news is that I just have found a bug (either in my plugin or in > ImageJ) that I don't know how to solve. > Like I said previously, if you are getting an out of bounds error (or if you prefer an ArrayIndexOutOfBounds exception) this means that you are not running the plugin on the stack but only on a single slice. > Thus I launched the following code: > > run("Bat Cochlea Volume (19K)"); > run("Radial Profile Angle", "x_center=60.50 y_center=76.50 radius=68.50 > starting_angle=0 integration_angle=180 calculate_radial_profile_on_stack"); > run("Bat Cochlea Volume (19K)"); > run("Radial Profile Angle", "x_center=60.50 y_center=76.50 radius=68.50 > starting_angle=0 integration_angle=180"); > > So up to me the first part of the code should run the plugin over the whole stack as the second part should only run it over the first slice. > But very surprisingly both parts of the code are running the plugin either on the stack or only the first slice depending on how the code had been launched the last time it had been used "manually" (i.e. outside of a macro). > Thus in order to solve your issue you just need to run the plugin manually, select the calculate_radial_profile_on_stack option and press "Calculate Radial Profile and Exit". > Once done you should then be able to run the macro over the whole stack within your macro. > But from the results obtained from macro higher it means that the instruction " calculate_radial_profile_on_stack" within the macro code is completely ignored since it is actually taking the values of the last used state and I don't know how to solve this issue. > My best regards, > Philippe > > -----Message d'origine----- > De : ImageJ Interest Group [mailto:[hidden email]] De la part de PEARSON Matthew Envoyé : jeudi 5 mars 2015 15:27 À : [hidden email] Objet : Re: Radial Profile Angle plugin error > > Hi Philippe, > > I have now updated FIJI to 1.49p and tried running it on an up to date PC as well as a Mac (what i normally use) to see if somehow there was a difference but i still get the out of bounds exception, i think i have pasted the code as you have it. > > run("Bat Cochlea Volume (19K)"); > run("Radial Profile Angle", "x_center=60.50 y_center=76.50 > radius=68.50 starting_angle=0 integration_angle=180 calculate_radial_profile_on_stack"); > run("Clear Results"); > for(j = 0; j != Ext.getStackSize; j++) > { > for(i2 = 0; i2 != Ext.getBinSize; i2++) > { > setResult("Slice", j * Ext.getBinSize + i2,j > + 1); > setResult("X" , j * Ext.getBinSize + > i2,Ext.getXValue(i2)); > setResult("Y" , j * Ext.getBinSize + > i2,Ext.getYValue(j, i2)); > } > } > updateResults(); > > ( > > Can you think ok anything else that could be different between our setups? > The fact it occurs on now 3 different workstations i've tried. Its the same exception error from what i can see ArrayIndexOutOfBounds. > > Thanks again, > > Matt > > > > > On 5 Mar 2015, at 09:26, Philippe CARL wrote: > >> Dear Matt, >> I'm as well using Fiji on a daily basis and this with the last >> released version (i.e. 1.49p) and the code is working fine. >> I tried as well to run it as well under ImageJ (1.49p) and it is as >> well working even if on the first run I had to replace run("Radial >> Profile Angle", "x_center=60.50 y_center=76.50 radius=68.50 >> starting_angle=0 integration_angle=180 >> calculate_radial_profile_on_stack"); >> by >> run("Radial Profile Angle", "x_center=60.50 y_center=76.50 >> radius=68.50 >> starting_angle=0 integration_angle=180"); in order to the macro to be >> run on the stack which is quite strange for me. >> In all cases I would recommend you to update to the last version since >> there was a bug connected with the Radial Profile Extended plugin that >> has been fixed by Wayne (Thanks to Philippe Carl, fixed a bug that >> caused plugins using the NonBlockingGenericDialog to hang when they >> were called using the >> run() macro function). >> And if ImageJ is not recognizing the Ext function, this means that the >> following code: >> if (IJ.macroRunning()) >> Functions.registerExtensions(this); >> Within the plugin has not been launched. Could it be that the plugin >> has not been launched within a macro? >> I hope this helps you to go further. >> My best regards, >> Philippe >> >> -----Message d'origine----- >> De : ImageJ Interest Group [mailto:[hidden email]] De la part de >> Matt Pearson Envoyé : jeudi 5 mars 2015 09:22 À : [hidden email] >> Objet : Re: Radial Profile Angle plugin error >> >> Hi Philippe, >> >> Thanks for your email. I have tried the code you pasted and use the >> bat cochlea stack as an example but this still doesn't work for me >> either in FIJI or Imagej1. In Fiji i get the same exception error and >> when i try in >> imagej1 I get this error: >> >> Unrecognised Ext function in line 3. >> for (j = 0; j != Ext.getStackSize; j++) >> >> I doesn't seem to like the Ext.getStackSize for some reason. >> >> I'm running imagej 1.48v and FIJI 1.49i2. >> >> Thanks for the help again, >> >> Matt >> >> >> >> >> >> On 5 Mar 2015, at 07:48, Philippe CARL <[hidden email]> wrote: >> >>> Dear Matt, >>> I thank you very much for using the Radial Profile Extended plugin. >>> So I looked at your code and actually the problem comes from the way >>> you launch the plugin: run("Radial Profile Angle", "use"); This >>> instruction is quite incomplete and comes probably from a problem in >>> the recording. >>> Nevertheless, by launching this instruction you are not applying the >>> plugin on the stack and thus, since you try later on to explore the >>> values calculated on the stack, you get an out of bonds error >>> (java.lang.ArrayIndexOutOfBoundsException: 1). >>> So please try the following code: >>> run("Bat Cochlea Volume (19K)"); >>> run("Radial Profile Angle", "x_center=60.50 y_center=76.50 >>> radius=68.50 starting_angle=0 integration_angle=180 >>> calculate_radial_profile_on_stack"); >>> run("Clear Results"); >>> for(j = 0; j != Ext.getStackSize; j++) >>> { >>> for(i2 = 0; i2 != Ext.getBinSize; i2++) { setResult("Slice", j * >>> Ext.getBinSize + i2, >> j + 1); >>> setResult("X" , j * Ext.getBinSize + i2, >>> Ext.getXValue(i2)); >>> setResult("Y" , j * Ext.getBinSize + i2, >>> Ext.getYValue(j, i2)); >>> } >>> } >>> updateResults(); >>> Which uses your code on the "Bat Cochlea Volume (19K)" data and >>> should >> work. >>> My 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 >>> Matt Pearson Envoyé : mercredi 4 mars 2015 22:13 À : >>> [hidden email] Objet : Radial Profile Angle plugin error >>> >>> Hi all, >>> >>> I'd like to use the Radial Profile Extended plugin on a stack of 3 > images. >>> I hope that if i have a selection in the image the plugin used within >>> a macro will use this selection for the x,y and radius values as is >>> the case for the built in Radial Profile plugin? Unfortunately >>> though i get an error when running the extended plugin within a >>> macro. I only seem to get the error when running the plugin on the > stack. >>> Below is the macro code and the error. >>> >>> Thanks for the help, >>> >>> Matt >>> >>> >>> >>> run("Radial Profile Angle", "use"); >>> run("Clear Results"); >>> for(j = 0; j != Ext.getStackSize; j++) >>> { >>> for(i2 = 0; i2 != Ext.getBinSize; i2++) { setResult("Slice", j * >>> Ext.getBinSize + i2, >> j + 1); >>> setResult("X" , j * Ext.getBinSize + i2, >>> Ext.getXValue(i2)); >>> setResult("Y" , j * Ext.getBinSize + i2, >>> Ext.getYValue(j, i2)); >>> } >>> } >>> updateResults(); >>> >>> ------------------------------------------------------ >>> >>> (Fiji Is Just) ImageJ 2.0.0-rc-14/1.49i2; Java 1.6.0_65 [64-bit]; Mac >>> OS X 10.8.5; 91MB of 2015MB (4%) >>> >>> java.lang.ArrayIndexOutOfBoundsException: 1 at >>> >> Radial_Profile_Angle_Ext.handleExtension(Radial_Profile_Angle_Ext.java >> :513) >>> at >>> ij.macro.ExtensionDescriptor.dispatch(ExtensionDescriptor.java:288) >>> at ij.macro.Functions.doExt(Functions.java:4261) >>> at ij.macro.Functions.getStringFunction(Functions.java:267) >>> at ij.macro.Interpreter.getStringTerm(Interpreter.java:1284) >>> at ij.macro.Functions.getString(Functions.java:336) >>> at ij.macro.Functions.setResult(Functions.java:1160) >>> at ij.macro.Functions.doFunction(Functions.java:137) >>> at ij.macro.Interpreter.doStatement(Interpreter.java:227) >>> at ij.macro.Interpreter.doBlock(Interpreter.java:599) >>> at ij.macro.Interpreter.doStatement(Interpreter.java:269) >>> at ij.macro.Interpreter.doFor(Interpreter.java:526) >>> at ij.macro.Interpreter.doStatement(Interpreter.java:251) >>> at ij.macro.Interpreter.doBlock(Interpreter.java:599) >>> at ij.macro.Interpreter.doStatement(Interpreter.java:269) >>> at ij.macro.Interpreter.doFor(Interpreter.java:526) >>> at ij.macro.Interpreter.doStatement(Interpreter.java:251) >>> at ij.macro.Interpreter.doStatements(Interpreter.java:215) >>> at ij.macro.Interpreter.run(Interpreter.java:112) >>> at ij.macro.Interpreter.run(Interpreter.java:82) >>> at ij.macro.Interpreter.run(Interpreter.java:93) >>> at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:153) >>> at ij.IJ.runMacro(IJ.java:119) >>> at ij.IJ.runMacro(IJ.java:108) >>> at net.imagej.legacy.IJ1Helper.runMacro(IJ1Helper.java:782) >>> at >>> net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:116) >>> at >>> net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:156) >>> at org.scijava.script.ScriptModule.run(ScriptModule.java:175) >>> at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167) >>> at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126) >>> at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65) >>> at >>> org.scijava.thread.DefaultThreadService$2.call(DefaultThreadService.j >>> a >>> va:164 >>> ) >>> at >>> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) >>> at java.util.concurrent.FutureTask.run(FutureTask.java:138) >>> at >>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec >>> u >>> tor.ja >>> va:895) >>> at >>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor. >>> java:9 >>> 18) >>> at java.lang.Thread.run(Thread.java:695) >>> >>> >>> -- >>> The University of Edinburgh is a charitable body, registered in >>> Scotland, with registration number SC005336. >>> >>> -- >>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html >>> >>> -- >>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html >>> >> >> >> -- >> The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. >> >> -- >> ImageJ mailing list: http://imagej.nih.gov/ij/list.html >> >> -- >> ImageJ mailing list: http://imagej.nih.gov/ij/list.html >> > > -- > Matt Pearson > Microscopy Facility > MRC Human Genetics Unit > IGMM > University of Edinburgh > Crewe Road > EH4 2XU > > > -- > The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. > > -- > 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 > Matt Pearson Microscopy Facility MRC Human Genetics Unit IGMM University of Edinburgh Crewe Road EH4 2XU -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |