Overlaying multiple colors in ImageJ

I am writing a small plugin for imageJ, and I draw several areas as an overlay on the image.

I am using this code:

ImagePlus imp = getImage();
Overlay ov = new Overlay();
for (int r=0; r<regions.length; r++)
    {
    ov.add(regions[r]);
    }
imp.setOverlay(ov);

Where regionsis the array from Roi.

This works as intended and draws areas in the ImageJ cyan standard used for overlays. I would like to highlight one specific region in a different color, but I cannot find a way to do this. I found that you can change the color of the entire overlay, but I need two colors on the same overlay.

Any ideas?

Thanks in advance

Nico

+3
source share
1 answer

, Roi setFillColor setStrokeColor.

+3

Source: https://habr.com/ru/post/1748098/


All Articles