Double click selects detections even if hidden?

Hello everyone,

Is it intended that double clicking on the image selects detections underneath the cursor even if detections are hidden?

I have programmatically added rectangular DetectionObjects to an Image. If an annotation is covered by a detection it makes it impossible to select via double click. Selecting the annotation via the Annotation tab works and allows modifying it.

I was expecting that I can simply double-click to select annotations which are covered as long as detections are hidden, and was wondering if I am just missing a setting or am using the tool incorrectly.


1 Like

It is intended that clicking works independently of whether objects are shown/hidden – however triple/quadruple clicking should make it possible to select overlapping objects.

1 Like

Thanks :blush: That solves it.

Don’t know how I missed that…

1 Like

Or maybe one more followup:

What determines the selection order when there’s overlap?
Is it the insertion order into the Hierarchy?

The main code is triggered here, which you can see calls a comparator to ensure sorting.

Basically (mostly from memory…) it should return deeper objects in the hierarchy first, or (usually equivalently) objects with smaller ROIs. Probably best not rely on any particular ordering, because

  • it is an implementation detail that might change (although there are no plans to change it)
  • overlapping/duplicated objects can confuse things further

If the ordering is very important to you in any code you write, it would be better to short any object lists yourself.

1 Like

That was extremely helpful. In my toy example annotations were comparatively big, which had an impact on UX because detections were always selected first. With smaller annotations this is basically a non-issue.

Thanks again!

1 Like

It can be mildly satisfying to draw several nested annotations and keep clicking within them. You should find that they are selected in a ‘loop’.

1 Like