Login  Register

Re: Macro: Switch between interactive and batch mode

Posted by karo03 on Jun 27, 2007; 12:58pm
URL: http://imagej.273.s1.nabble.com/Macro-Switch-between-interactive-and-batch-mode-tp3698989p3698991.html

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:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> 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
>> --
>>
>>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFGghdGxZKX7A/4oMERArnpAJ92o1Vq+37CkrQ9ZF0c0k9pUA3o4wCfYXKZ
> 3j/L07PcRibT4E8h05iOKqw=
> =/m1/
> -----END PGP SIGNATURE-----
>
> --
> passerelle antivirus du campus CNRS de Montpellier
> --