Progress bar during resizing

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

Progress bar during resizing

Nicolas Brouilly
Dear all,

How can I get the progress bar to appear during a resizing manipulation ?

Let say that you have a 1 000 x 1 000 px image and want to resize it to
10 000 x 10 000 px. It takes more than a second (20 seconds on my
system), though the progress bar does not appear.

Is there a limited list of functions for which the progress bar is
supposed to appear ?

Thanks !

Nico

--

Nicolas BROUILLY, PhD

Zerial lab,

Max Planck Institute of Molecular

Cell Biology and Genetics

Pfotenhauerstr. 108

01307 Dresden

phone: +49 351 210-2489

e-mail: [hidden email]


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

Re: Progress bar during resizing

Michael Schmid
Hi Nico,

ImageJ shows the progress bar only for some operations, mainly for those that are slow with more "typical" image sizes (0.1-10 Mpixels). Your output image has 100 Mpxl.

Resizing is done at a rather low level (ImageProcessor) and it is just a small part of the operation in several other commands (e.g. "Make Montage"), so adding a progress bar for resizing would give a meaningless (or flickering) progress bar for other operations that use resizing. So ImageJ just shows a status message when resizing, counting the images that have to be resized (for the case that a stack is resized). Unfortunately, that status message goes away as soon as the mouse is moved over an image, it yields for the coordinates & value readout.

Michael
________________________________________________________________
On Apr 15, 2015, at 16:17, Nicolas Brouilly wrote:

> Dear all,
>
> How can I get the progress bar to appear during a resizing manipulation ?
>
> Let say that you have a 1 000 x 1 000 px image and want to resize it to 10 000 x 10 000 px. It takes more than a second (20 seconds on my system), though the progress bar does not appear.
>
> Is there a limited list of functions for which the progress bar is supposed to appear ?
>
> Thanks !
>
> Nico

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

How to rotate an ROI that is drawn by "Polygon selections" tool?

WangPing
Dear all,
 
Could anyone please instruct me how to rotate an ROI that was drawn by the "Polygon Selections" tool?  Also after rotation, the ROI should be still editable, say, can change its size by dragging its vertices.  Thanks any help.
 
Kind regards,
Ping
     

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

Re: Progress bar during resizing

Nicolas Brouilly
In reply to this post by Michael Schmid
Hi Michael !

Thank you for your clarifications !

Is there any chance that, in a macro, one can display a "progress bar"
in the log window using parallel threads ? Or any other way to get an
idea about the progress of a resizing step in a macro ?

Thanks !

Nico

On 15/04/2015 17:13, Michael Schmid wrote:

> Hi Nico,
>
> ImageJ shows the progress bar only for some operations, mainly for those that are slow with more "typical" image sizes (0.1-10 Mpixels). Your output image has 100 Mpxl.
>
> Resizing is done at a rather low level (ImageProcessor) and it is just a small part of the operation in several other commands (e.g. "Make Montage"), so adding a progress bar for resizing would give a meaningless (or flickering) progress bar for other operations that use resizing. So ImageJ just shows a status message when resizing, counting the images that have to be resized (for the case that a stack is resized). Unfortunately, that status message goes away as soon as the mouse is moved over an image, it yields for the coordinates & value readout.
>
> Michael
> ________________________________________________________________
> On Apr 15, 2015, at 16:17, Nicolas Brouilly wrote:
>
>> Dear all,
>>
>> How can I get the progress bar to appear during a resizing manipulation ?
>>
>> Let say that you have a 1 000 x 1 000 px image and want to resize it to 10 000 x 10 000 px. It takes more than a second (20 seconds on my system), though the progress bar does not appear.
>>
>> Is there a limited list of functions for which the progress bar is supposed to appear ?
>>
>> Thanks !
>>
>> Nico
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--

Nicolas BROUILLY, PhD

Zerial lab,

Max Planck Institute of Molecular

Cell Biology and Genetics

Pfotenhauerstr. 108

01307 Dresden

phone: +49 351 210-2489

e-mail: [hidden email]


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

Re: How to rotate an ROI that is drawn by "Polygon selections" tool?

Michael Schmid
In reply to this post by WangPing
Hi Ping,

if you rotate a polygon with Edit>Selection>Rotate, it remains a polygon and can be still edited.
  http://rsb.info.nih.gov/ij/docs/guide/146-27.html#toc-Subsubsection-27.12.13

