Repository navigation
ShapesOut: outlines as GeoJSON, with a labels_to_shapes helper - #31
Merged
Merged
Conversation
… testing, docs, example tool, tests) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN
This was referenced Oct 7, 2026
Merged
Merged
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.
Wave 1, item 3 (decisions: GeoJSON, 50 000 outline host limit, helper in Tools; spec in #27). Adds the
ShapesOutoutput type: a tool returns a GeoJSON FeatureCollection, or a list of polygons (arrays of (y, x) vertices, or dicts withpolygonplus properties); the worker writes<name>.geojsonand the result is{type: "shapes", name, path, n, apply_to?}. Coordinates are[x, y]with pixel centres at integers, like points. Only Polygon and MultiPolygon are accepted; bad input (non-finite, fewer than 3 vertices, wrong shape, other geometry types) fails with a readable message.Replace()andApplyTowork on it.labconstrictor_tools.shapes.labels_to_shapes(labels, simplify=0.5, min_area=1)traces a 2D label image: one feature per label (Polygon, or MultiPolygon for several parts), holes kept, propertieslabelandarea. It needs scikit-image and scipy (the app's, not a Tools dependency). Also:testingvalidates shapes results ({"features": n}), the notebook form lists them, docs updated (PROTOCOL, MANIFEST, AUTHORING recipes, HOST_FEATURES rows "planned"), and the example app has an "Outline the blobs" tool (labels + outlines + message).Tests: 13 new (writing, refusals, helper: holes, parts, areas, centres at integers, empty, many labels). The helper tests skip without scikit-image. Full suite passes except the root-only
test_foreign_owned...(also fails on main). I also ran the example tool through the real worker: 17 blobs, valid GeoJSON.Hosts that do not know
shapeslist the file, so nothing breaks before the host PRs.Next: Napari (shapes layer), Fiji (polygon ROIs), QuPath (annotations).
🤖 Generated with Claude Code
https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN
Generated by Claude Code