Deactivating ROI selection when double clicking

Hi,

I created Annotater, a plugin to manually annotate objects and regions, or correct segmentations. It uses ROIs for annotations. By default, when double clicking, that last created ROI is selected and overlaid. I would like to remove this functionality when the plugin is running, but I couldn’t find a way. Can somebody help me?

Thanks a lot,
Thierry

I think it needs some more specifications to exactly know how to solve your question.

  1. Are we talking about a Java plugin?
  2. Are you working with ROIs in the ROI Manager or with Overlays?
  3. You mention double clicking, do you mean double clicking the ROI/Overlay itself or something else?

Hi Jan,

Thanks for your help.

It’s a java plugin (ImageJ plugin) using ImageJ ROIs form the ROI manager but you’re right, the problem comes from the overlays that are moved. Double clicking anywhere selects the last overlay that was created to be moved. Is it clearer that way?

Thanks a lot,
Thierry

Hm weird, I cannot reproduce that the last overlay will be selected if double clicking anywhere but potentially the method: Overlay.selectable(false); helps to solve the issue

Sorry, I mixed up everything, it’s actually related to the ROIs. If you want to reproduce what I’d like to deactivate, you can add ROIs to an image with the ROI manager. When you double click on the ROI, you can then move it. I’d like to make to deactivate this functionality. How can I do?

Thanks a lot,
Thierry

I don’t think that this is possible. One would need to remove the MouseListener from the ImageCanvas and that has other disadvantages, because you cannot do specific mouse related things.
Another option would be to implement your own MouseListener and if a double click is recognized then it should again deselect any ROI which was activated by ImageJ just before.

I’m gonna try your solution via MouseListener, thanks so much for your help!!!

Thierry

Hi,

I added a new condition in the mouselistener to detect double clicks, in which case all ROIs are deselected, and that does the trick. Thanks so much!!!

Thierry

1 Like