Repository navigation
Add ellipse, polygon and point selections to the Analyze panel - #17
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Analyze panel now has a row of line-drawn tool icons in the style of ImageJ: Select, Rectangle, Ellipse, Polygon, Line and Point. The icons are drawn with the palette colors, so they follow the light and dark themes.
Ellipse is dragged like a rectangle. Polygon is drawn by clicking the corners and closed by a double-click, Enter or a click on the first corner; Backspace takes back a corner and Esc cancels. Point is a single click. All of them can be selected, moved and deleted, and polygon corners can be dragged. Selection statistics count the pixels whose centers are inside the shape, and the summary shows area and, for polygons, perimeter.
Markups in saved documents can be of the new types. The polygon corners are stored in an optional
pointsfield, so existing documents are unchanged. The API lists the new shapes but cannot create them yet.Tested: the pixel counts and means for ellipses, polygons and points on a synthetic image, the save and load of a document with every shape type, and the rejection of a polygon with fewer than three corners. Not tested: drawing and dragging on the canvas, which needs OpenGL and was not run, and the look of the icons in dark mode.