leaf-measure
Use this skill to run the shared leaf-measure engine, not to re-implement the method in the prompt.
This skill supports two host patterns:
- repo-local: the current workspace is the
leaf-measurerepository - standalone installed skill: the skill lives under
$CODEX_HOME/skills/leaf-measureand usesscripts/setup_and_analyze.pyto clone or update the shared repo cache under$CODEX_HOME/vendor/leaf-measure, then sync the installed skill to the latest canonical bundle
Workflow
- Confirm the target image folder.
- If the user did not specify a mode, explain
Full imagevsThumbnailsusingreferences/mode-selection.mdand ask them to choose. - Before analysis, make sure the runtime exists:
- repo-local: prefer
.\scripts\bootstrap.ps1on Windows because it installs the current Python dependencies, downloads Fiji if missing, and fetches the public Figshare assets if missing - standalone installed skill: run
python scripts/setup_and_analyze.py analyze ...; that helper clones or updates the shared repo cache, refreshes the installed skill from the latest canonicalskills/leaf-measure/, runsdoctor, and bootstraps the runtime on first use when needed - if only the upstream package is missing in a repo-local workspace, run
python -m engine.cli fetch-assets - if you must pass Fiji explicitly,
--fijimay be either a Fiji directory or a launcher path such asImageJ-win64.exe
- repo-local: prefer
- Run the shared CLI from the repository root:
python -m engine.cli analyze --input "<folder>" --output "<run-dir>" --mode full
or
python -m engine.cli analyze --input "<folder>" --output "<run-dir>" --mode thumbnails
For a standalone installed skill, use the bundled helper instead of assuming the current directory is the repo:
python scripts/setup_and_analyze.py analyze --input "<folder>" --output "<run-dir>" --mode full
or
python scripts/setup_and_analyze.py analyze --input "<folder>" --output "<run-dir>" --mode thumbnails
If the user says the installed skill still behaves like an older version, refresh it explicitly:
python scripts/setup_and_analyze.py self-update
If you are inside the repository itself and want to refresh the global installation from the canonical source, run:
python -m engine.cli update-skill
- Read
manifest.json,results.csv,run_summary.md, and the output folders before answering. - Explain:
- what was measured
- which mode was used
- that
results.csvis the user-facing table andresults_fameles_particles_raw.csvpreserves the original Fiji particle-level table when present - for
Full image, whether the run had to correct a hole-dominated mask polarity before writing the user-facing table - for
Full image, whether a conservative crop-rescue pass was needed to recover missed large leaf objects by rerunning the originalFull imagemacro on candidate crop regions - that outputs are in pixels by default
- whether DPI metadata was found
- whether automatic repair was triggered for a mask artifact
- whether leaf-measure internally staged non-ASCII filenames and then restored the original names in the delivered outputs
- that binary and outline outputs should be visually reviewed
References
- Mode choice:
references/mode-selection.md - Trait definitions:
references/trait-definitions.md - Artifact handling:
references/artifact-handling.md
Boundaries
- Do not silently convert pixel outputs into physical units.
- Do not claim the method worked if
results.csvor output images are missing. - Treat the shared CLI as the source of truth.
- If the standalone helper cannot make the runtime ready, surface the bootstrap or doctor failure clearly instead of improvising.