views:

138

answers:

1

Hi everyone,

I'm writing a little plugin for imageJ and I am drawing several regions as an overlay on the image.

I'm 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 regions is an array of Roi.

This works as intended and draws the regions in the (hurting to my eyes) standard ImageJ cyan used for overlays. I would like to draw one particular region in another colour, but I cannot seem to find a way to do it. I found that you can change the colour of the whole overlay, but I need two colours in the same overlay.

Any ideas?

Thanks in advance

nico

+3  A: 

I think you should be able to set the drawing colours for each Roi object individually via its setFillColor and setStrokeColor methods.

walkytalky
Thank you! That's just what I needed!!
nico