Kitware / UPennContrast

UPenn ?
https://upenn-contrast.netlify.com/
Apache License 2.0
8 stars 6 forks source link

Subsample annotation display for very large numbers of annotations #765

Open arjunrajlab opened 3 months ago

arjunrajlab commented 3 months ago

I have noticed that performance tends to degrade in terms of responsiveness when there are a lot of annotations displayed on the image at once. In discussions with David, it seems like random subsampling is the preferred option. Thibault said that we could do this by downloading all the annotations and assigning each one a random number between 0 and 1. Then we basically threshold to decide what percentage to show. I think a reasonable starting point is that if you have over 40K annotations, only show 10K of them. As you increase the number of annotations, always max out at around 10K of them to display. If you have, say, 30K annotations to display, then just show the 30K. It's only when you go above 40K that it starts to subsample. Also, this should be an option that is enabled by default, but that you can turn off in the settings (with a warning if you have over 40K annotations that this might make things slower).

There is something to be figured out which is that the annotation list should show all the annotations, but sometimes the annotation on the list may not show up if it was randomly not selected. I think if you highlight or click on the annotation list, it should convert that annotation to "shown", perhaps by setting its random number to 1 or something like that.