writing-skills
writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment
stardistSelf-contained operating guidance for StarDist 0.9.2: CPU-verified 2D/3D instance segmentation, geometry/evaluation, and optional deployment integrations.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this skill when a task needs the Python StarDist package for star-convex 2D polygons, 3D polyhedra, instance segmentation, NMS, matching, model training/inference, or related file integrations. This is an operating router, not a copy of the source repository.
For a public CPU installation, use an isolated Python environment and install the package with its test helper when needed:
python -m pip install "stardist[test]"
python skills/disco/stardist/scripts/check_stardist_env.py
The compiled CPU extensions are built as part of installation. The checker must report imports for stardist, stardist.models, stardist.geometry, stardist.matching, stardist.data, stardist.lib.stardist2d, and stardist.lib.stardist3d. It also prints optional dependency/device diagnostics without making CUDA/OpenCL a baseline requirement. For the exact inspected source snapshot and freshness evidence, read repo-provenance.md.
Config2D, StarDist2D, training, normalization, tiling, multiclass: 2d-workflowsConfig3D, StarDist3D, rays, anisotropy, block inference: 3d-workflowsRead api-overview.md for shared conventions and troubleshooting.md before changing the environment.
The required baseline is TensorFlow 2.x on CPU plus the compiled StarDist 2D/3D CPU extensions. A CPU import is not evidence of CUDA or OpenCL support. TensorFlow GPU, OpenCL/gputools data generation, BioImage.IO, pretrained downloads, and QuPath are explicitly optional; if they are unavailable, preserve a clear skip/limitation and continue with the CPU path where the contract has a valid substitute.
A prediction is normally (labels, details): labels are integer, spatial-only instance IDs with 0 as background; details contain sparse points/probabilities/distances and optional class information. Keep axes, normalization, grid, thresholds, ray configuration, anisotropy/scale, model source, and software version with persisted results. Route metric calculations through evaluation-geometry rather than treating labels as probability maps.