I updated today (first time in about a week) and immediately thereafter realized my "batch" macros are broken. I use .py macros to extract file names to run a function on all of the image files in a folder, and this requrires "import os." "import os" no longer finds an os module. Is this deleted and needs replaced? If so, where can I find it and where does it go? Or is this a change in IJ2 that no longer allows os-module python macros? If that's the case, any great sample batch macros in the IJ Macro language that you could refer me to?
Thanks very much :) Kaitlin Snider -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
On 8/14/14, 9:08 PM, Snider, Kaitlin wrote:
> I updated today (first time in about a week) and immediately thereafter realized my "batch" macros are broken. I use .py macros to extract file names to run a function on all of the image files in a folder, and this requrires "import os." "import os" no longer finds an os module. Is this deleted and needs replaced? If so, where can I find it and where does it go? Or is this a change in IJ2 that no longer allows os-module python macros? If that's the case, any great sample batch macros in the IJ Macro language that you could refer me to? > > Thanks very much :) > > Kaitlin Snider > > See bug 890: http://fiji.sc/bugzilla/show_bug.cgi?id=890 Here is my workaround: You can work around this by downloading the Jython 2.5.2 distribution, unzipping the downloaded distribution, and copying the Lib/ directory to the Fiji jars/ directory. Then your python will find os and will work. I found that I could not do this with Jython 2.5.3. If you use 2.5.3, it will find os, but it will report an error having to do with a feature that is not compatible with your Jython. I do not remember exactly what it was, because I no longer have the 2.5.3 Jython on my computer. --aryeh -- Aryeh Weiss Faculty of Engineering Bar Ilan University Ramat Gan 52900 Israel Ph: 972-3-5317638 FAX: 972-3-7384051 -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by Snider, Kaitlin
Hi Kaitlin,
>"import os" no longer finds an os module. We just diagnosed this problem but haven't settled on or fully tested a resolution yet. Basically, we upgraded from a custom 2.5.2 jython-standalone jar to 2.5.3 "just jython". The standalone jar included necessary dependencies, like the os module, but also conflicted with other dependencies of Fiji (jruby). You can read more and follow any discussion of fixes or workarounds here: http://fiji.sc/bugzilla/show_bug.cgi?id=890 Thank you for taking the time to report this issue. Let us know if you have any other questions. Thanks, Mark On Thu, Aug 14, 2014 at 1:08 PM, Snider, Kaitlin < [hidden email]> wrote: > I updated today (first time in about a week) and immediately thereafter > realized my "batch" macros are broken. I use .py macros to extract file > names to run a function on all of the image files in a folder, and this > requrires "import os." "import os" no longer finds an os module. Is this > deleted and needs replaced? If so, where can I find it and where does it > go? Or is this a change in IJ2 that no longer allows os-module python > macros? If that's the case, any great sample batch macros in the IJ Macro > language that you could refer me to? > > Thanks very much :) > > Kaitlin Snider > > -- > 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 |