Multiple Selections in one ROI

I have been working on my first imageJ macro. The goal of the macro is to make multiple selections per slice, fill those selections, and then save those fills as apart of a new substack. My first sub-goal is to make multiple selections per slice and have them stored in a single ROI. The code that I have been able to make work so far makes one selection per ROI.
Here is the first Image. As you can see it is apart of the 0001 group of ROIs and has one of the edge areas filled in as red.

Here is the second image. This fill is apart of the 0001 group but has a different region selected/filled.

Here is the third image. This fill is apart of the 0001 group and has a small region selected in the bottom left.

So I know my macro code is set to add a new ROI every selection. That is the only way I have been able to see that my code can in fact select all of things I want to select, but it does it across multiple ROIs. I want to do all of these selection in one ROI.

I hope I have been clear. If any clarity is needed I can provide as much as I know!

Hello Eli -

In the ROI Manager you can select (highlight) multiple ROIs.
Then run More >> OR (Combine) from the buttons on the
right side of the ROI Manager. This will create a single “composite”
ROI that is made up of the ROIs you selected and apply it to
your open image. You can then run Add if you want to put it in
the ROI Manager. (If no ROIs are selected, this will combine all
of the ROIs in the ROI Manager.)

In an IJM macro, you can execute this with:

roiManager("Combine");

Thanks, mm

I have tried using the combine macro. Does it get rid of the individual ROIs that are combined?

Hello Eli -

It leaves the ROIs that were in the ROI Manager in the ROI
Manager, removes any ROIs from the open image, applies
the combined ROI to the open image, but does not add the
combined ROI to the ROI Manager. (You can, of course,
remove any desired ROIs from the ROI Manager, and / or
add the combined ROI to the ROI Manager in separate steps,
if you so choose.)

Thanks, mm