Michael
________________________________________________________________
On Apr 15, 2015, at 18:03, WangPing wrote:

> Dear all,
>
> Could anyone please instruct me how to rotate an ROI that was drawn by the "Polygon Selections" tool?  Also after rotation, the ROI should be still editable, say, can change its size by dragging its vertices.  Thanks any help.
>
> Kind regards,
> Ping

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

Re: How to rotate an ROI that is drawn by "Polygon selections" tool?

WangPing
Hi Michael, thank you so much for the quick response, yes it works for the Polygon ROI!!
Additional question is about an ROI drawn by Oval tool: after rotation I found I can move it but its size is no longer editable, any idea to make the size of Oval ROI still changeable after rotation?
 
Kind regards,
Ping
 

> Date: Wed, 15 Apr 2015 18:14:38 +0200
> From: [hidden email]
> Subject: Re: How to rotate an ROI that is drawn by "Polygon selections" tool?
> To: [hidden email]
>
> Hi Ping,
>
> if you rotate a polygon with Edit>Selection>Rotate, it remains a polygon and can be still edited.
>   http://rsb.info.nih.gov/ij/docs/guide/146-27.html#toc-Subsubsection-27.12.13
>
> Michael
> ________________________________________________________________
> On Apr 15, 2015, at 18:03, WangPing wrote:
>
> > Dear all,
> >
> > Could anyone please instruct me how to rotate an ROI that was drawn by the "Polygon Selections" tool?  Also after rotation, the ROI should be still editable, say, can change its size by dragging its vertices.  Thanks any help.
> >
> > Kind regards,
> > Ping
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
     

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

Re: How to rotate an ROI that is drawn by "Polygon selections" tool?

WangPing
Also how could you draw an Oval ROI with its axis in any orientation?  Ping
 

> Date: Thu, 16 Apr 2015 00:24:06 +0800
> From: [hidden email]
> Subject: Re: How to rotate an ROI that is drawn by "Polygon selections" tool?
> To: [hidden email]
>
> Hi Michael, thank you so much for the quick response, yes it works for the Polygon ROI!!
> Additional question is about an ROI drawn by Oval tool: after rotation I found I can move it but its size is no longer editable, any idea to make the size of Oval ROI still changeable after rotation?
>  
> Kind regards,
> Ping
>  
> > Date: Wed, 15 Apr 2015 18:14:38 +0200
> > From: [hidden email]
> > Subject: Re: How to rotate an ROI that is drawn by "Polygon selections" tool?
> > To: [hidden email]
> >
> > Hi Ping,
> >
> > if you rotate a polygon with Edit>Selection>Rotate, it remains a polygon and can be still edited.
> >   http://rsb.info.nih.gov/ij/docs/guide/146-27.html#toc-Subsubsection-27.12.13
> >
> > Michael
> > ________________________________________________________________
> > On Apr 15, 2015, at 18:03, WangPing wrote:
> >
> > > Dear all,
> > >
> > > Could anyone please instruct me how to rotate an ROI that was drawn by the "Polygon Selections" tool?  Also after rotation, the ROI should be still editable, say, can change its size by dragging its vertices.  Thanks any help.
> > >
> > > Kind regards,
> > > Ping
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>      
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
     

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

Re: How to rotate an ROI that is drawn by "Polygon selections" tool?

Nicolas Brouilly
In reply to this post by WangPing
Hi Ping,

After rotation of the ellipse, you can do Edit/Selection/Fit Ellipse to
get access back to the knobs for size adjustment.

Nico



On 15/04/2015 18:24, WangPing wrote:

> Hi Michael, thank you so much for the quick response, yes it works for the Polygon ROI!!
> Additional question is about an ROI drawn by Oval tool: after rotation I found I can move it but its size is no longer editable, any idea to make the size of Oval ROI still changeable after rotation?
>  
> Kind regards,
> Ping
>  
>> Date: Wed, 15 Apr 2015 18:14:38 +0200
>> From: [hidden email]
>> Subject: Re: How to rotate an ROI that is drawn by "Polygon selections" tool?
>> To: [hidden email]
>>
>> Hi Ping,
>>
>> if you rotate a polygon with Edit>Selection>Rotate, it remains a polygon and can be still edited.
>>    http://rsb.info.nih.gov/ij/docs/guide/146-27.html#toc-Subsubsection-27.12.13
>>
>> Michael
>> ________________________________________________________________
>> On Apr 15, 2015, at 18:03, WangPing wrote:
>>
>>> Dear all,
>>>
>>> Could anyone please instruct me how to rotate an ROI that was drawn by the "Polygon Selections" tool?  Also after rotation, the ROI should be still editable, say, can change its size by dragging its vertices.  Thanks any help.
>>>
>>> Kind regards,
>>> Ping
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>    
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--

