ProgressBar.setBatchMode()

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ProgressBar.setBatchMode()

Pål Baggethun
In order to disable the progressbar during binary close in a Plugin (not PluginFilter) I tried the following:

ImageJ ij = IJ.getInstance();
if (ij!=null) ij.getProgressBar().setBatchMode(true);
IJ.run(maskimp, "Options...", "iterations=3 count=1 black pad edm=Overwrite do=Close");

..but to no effect. What am I doing wrong? Are there other approaches? Batch mode macro is not an option.

Cheers,
P. Baggethun
NOTICE: Please immediately e-mail back to sender if you are not the intended recipient. Thereafter delete the e-mail along with any attachments without making copies. The sender reserves all rights of privilege, confidentiality and copyright.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: ProgressBar.setBatchMode()

Michael Schmid
Hi Pål,

the ProgressBar has a method
  show(double progress, boolean showInBatchMode)

If a plugin (called by your plugin) calls it with
  ij.getProgressBar().show(theProgress, true);
this will activate the ProgressBar irrespective of its setBatchMode(true).

The ProgressBar will also become active if your plugin calls a BathMode macro that uses its own progress bar.

Maybe you can find out which operation is responsible for activating the progress bar in your case?

Michael
________________________________________________________________
On Oct 24, 2014, at 13:43, Pål Baggethun wrote:

> In order to disable the progressbar during binary close in a Plugin (not PluginFilter) I tried the following:
>
> ImageJ ij = IJ.getInstance();
> if (ij!=null) ij.getProgressBar().setBatchMode(true);
> IJ.run(maskimp, "Options...", "iterations=3 count=1 black pad edm=Overwrite do=Close");
>
> ..but to no effect. What am I doing wrong? Are there other approaches? Batch mode macro is not an option.
>
> Cheers,
> P. Baggethun

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: ProgressBar.setBatchMode()

Rasband, Wayne (NIH/NIMH) [E]
In reply to this post by Pål Baggethun
On Oct 24, 2014, at 7:43 AM, Pål Baggethun <[hidden email]> wrote:
>
> In order to disable the progressbar during binary close in a Plugin (not PluginFilter) I tried the following:
>
> ImageJ ij = IJ.getInstance();
> if (ij!=null) ij.getProgressBar().setBatchMode(true);
> IJ.run(maskimp, "Options...", "iterations=3 count=1 black pad edm=Overwrite do=Close");
>
> ..but to no effect. What am I doing wrong? Are there other approaches? Batch mode macro is not an option.

In the the latest ImageJ daily build (1.49j10), the Process>Binary commands no longer use progress bars. They are relics from the early days of ImageJ in the late nineties, when computers where much slower.

-wayne

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