Add interactive region annotation tutorial (skeleton)#5
Draft
timtreis wants to merge 1 commit into
Draft
Conversation
Adds examples/interactive_annotate.ipynb covering the new `sdata.pl.annotate()` API from scverse/spatialdata-plot#684. Uses the same `squidpy.datasets.visium_hne_sdata()` dataset as visium_mouse_brain.ipynb so the download cache is shared. Structure follows the existing examples/ pattern: - Intro + dataset citation + install hint for the [interactive] extra - Load → render the image so the reader sees what to annotate - Widget invocation shown in a markdown fenced block (the static docs build can't execute the anywidget JS runtime; live-kernel users copy the snippet) - GIF placeholder cell — replace interactive_annotate.gif with a real recording before merging - "What the widget produces": a code cell that builds the equivalent ShapesModel directly via shapely + ShapesModel.parse, so downstream cells reproduce in the docs build without the widget - Overlay with render_shapes; polygon-crop via sd.polygon_query - Watermark block matching the other tutorials Wires the new entry into examples/index.md alongside the Visium card. Outstanding before merge: - Replace the hippocampus polygon coordinates with values from an actual annotation pass against visium_hne_sdata - Record interactive_annotate.gif (~3-5 s of drawing/saving) - Add interactive_annotate.png thumbnail for the gallery grid card Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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.
Summary
Adds a new gallery entry at
examples/interactive_annotate.ipynbcovering thesdata.pl.annotate()API introduced in scverse/spatialdata-plot#684. Uses the samesquidpy.datasets.visium_hne_sdata()dataset asvisium_mouse_brain.ipynbso the cache is shared.Structure follows the existing
examples/pattern (intro → load → progressive feature demos → reproducibility):pip install 'spatialdata-plot[interactive]'hintrender_images(\"hne\")so the reader sees what they're outlininginteractive_annotate.gif) for the visual demo in the rendered docsShapesModeldirectly viashapely+ShapesModel.parse(transformations={cs: Identity()}), so every downstream cell is reproducible in the docs build without the widgetrender_shapes; polygon-crop viasd.polygon_querycolor_and_palette.ipynbexamples/index.mdupdated with the new gallery card and toctree entry.Outstanding before this can go from draft to ready
interactive_annotate.gif(~3-5 seconds of drawing + saving)interactive_annotate.pngthumbnail for the gallery grid cardTest plan
execute.yamlre-executes without hanging on the widget cell (it shouldn't — the widget invocation is markdown, not code)Depends on
sdata.pl.annotate()API itself)🤖 Generated with Claude Code