Help needed to write a macro to merge several polygon regions into one

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

Help needed to write a macro to merge several polygon regions into one

Dilip Baluguri
Hi,
   I need a macro to merge several polygon regions into one region.
Initially I have one selected region and after every iteration of for loop
I get a new region. By the end of this for loop I should have only one
polygon which combines all those polygons
Reply | Threaded
Open this post in threaded view
|

Re: Help needed to write a macro to merge several polygon regions into one

jmutterer
Dilip,
As you're creating new ROIs, add them to the ROI Manager.
At the end of the loop, use the Combine command. Also check the other
roiManager() functions at:
http://rsb.info.nih.gov/ij/developer/macro/functions.html
jerome

This example creates 2 ROIs and combines them.

run("Blobs (25K)");
makeRectangle(7, 21, 56, 49);
roiManager("Add");
makeRectangle(113, 47, 56, 49);
roiManager("Add");
roiManager("Combine");


On Tue, Oct 6, 2009 at 10:17 AM, Dilip Baluguri <
[hidden email]> wrote:

> Hi,
>   I need a macro to merge several polygon regions into one region.
> Initially I have one selected region and after every iteration of for loop
> I get a new region. By the end of this for loop I should have only one
> polygon which combines all those polygons
>