Fast Overlay Fill Region

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

Fast Overlay Fill Region

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?

Thank you,

Thorsten
Reply | Threaded
Open this post in threaded view
|

Re: Fast Overlay Fill Region

Rasband, Wayne (NIH/NIMH) [E]
On Aug 11, 2011, at 4:00 AM, Thorsten Sy wrote:

> 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