Posted by
Jacqueline Ross on
Mar 18, 2015; 4:52am
URL: http://imagej.273.s1.nabble.com/FW-Directionality-plugin-getting-Directionality-analysis-output-values-tp5011976p5012050.html
Hi Jan and John,
Thanks very much for your assistance with the macro and for the explanation of what was going wrong. The macro for the fit parameters is all working well now so I'm very happy. (Thanks to Kenton and Gabriel who confirmed that they also had problems with it as that made me feel a bit better about not being able to work it out myself).
However, I have one further question sorry. The macro above that one, under General Scripting, is also working OK except for the Orientation map. I don't necessarily need it but it would be good if I could get that macro to work too. It seems to be a similar error related to ImagePlus. If I take the lines out which relate to the orientation map, it all works fine.
The error I get is as follows;
Started Directionality_standard_.py at Wed Mar 18 17:45:47 NZDT 2015
Traceback (most recent call last):
File "C:\Users\jros013\Desktop\Fiji.app\macros\Directionality_standard_.py", line 35, in <module>
ImagePlus("Orientation map", stack).show()
NameError: name 'ImagePlus' 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._pyx7.f$0(C:\Users\jros013\Desktop\Fiji.app\macros\Directionality_standard_.py:38)
at org.python.pycode._pyx7.call_function(C:\Users\jros013\Desktop\Fiji.app\macros\Directionality_standard_.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:662)
Thanks!
Kind regards,
Jacqui
Jacqueline Ross
Biomedical Imaging Microscopist
Biomedical Imaging Research Unit
School of Medical Sciences
Faculty of Medical & Health Sciences
The University of Auckland
Private Bag 92019
Auckland 1142, NEW ZEALAND
Tel: 64 9 923 7438
Fax: 64 9 373 7484
http://www.fmhs.auckland.ac.nz/sms/biru/-----Original Message-----
From: ImageJ Interest Group [mailto:
[hidden email]] On Behalf Of Jan Eglinger
Sent: Wednesday, 18 March 2015 10:10 a.m.
To:
[hidden email]
Subject: Re: FW: Directionality plugin - getting Directionality analysis output values
Hi all,
you were right, the import statement was missing.
I added the missing imports to the example script on the Fiji/ImageJ wiki:
http://fiji.sc/Directionality#Getting_the_fit_parametersCheers,
Jan
Am 17.03.15 um 12:27 schrieb John Minter:
> Jacqui,
>
> Did you add "from ij import WindowManager" to the top of your python script?
>
> The
http://fiji.sc/Jython_Scripting page provides this reminder (that
> has burned me more times than I care to admit...):
>
> "Unlike ImageJ 1.x <
http://fiji.sc/ImageJ_1.x>, ImageJ2
> <
http://fiji.sc/ImageJ2> (and therefore Fiji <
http://fiji.sc/Fiji>)
> does not automatically import any classes. Consequently, scripts
> written for ImageJ 1.x <
http://fiji.sc/ImageJ_1.x> will not run in
> ImageJ2 <
http://fiji.sc/ImageJ2> without adding the proper imports. "
>
> Best regards,
> John
>
>
>
> On Tue, Mar 17, 2015 at 1:06 AM, Jacqui Ross
> <
[hidden email]>
> wrote:
>
>> Thanks Jean-Yves,
>>
>> I tried running the first macro directly and got the errors listed
>> below - something to do with defining the WindowManager..? Is there
>> something else I need to install for this to work?
>>
>> Traceback (most recent call last):
>> File
>> "C:\Users\jros013\Desktop\Fiji.app\macros\Directionality_standard_.py
>> ",
>> line 7, in <module>
>> dir.setImagePlus(WindowManager.getCurrentImage())
>> NameError: name 'WindowManager' 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._pyx10.f$0(C:\Users\jros013\Desktop\Fiji.app\macros\Directionality_standard_.py:35)
>> at
>> org.python.pycode._pyx10.call_function(C:\Users\jros013\Desktop\Fiji.app\macros\Directionality_standard_.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:662)
>>
>> If you have any further suggestions, I'd be very grateful. I've
>> downloaded your example images to use to test the macros.
>>
>> Thanks to Herbie also for sending me the links to some interesting papers.
>>
>> Kind regards,
>>
>> Jacqui
>>
>> Jacqueline Ross
>> Biomedical Imaging Microscopist
>> Biomedical Imaging Research Unit
>> School of Medical Sciences
>> Faculty of Medical & Health Sciences
>> The University of Auckland
>> Private Bag 92019
>> Auckland 1142, NEW ZEALAND
>>
>> Tel: 64 9 923 7438
>> Fax: 64 9 373 7484
>>
>>
http://www.fmhs.auckland.ac.nz/sms/biru/>>
>> -----Original Message-----
>> From: ImageJ Interest Group [mailto:
[hidden email]] On Behalf Of
>> Jean-Yves Tinevez
>> Sent: Monday, 16 March 2015 9:29 p.m.
>> To:
[hidden email]
>> Subject: Re: FW: Directionality plugin - getting Directionality
>> analysis output values
>>
>> Hi Jaqui,The Python script you point to should do the work. But you
>> don't have to run it after running the plugin. The python script
>> itself runs the plugin. It would be the base on which you could build
>> something that would allow you to process the 2000 images in batch.
>> The 2nd plugin on the wiki page will show you how to get the analysis
>> results.You mention that you get errors. Would you care to copy/paste
>> them here, with a description on how they occur? But first, try to
>> run it as mention above.Bestjy
>>
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html