3

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

skaffman
  • 398,947
  • 96
  • 818
  • 769
nico
  • 50,859
  • 17
  • 87
  • 112

1 Answers1

4

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

walkytalky
  • 9,453
  • 2
  • 36
  • 44