Add captions to an Image

Tags: #<Tag:0x00007fb8837736a0> #<Tag:0x00007fb883773420> #<Tag:0x00007fb8837731a0>



I am developing a plugin in which I’d like to indicate the left and right of a patient on the Image

I would like something like that but if possible without using ROIs as I can’t have only 2 ROIs displayed all the time.

So if you have a solution without ROIs or a way to display 2 ROIs and still be able to manipulate other ROIs I’d be glad to hear from you.


Why don’t you use image overlays?


I tried using overlays earlier, but I might have used it the wrong way, but I remember it being problematic as all the ROIs I had in the RoiManager were displayed in the Overlay too. But if there’s a way to remove them from the overlay it would be a good solution to me.


Overlays and ROIs follow different paths. You can set the ROIs of your ImagePlus with the setRoi method and the overlay with the setOverlay method. That way you won’t mix them up.


With one little exception: if you use the Show All option of the ROI Manager, all the ROIs and their labels will be added as Overlays :wink:

@AdaTextIO you should be able to work with different objects by storing imp.getOverlay() in a temporary variable and imp.setOverlay() your desired overlay. This will be overwritten if you make changes to the ROI Manager, though…


Yes I believe my problem is that I’m using the show all option of the Roi Manager, but I might be able to do it with the Overlay now that I’ve identified the problem.