Nicolas BROUILLY, PhD

Zerial lab,

Max Planck Institute of Molecular

Cell Biology and Genetics

Pfotenhauerstr. 108

01307 Dresden

phone: +49 351 210-2489

e-mail: [hidden email]


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

Re: How to rotate an ROI that is drawn by "Polygon selections" tool?

Michael Schmid
In reply to this post by WangPing
Hi Ping,

if you use Elliptical Selections instead of Oval Selections, they can be drawn in any orientation and rotated with the mouse. Right-click the 'Oval Selection' icon to get them.
  http://rsb.info.nih.gov/ij/docs/guide/146-19.html#sub:Elliptical-Selection-Tool

P.S. sometimes it pays off to read the manual (though this is an old-fashioned approach ;-)

Michael
________________________________________________________________
On Apr 15, 2015, at 18:24, WangPing wrote:

> Hi Michael, thank you so much for the quick response, yes it works for the Polygon ROI!!
> Additional question is about an ROI drawn by Oval tool: after rotation I found I can move it but its size is no longer editable, any idea to make the size of Oval ROI still changeable after rotation?
>
> Kind regards,
> Ping
>
>> Date: Wed, 15 Apr 2015 18:14:38 +0200
>> From: [hidden email]
>> Subject: Re: How to rotate an ROI that is drawn by "Polygon selections" tool?
>> To: [hidden email]
>>
>> Hi Ping,
>>
>> if you rotate a polygon with Edit>Selection>Rotate, it remains a polygon and can be still edited.
>>  http://rsb.info.nih.gov/ij/docs/guide/146-27.html#toc-Subsubsection-27.12.13
>>
>> Michael
>> ________________________________________________________________
>> On Apr 15, 2015, at 18:03, WangPing wrote:
>>
>>> Dear all,
>>>
>>> Could anyone please instruct me how to rotate an ROI that was drawn by the "Polygon Selections" tool?  Also after rotation, the ROI should be still editable, say, can change its size by dragging its vertices.  Thanks any help.
>>>
>>> Kind regards,
>>> Ping
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>    
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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

Re: How to rotate an ROI that is drawn by "Polygon selections" tool?

WangPing
In reply to this post by Nicolas Brouilly
great thanks Nico!
 

> Date: Wed, 15 Apr 2015 18:30:08 +0200
> From: [hidden email]
> Subject: Re: How to rotate an ROI that is drawn by "Polygon selections" tool?
> To: [hidden email]
>
> Hi Ping,
>
> After rotation of the ellipse, you can do Edit/Selection/Fit Ellipse to
> get access back to the knobs for size adjustment.
>
> Nico
>
>
>
> On 15/04/2015 18:24, WangPing wrote:
> > Hi Michael, thank you so much for the quick response, yes it works for the Polygon ROI!!
> > Additional question is about an ROI drawn by Oval tool: after rotation I found I can move it but its size is no longer editable, any idea to make the size of Oval ROI still changeable after rotation?
> >  
> > Kind regards,
> > Ping
> >  
> >> Date: Wed, 15 Apr 2015 18:14:38 +0200
> >> From: [hidden email]
> >> Subject: Re: How to rotate an ROI that is drawn by "Polygon selections" tool?
> >> To: [hidden email]
> >>
> >> Hi Ping,
> >>
> >> if you rotate a polygon with Edit>Selection>Rotate, it remains a polygon and can be still edited.
> >>    http://rsb.info.nih.gov/ij/docs/guide/146-27.html#toc-Subsubsection-27.12.13
> >>
> >> Michael
> >> ________________________________________________________________
> >> On Apr 15, 2015, at 18:03, WangPing wrote:
> >>
> >>> Dear all,
> >>>
> >>> Could anyone please instruct me how to rotate an ROI that was drawn by the "Polygon Selections" tool?  Also after rotation, the ROI should be still editable, say, can change its size by dragging its vertices.  Thanks any help.
> >>>
> >>> Kind regards,
> >>> Ping
> >> --
> >> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> >    
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
>
> Nicolas BROUILLY, PhD
>
> Zerial lab,
>
> Max Planck Institute of Molecular
>
> Cell Biology and Genetics
>
> Pfotenhauerstr. 108
>
> 01307 Dresden
>
> phone: +49 351 210-2489
>
> e-mail: [hidden email]
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
     

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

