Re: IMAGEJ Digest - 10 Aug 2011 to 11 Aug 2011 (#2011-217)

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

Re: IMAGEJ Digest - 10 Aug 2011 to 11 Aug 2011 (#2011-217)

Thorsten Sy
>
>> Hi,
>>
>> I just recognized the new macro commands Overlay.* which allow a much fast overlay drawing than the "old" makeLine-Add Selection scheme. But what I missed, is the possibility to fill a region like makePolygon-Add Selection, fill…, which is really slow. Is there a similar possibility with the new commands?
>
> Use batch mode. The following test macro runs 300 times faster in batch mode.
>
>   start = getTime;
>   setBatchMode(true);
>   newImage("Untitled", "RGB Black", 512, 512, 1);
>   n = 500;
>   for (i=0; i<n; i++) {
>      showProgress(i, n);
>      makePolygon(52,73,103,41,158,62,142,111,68,128);
>      run("Add Selection...", "fill=#77ff0000");
>   }
>   setBatchMode(false);
>   print((getTime-start)/1000+" seconds");
>
> -wayne

Okay, as I understand this works faster beacuse/if the image isn't shown during processing.
The problem is, my images are opened manually and then the appropriate macros are started. So in the beginning the image is displayed and when I start the macro under this condition the batch mode has no effect anymore.
Perhaps I will find a way to open the image from the macro, which is not an technical issue but a handling problem.

Thank you,

Thorsten
Reply | Threaded
Open this post in threaded view
|

Re: IMAGEJ Digest - 10 Aug 2011 to 11 Aug 2011 (#2011-217)

Gabriel Landini
On Friday 12 Aug 2011, Thorsten Sy wrote:
> Okay, as I understand this works faster beacuse/if the image isn't shown
> during processing. The problem is, my images are opened manually and then
> the appropriate macros are started. So in the beginning the image is
> displayed and when I start the macro under this condition the batch mode
> has no effect anymore. Perhaps I will find a way to open the image from
> the macro, which is not an technical issue but a handling problem.

Or just get the open image name/ID, start the batch mode and duplicate the
image. That way the duplicate is not shown and you work on that one. You can
choose to show the result at the end of the process. See the Macro Functions
page.

G.