Login  Register

Re: Macro: Switch between interactive and batch mode

Posted by Volker Baecker on Jun 27, 2007; 2:11pm
URL: http://imagej.273.s1.nabble.com/Macro-Switch-between-interactive-and-batch-mode-tp3698989p3698992.html

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Please look at
http://www.mri.cnrs.fr/mriwiki/index.php?pagename=Wait%20For%20User.
Tell me if it works.
Volker

Karsten Rodenacker a écrit :

> Thank you Volker and Jerome
> The first workaround is good. Not just elegant but effective.
> The splitting of the macro recommended by Jerome is slightly less elegant.
> To use the visual script environment I will try later. It seems me a bit
> complicated to embed it into my actual ImageJ/plugin structure. Isn't it
> possible to have the "operation" plugin without the other things?
> Regards
> Karsten
> Am 27.06.2007 um 09:52 schrieb Volker Bäcker:
>
> Hi,
> As a workaround you can use something like this:
>
> for (i=0;i<10;i++) {
>     setBatchMode(false);
>     newImage("wait", "8-bit White", 100, 100, 1);
>     drawString("close to continue!", 10, 30);
>     while(isOpen("wait")) {
>         wait(10);
>     }
>     print(i);
>     setBatchMode(true);
> }
>
> I don't know if there is a better way in ImageJ to do what you want.
>
> Using my visual scripting plugin you can use:
>     setBatchMode(false);
>     call("operations.Operation.run", "wait for user","");
>     setBatchMode(true);
> in a macro, which opens a button with the text continue and stops the
> macro until the button is pressed.
>
> Volker
>
>
> Karsten Rodenacker a écrit :
>>>> Hi, I have a possibly minor problem:
>>>> Inside a macro I would like to switch over into interactive mode e.g. to
>>>> correct manually a mask automatically generated by "setThreshold()" and
>>>> "Convert to Mask" and than after finishing corrections to proceed with
>>>> the macro. As far as I see "setBatchMode(false)" does not allow to
>>>> interrupt macro processing.
>>>>
>>>> Thanks in advance
>>>> KArsten
>>>>
>>>> --passerelle antivirus du campus CNRS de Montpellier
>>>> --
>>>>
>>
- --passerelle antivirus du campus CNRS de Montpellier
- --

> --passerelle antivirus du campus CNRS de Montpellier
> --


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGgmIOxZKX7A/4oMERAo9IAKC+ASpOQiRDyD6tIsB6Y/0/pxUsUwCgwUKo
TJL9jakVPcKnZ1L2r7+koyo=
=Y1f3
-----END PGP SIGNATURE-----

--
passerelle antivirus du campus CNRS de Montpellier
--