Re: Progress bar during resizing

Michael Schmid
In reply to this post by Nicolas Brouilly
Hi Nico,

sorry, you can't get the progress of a resize operation from outside the ImageProcessor method that does the job.
One could have a parallel thread with that shows just some progress bar with arbitrary speed, and terminates if the operation is done, but a solution with macros only will be a rather tricky hack.

It is easier with a plugin than with a macro for the progress bar, because then one could stop it via a 'call' command. I have written a quick and dirty one, below. After 'Compile&Run', you have to do "Refresh Menus" to make it appear somewhere in the Plugins menu, then you can start it in a separate thread with doCommand.

Michael
________________________________________________________________

import ij.*;
import ij.plugin.PlugIn;

/** Displays a progress bar with fixed speed.
 *  It can be started in a separate thread from a macro with
 *      doCommand("Asynchronous Progress Bar");
 *  To make it disappear, use the following macro command:
 *      call("Asynchronous_Progress_Bar.stop");
 *  To set the maximum time to 50 sec,
 *      call("Asynchronous_Progress_Bar.setMaxTime", 50);
 *
 * 2014-04-15 Michael Schmid
 */
public class Asynchronous_Progress_Bar implements PlugIn {
    static boolean stop;
    static double maxTime = 100; //default 100 sec

    public void run(String arg)  {
        stop = false;
        for (int i=0; i<99; i++) {
            if (stop) {
                IJ.showProgress(1.0);
                break;
            }
            IJ.showProgress(i, 100);
            IJ.wait((int)(10*maxTime));
        }
    }

    public static void setMaxTime(String timeString) {
        try {
            maxTime = Double.parseDouble(timeString);
        } catch (Exception e) {}
    }

    public static void stop() {
        stop = true;
        IJ.showProgress(1.0);
    }
}________________________________________________________________

On Apr 15, 2015, at 18:10, Nicolas Brouilly wrote:

> Hi Michael !
>
> Thank you for your clarifications !
>
> Is there any chance that, in a macro, one can display a "progress bar" in the log window using parallel threads ? Or any other way to get an idea about the progress of a resizing step in a macro ?
>
> Thanks !
>
> Nico
>
> On 15/04/2015 17:13, Michael Schmid wrote:
>> Hi Nico,
>>
>> ImageJ shows the progress bar only for some operations, mainly for those that are slow with more "typical" image sizes (0.1-10 Mpixels). Your output image has 100 Mpxl.
>>
>> Resizing is done at a rather low level (ImageProcessor) and it is just a small part of the operation in several other commands (e.g. "Make Montage"), so adding a progress bar for resizing would give a meaningless (or flickering) progress bar for other operations that use resizing. So ImageJ just shows a status message when resizing, counting the images that have to be resized (for the case that a stack is resized). Unfortunately, that status message goes away as soon as the mouse is moved over an image, it yields for the coordinates & value readout.
>>
>> Michael
>> ________________________________________________________________
>> On Apr 15, 2015, at 16:17, Nicolas Brouilly wrote:
>>
>>> Dear all,
>>>
>>> How can I get the progress bar to appear during a resizing manipulation ?
>>>
>>> Let say that you have a 1 000 x 1 000 px image and want to resize it to 10 000 x 10 000 px. It takes more than a second (20 seconds on my system), though the progress bar does not appear.
>>>
>>> Is there a limited list of functions for which the progress bar is supposed to appear ?
>>>
>>> Thanks !
>>>
>>> Nico
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
>
> Nicolas BROUILLY, PhD
>
> Zerial lab,
>
> Max Planck Institute of Molecular
>
> Cell Biology and Genetics
>
> Pfotenhauerstr. 108
>
> 01307 Dresden
>
> phone: +49 351 210-2489
>
> e-mail: [hidden email]
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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

