Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Togglable Scale-bar Overlay #1836

Open
sbatchelder opened this issue Oct 2, 2024 · 0 comments
Open

Togglable Scale-bar Overlay #1836

sbatchelder opened this issue Oct 2, 2024 · 0 comments

Comments

@sbatchelder
Copy link
Contributor

Various imagery requires a meter for the viewer to be able to ascertain the size/scale of the imagery. This primarily relevant to imagery of a planar nature, like microscopy or directly top-down areal views. While useful on its own as part of the interface while reviewing imagery, my users purport that this feature would be most appreciated when it comes to exporting imagery off of tator, such that they can more easily share the imagery with others where such scalebars are expected practice.

Proposed here is a toggle on the UI which would enable/disable an on-screen-ruler scalebar overlay. The overlay would place a scalebar in one of the corners of the displayed image and would be appropriately rendered relative to the maximum resolution of the shown graphic, using an especially designated media-level attribute to use as a "pixel-resolution ratio" unit converter.

The pixel-resolution media property could be defined in two ways:

  • For media with fixed widths: (length,unit,dimension) where dimension is Height or Width, length is the real world measurment of the designated dimension, and unit is the unit of the length measurement.
  • For media with varying pixel dimensions: (ratio,units) where ratio is the number of pixels it takes to span 1 units. eg 100 pixels to 1 inch

Say we have imagery who's total x-width spans 1000mm and is 2000pixels wide. A scale bar that spans a quarter of the size of the image would show a length of 250mm. This would be the case even if the imagery were being displayed on-screen at a lower actual resolution. If one were to zoom in on part of the image with the annotation zoom tool, the scalebar would scale accordingly. A ~10x zoom on some part of the image would cause the scalebar to update and instead show 25mm, because the zoomed-in view is of a 200pixel wide area.

Crucially, this scale bar should also be togglable for localization graphics in the gallery view, each thumbnail getting its own relative-scale scalebar.
When it comes to exporting/downloading frames and localization graphics, the option to include the scalebar onto the image is just as important as being able to see it as an on-screen ruler.

Again, this feature is only relevant to planar-type imagery and gets optionally defined at the media-level

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant