Dear TrakEM developers and experts,
A jython script which has worked just fine for years, is broken by new versions of imagej and Fiji. In the line of code front = Display.getFront() I get the message: NameError: name 'Display' is not defined Is there a workaround for this or a bug fix in sight, besides keeping an old version of Fiji? Below is the full error message. Thank you very much for your help! Best regards from Switzerland, Moritz Started Selectcolorinmultiplelayersver5_2mo.py at Wed Oct 15 15:57:40 CEST 2014 Traceback (most recent call last): File "C:\Users\kirsmori\Dropbox\FMI\Imagej_macros\EM_related\Selectcolorinmultiplelayersver5_2mo.py", line 79, in <module> front = Display.getFront() NameError: name 'Display' is not defined at org.python.core.PyException.fillInStackTrace(PyException.java:70) at java.lang.Throwable.<init>(Throwable.java:181) at java.lang.Exception.<init>(Exception.java:29) at java.lang.RuntimeException.<init>(RuntimeException.java:32) at org.python.core.PyException.<init>(PyException.java:46) at org.python.core.PyException.<init>(PyException.java:43) at org.python.core.PyException.<init>(PyException.java:61) at org.python.core.Py.NameError(Py.java:260) at org.python.core.PyFrame.getname(PyFrame.java:257) at org.python.pycode._pyx2.f$0(C:\Users\kirsmori\Dropbox\FMI\Imagej_macros\EM_related\Selectcolorinmultiplelayersver5_2mo.py:148) at org.python.pycode._pyx2.call_function(C:\Users\kirsmori\Dropbox\FMI\Imagej_macros\EM_related\Selectcolorinmultiplelayersver5_2mo.py) at org.python.core.PyTableCode.call(PyTableCode.java:165) at org.python.core.PyCode.call(PyCode.java:18) at org.python.core.Py.runCode(Py.java:1275) at org.scijava.plugins.scripting.jython.JythonScriptEngine.eval(JythonScriptEngine.java:76) 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:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Moritz,
Fiji does no longer autoimport classes. Add this to the top: from ini.trakem2.display import Display ... and the jython script will work again. Best regards, Albert > On Oct 16, 2014, at 7:45 AM, "Kirschmann, Moritz" <[hidden email]> wrote: > > Dear TrakEM developers and experts, > > A jython script which has worked just fine for years, is broken by new versions of imagej and Fiji. > In the line of code > front = Display.getFront() > I get the message: > NameError: name 'Display' is not defined > Is there a workaround for this or a bug fix in sight, besides keeping an old version of Fiji? > Below is the full error message. > > Thank you very much for your help! > > Best regards from Switzerland, Moritz > > > > > > > Started Selectcolorinmultiplelayersver5_2mo.py at Wed Oct 15 15:57:40 CEST 2014 > Traceback (most recent call last): > File "C:\Users\kirsmori\Dropbox\FMI\Imagej_macros\EM_related\Selectcolorinmultiplelayersver5_2mo.py", line 79, in <module> > front = Display.getFront() > NameError: name 'Display' is not defined > > at org.python.core.PyException.fillInStackTrace(PyException.java:70) > at java.lang.Throwable.<init>(Throwable.java:181) > at java.lang.Exception.<init>(Exception.java:29) > at java.lang.RuntimeException.<init>(RuntimeException.java:32) > at org.python.core.PyException.<init>(PyException.java:46) > at org.python.core.PyException.<init>(PyException.java:43) > at org.python.core.PyException.<init>(PyException.java:61) > at org.python.core.Py.NameError(Py.java:260) > at org.python.core.PyFrame.getname(PyFrame.java:257) > at org.python.pycode._pyx2.f$0(C:\Users\kirsmori\Dropbox\FMI\Imagej_macros\EM_related\Selectcolorinmultiplelayersver5_2mo.py:148) > at org.python.pycode._pyx2.call_function(C:\Users\kirsmori\Dropbox\FMI\Imagej_macros\EM_related\Selectcolorinmultiplelayersver5_2mo.py) > at org.python.core.PyTableCode.call(PyTableCode.java:165) > at org.python.core.PyCode.call(PyCode.java:18) > at org.python.core.Py.runCode(Py.java:1275) > at org.scijava.plugins.scripting.jython.JythonScriptEngine.eval(JythonScriptEngine.java:76) > 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:886) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > at java.lang.Thread.run(Thread.java:619) > > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Dear Albert,
Thank you! Perfect! Best Moritz -----Original Message----- From: Albert Cardona [mailto:[hidden email]] Sent: Friday, October 17, 2014 11:34 AM To: <[hidden email]>; Kirschmann, Moritz Subject: Re: trakEM jython script does not work in newer versions of Fiji Hi Moritz, Fiji does no longer autoimport classes. Add this to the top: from ini.trakem2.display import Display ... and the jython script will work again. Best regards, Albert > On Oct 16, 2014, at 7:45 AM, "Kirschmann, Moritz" <[hidden email]> wrote: > > Dear TrakEM developers and experts, > > A jython script which has worked just fine for years, is broken by new versions of imagej and Fiji. > In the line of code > front = Display.getFront() > I get the message: > NameError: name 'Display' is not defined Is there a workaround for > this or a bug fix in sight, besides keeping an old version of Fiji? > Below is the full error message. > > Thank you very much for your help! > > Best regards from Switzerland, Moritz > > > > > > > Started Selectcolorinmultiplelayersver5_2mo.py at Wed Oct 15 15:57:40 > CEST 2014 Traceback (most recent call last): > File "C:\Users\kirsmori\Dropbox\FMI\Imagej_macros\EM_related\Selectcolorinmultiplelayersver5_2mo.py", line 79, in <module> > front = Display.getFront() > NameError: name 'Display' is not defined > > at org.python.core.PyException.fillInStackTrace(PyException.java:70) > at java.lang.Throwable.<init>(Throwable.java:181) > at java.lang.Exception.<init>(Exception.java:29) > at java.lang.RuntimeException.<init>(RuntimeException.java:32) > at org.python.core.PyException.<init>(PyException.java:46) > at org.python.core.PyException.<init>(PyException.java:43) > at org.python.core.PyException.<init>(PyException.java:61) > at org.python.core.Py.NameError(Py.java:260) > at org.python.core.PyFrame.getname(PyFrame.java:257) > at org.python.pycode._pyx2.f$0(C:\Users\kirsmori\Dropbox\FMI\Imagej_macros\EM_related\Selectcolorinmultiplelayersver5_2mo.py:148) > at org.python.pycode._pyx2.call_function(C:\Users\kirsmori\Dropbox\FMI\Imagej_macros\EM_related\Selectcolorinmultiplelayersver5_2mo.py) > at org.python.core.PyTableCode.call(PyTableCode.java:165) > at org.python.core.PyCode.call(PyCode.java:18) > at org.python.core.Py.runCode(Py.java:1275) > at org.scijava.plugins.scripting.jython.JythonScriptEngine.eval(JythonScriptEngine.java:76) > 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:886) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > at java.lang.Thread.run(Thread.java:619) > > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi all,
>Fiji does no longer autoimport classes Sorry if this is off-topic, but this seemed like a good time to clarify that this is no longer strictly the case. There is now a plugin mechanism for Script Headers <https://github.com/scijava/scijava-common/blob/master/src/main/java/org/scijava/script/ScriptHeader.java>. These are per-language, and multiple headers can co-exist. Apologies that this was not clear earlier, and is completely undocumented. I will put something up on the wiki <http://imagej.net/Script_Editor_Auto_Import> in the next hour or so and link it in with the rest of the scripting documentation <http://imagej.net/Scripting>. Best, Mark On Fri, Oct 17, 2014 at 6:48 AM, Kirschmann, Moritz < [hidden email]> wrote: > Dear Albert, > > Thank you! Perfect! > > Best Moritz > > -----Original Message----- > From: Albert Cardona [mailto:[hidden email]] > Sent: Friday, October 17, 2014 11:34 AM > To: <[hidden email]>; Kirschmann, Moritz > Subject: Re: trakEM jython script does not work in newer versions of Fiji > > Hi Moritz, > > Fiji does no longer autoimport classes. Add this to the top: > > from ini.trakem2.display import Display > > > ... and the jython script will work again. > > Best regards, > > Albert > > > > On Oct 16, 2014, at 7:45 AM, "Kirschmann, Moritz" < > [hidden email]> wrote: > > > > Dear TrakEM developers and experts, > > > > A jython script which has worked just fine for years, is broken by new > versions of imagej and Fiji. > > In the line of code > > front = Display.getFront() > > I get the message: > > NameError: name 'Display' is not defined Is there a workaround for > > this or a bug fix in sight, besides keeping an old version of Fiji? > > Below is the full error message. > > > > Thank you very much for your help! > > > > Best regards from Switzerland, Moritz > > > > > > > > > > > > > > Started Selectcolorinmultiplelayersver5_2mo.py at Wed Oct 15 15:57:40 > > CEST 2014 Traceback (most recent call last): > > File > "C:\Users\kirsmori\Dropbox\FMI\Imagej_macros\EM_related\Selectcolorinmultiplelayersver5_2mo.py", > line 79, in <module> > > front = Display.getFront() > > NameError: name 'Display' is not defined > > > > at > org.python.core.PyException.fillInStackTrace(PyException.java:70) > > at java.lang.Throwable.<init>(Throwable.java:181) > > at java.lang.Exception.<init>(Exception.java:29) > > at > java.lang.RuntimeException.<init>(RuntimeException.java:32) > > at org.python.core.PyException.<init>(PyException.java:46) > > at org.python.core.PyException.<init>(PyException.java:43) > > at org.python.core.PyException.<init>(PyException.java:61) > > at org.python.core.Py.NameError(Py.java:260) > > at org.python.core.PyFrame.getname(PyFrame.java:257) > > at > org.python.pycode._pyx2.f$0(C:\Users\kirsmori\Dropbox\FMI\Imagej_macros\EM_related\Selectcolorinmultiplelayersver5_2mo.py:148) > > at > org.python.pycode._pyx2.call_function(C:\Users\kirsmori\Dropbox\FMI\Imagej_macros\EM_related\Selectcolorinmultiplelayersver5_2mo.py) > > at org.python.core.PyTableCode.call(PyTableCode.java:165) > > at org.python.core.PyCode.call(PyCode.java:18) > > at org.python.core.Py.runCode(Py.java:1275) > > at > org.scijava.plugins.scripting.jython.JythonScriptEngine.eval(JythonScriptEngine.java:76) > > 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:886) > > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > > at java.lang.Thread.run(Thread.java:619) > > > > > > -- > > 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 |
Free forum by Nabble | Edit this page |