Re: Progress bar during resizing

Edoukoua Konin
hello, i have needs for assistance,  I have a particle that is trapped and I want to extract the different positions, then remove the noises. KONIN EDOUKOUA JEAN MICHEL
DOCTORANT
Université Nangui AbrogouaInstitut National
Polytechnique de Yamoussoukro
+225 49036815/ +225 46250179+225 21276241


     Le Mercredi 15 avril 2015 17h24, Michael Schmid <[hidden email]> a écrit :
   

 Hi Nico,

sorry, you can't get the progress of a resize operation from outside the ImageProcessor method that does the job.
One could have a parallel thread with that shows just some progress bar with arbitrary speed, and terminates if the operation is done, but a solution with macros only will be a rather tricky hack.

It is easier with a plugin than with a macro for the progress bar, because then one could stop it via a 'call' command. I have written a quick and dirty one, below. After 'Compile&Run', you have to do "Refresh Menus" to make it appear somewhere in the Plugins menu, then you can start it in a separate thread with doCommand.

Michael
________________________________________________________________

import ij.*;
import ij.plugin.PlugIn;

/** Displays a progress bar with fixed speed.
 *  It can be started in a separate thread from a macro with
 *      doCommand("Asynchronous Progress Bar");
 *  To make it disappear, use the following macro command:
 *      call("Asynchronous_Progress_Bar.stop");
 *  To set the maximum time to 50 sec,
 *      call("Asynchronous_Progress_Bar.setMaxTime", 50);
 *
 * 2014-04-15 Michael Schmid
 */
public class Asynchronous_Progress_Bar implements PlugIn {
    static boolean stop;
    static double maxTime = 100; //default 100 sec

    public void run(String arg)  {
        stop = false;
        for (int i=0; i<99; i++) {
            if (stop) {
                IJ.showProgress(1.0);
                break;
            }
            IJ.showProgress(i, 100);
            IJ.wait((int)(10*maxTime));
        }
    }

    public static void setMaxTime(String timeString) {
        try {
            maxTime = Double.parseDouble(timeString);
        } catch (Exception e) {}
    }

    public static void stop() {
        stop = true;
        IJ.showProgress(1.0);
    }
}________________________________________________________________

On Apr 15, 2015, at 18:10, Nicolas Brouilly wrote:

> Hi Michael !
>
> Thank you for your clarifications !
>
> Is there any chance that, in a macro, one can display a "progress bar" in the log window using parallel threads ? Or any other way to get an idea about the progress of a resizing step in a macro ?
>
> Thanks !
>
> Nico
>
> On 15/04/2015 17:13, Michael Schmid wrote:
>> Hi Nico,
>>
>> ImageJ shows the progress bar only for some operations, mainly for those that are slow with more "typical" image sizes (0.1-10 Mpixels). Your output image has 100 Mpxl.
>>
>> Resizing is done at a rather low level (ImageProcessor) and it is just a small part of the operation in several other commands (e.g. "Make Montage"), so adding a progress bar for resizing would give a meaningless (or flickering) progress bar for other operations that use resizing. So ImageJ just shows a status message when resizing, counting the images that have to be resized (for the case that a stack is resized). Unfortunately, that status message goes away as soon as the mouse is moved over an image, it yields for the coordinates & value readout.
>>
>> Michael
>> ________________________________________________________________
>> On Apr 15, 2015, at 16:17, Nicolas Brouilly wrote:
>>
>>> Dear all,
>>>
>>> How can I get the progress bar to appear during a resizing manipulation ?
>>>
>>> Let say that you have a 1 000 x 1 000 px image and want to resize it to 10 000 x 10 000 px. It takes more than a second (20 seconds on my system), though the progress bar does not appear.
>>>
>>> Is there a limited list of functions for which the progress bar is supposed to appear ?
>>>
>>> Thanks !
>>>
>>> Nico
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
>
> Nicolas BROUILLY, PhD
>
> Zerial lab,
>
> Max Planck Institute of Molecular
>
> Cell Biology and Genetics
>
> Pfotenhauerstr. 108
>
> 01307 Dresden
>
> phone: +49 351 210-2489
>
> e-mail: [hidden email]
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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


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