Login  Register

Re: Check if command is finished in a macro

Posted by Rasband, Wayne (NIH/NIMH) [E] on Jun 05, 2015; 4:33pm
URL: http://imagej.273.s1.nabble.com/Check-if-command-is-finished-in-a-macro-tp5013045p5013054.html

> On Jun 5, 2015, at 7:40 AM, Djoere Gaublomme <[hidden email]> wrote:
>
> Hi all,
>
> I was wondering if it is possible to check whether a function has finished in a macro, in order to avoid the next command being initiated too early.
>
> I have read the following: http://imagej.1557.x6.nabble.com/Is-it-normal-to-use-a-wait-instruction-after-a-command-td5011551.html , and applied the proposed solution therein for functions that produce a new image window as output.
> For example:
>
> while (!isOpen("Resulting-Image")) {
> wait(100);
> }
>
> However, I would also like to be able to check if filters that don't produce a new image window, such as the "Gaussian Blur 3D", were executed completely.

Macro functions, including "Gaussian Blur 3D”, do not return before they are finished except for a few external plugins, such as ""LoG 3D”. Please provide example macro code that does not work as expected without wait() calls.

-wayne

> Is there a trick that allows you to do this?
> Or is it necessary to change the plugin to allow for this?  Would that be a hard thing to do (I am only familiar with macros)?
>
> Thanks in advance for any ideas!
>
> Djoere

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html