Posted by
Aryeh Weiss on
URL: http://imagej.273.s1.nabble.com/IJ-wait-does-not-work-for-me-tp5022333p5022336.html
Hi Michael
Thank you for your reply.
I am running Jython using the built in script editor.
I suspect a similar problem with the IJ.renameResults() method, where I
need to put in a delay after using that, and it varies between macos and
windows. I have not succeeded in creating a minimal script that
reproduces the problem with IJ.renameResults(), so I realize that it
will be hard to expect a fix unless more people experience it an we can
assemble a better understanding of what causes it.
I try to use non-global methods that explicitly return values (eg, an
ImagePlus or a table or whatever), but I do not always find way to do
that. Wayne wrote to me concerning the IJ.renameResults() issue,
suggesting that I use Table.* methods, but while Table.* shows up in the
macro, I do not see it in the API.
Best regards,
--aryeh
On 22/07/2019 17:02, Michael Schmid wrote:
> Hi Aryeh,
>
> in my view, the code for IJ.wait is so simple there can't be anything
> wrong with it:
>
https://github.com/imagej/imagej1/blob/master/ij/IJ.java#L758>
> The only problem that can imagine is python not waiting for the
> command to finish, possibly because there is no output that it waits
> for (it is a void method). If this is the case, it would indicate that
> there can be also other race conditions with controlling ImageJ from
> Python.
>
> Which Python interface are you using, Jython, pyimagej, or something else?
>
> The ImageJ page on Python
>
https://imagej.net/Python> has a remark on possible bugs and problems; maybe this is one of them.
>
>
> Michael
> ________________________________________________________________
> On 21.07.19 18:53, Aryeh Weiss wrote:
>> There is a place in a python script where I want to wait for a
>> second. So I tried IJ.wait(1000).
>>
>> This resulted in an error which appears in the screenshot (I could
>> not copy the text of the output or error windows)
>>
>> However, if I do
>> import time
>> time.sleep(1)
>>
>> it works fine.
>>
>> What have I done wrong in using the IJ.wait() function?
>>
>> tnx in advance
>> --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