http://imagej.273.s1.nabble.com/FW-Directionality-plugin-getting-Directionality-analysis-output-values-tp5011976p5012022.html
you were right, the import statement was missing.
> 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
>>