Restructure skills/ to be operator-focused#32
Conversation
Skills now follow a uniform template oriented at someone running inference: Command to run → How to configure a run → Output → Related scripts → Related skills. Algorithm step-by-step walkthroughs and internal function-args tables removed; workflow figures kept. Changes per skill: - `skills/infer_mask-generation.md` → renamed to `infer_mask-only.md` to parallel `infer_image-only`. Body rewritten around the two mask-acquisition paths (Path A diffusion-from-scratch vs Path B training-mask DB lookup) and the `anatomy_size` 10-d slot table. - `infer_image-only.md`: restructured around `## How to configure a run` (6 numbered steps: modality, AE knobs, dim/spacing from FOV, cfg_guidance_scale_modality, cfg_guidance_scale_tumor N/A, num_inference_steps). New end-to-end worked example: T1-axial rflow-mr-brain with concrete `dim` and `spacing` values. CFG section spells out "classifier-free guidance" at first use and links to the per-plane FOV table in docs/inference.md. - `infer_image-from-mask.md`: rewritten as a CLI-operator guide — command to run, input mask format and how to produce one (nv-segment-ct + add_body_envelope, or other segmenter + remap), config knob explanation including cfg_guidance_scale_tumor and the CT-only scope, output file layout. Cross-links to infer_mask-image-paired for the GPU-memory presets. - `infer_mask-image-paired.md`: keeps the LDMSampler dispatch flowchart; drops the algorithmic "Two paths in detail" prose, internal LDMSampler.__init__ state table, and Quality-check loop details. Gains a 6-step `## How to configure a run` mirroring `infer_image-only`, with a GPU-memory presets table (output_size + AE sliding-window knobs by GPU) drawn from the shipped `config_infer_<XXg>_<dim>.json` files. End-to-end Path B chest CT example. - `download-models.md`: section name standardization (`Code reference` → `Related scripts`) and cross-reference style brought in line with the other skills (`[name](name.md)`).
Greptile SummaryThis PR restructures the
Confidence Score: 5/5Documentation-only restructuring; no executable code changed. All factual claims verified against source files. Every claim introduced by this PR was cross-checked against the codebase: the GPU-memory presets table matches all nine config_infer files exactly, the corrected cfg_guidance_scale key name is confirmed by diff_model_infer.py line 297, the AE hardcoded values (roi_size=[80,80,80], overlap=0.4) are confirmed in diff_model_infer.py, and the find_masks / find_closest_masks attributions match their respective source files. No files require special attention. The GPU-memory presets table in skills/infer_mask-image-paired.md is the highest-stakes new content, and it verified cleanly against the shipped config files. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User: pick pipeline] --> B{Need to generate mask?}
B -- "No (have mask already)" --> C[infer_image-from-mask\nscripts/infer_image_from_mask.py\nCT-only]
B -- "No (unconditional image)" --> D[infer_image-only\nscripts/diff_model_infer.py\nCT or MR]
B -- "Yes (paired output)" --> E[infer_mask-image-paired\nscripts/inference.py\nCT-only]
E --> F{controllable_anatomy_size\nnon-empty?}
F -- "Path A: Yes" --> G[Mask DM DDPM\nscripts/sample_mask.py]
F -- "Path B: No" --> H[DB lookup\nfind_masks\nscripts/find_masks.py]
G --> I[MAISI 132-class mask]
H --> I
I --> J[Image LDM + ControlNet\nscripts/infer_image_from_mask.py]
C --> J
J --> K[Quality check CT\nLDMSampler.quality_check_ct]
K -- Pass --> L[sample_image.nii.gz + sample_label.nii.gz]
K -- Fail --> J
D --> M[unet_3d_seed_modality.nii.gz]
Reviews (5): Last reviewed commit: "Trim tumor-CFG bullet to satisfy markdow..." | Re-trigger Greptile |
Reviewer flagged that `find_masks` and `find_closest_masks` were attributed to scripts/sample_mask.py — that's wrong. - `find_masks` lives in `scripts/find_masks.py:55` (top-level function). - `find_closest_masks` is `LDMSampler.find_closest_masks` — a method in `scripts/sample.py:575`, not a standalone function. - `ldm_conditional_sample_one_mask` IS in `scripts/sample_mask.py` (kept). Fixes in both `infer_mask-only.md` and `infer_mask-image-paired.md`: split the single "sample_mask = Path A + Path B helpers" row into the correct three entries (sample_mask.py for Path A, find_masks.py for Path B exact match, sample.py for the LDMSampler.find_closest_masks closest-match fallback).
…ills The skill docs on this branch had been updated to reference the renamed keys (`cfg_guidance_scale_tumor`, `cfg_guidance_scale_modality`) from the issue-29-cfg-guidance-mr-docs branch, but the code and configs on this branch (and on main) still use the original `cfg_guidance_scale` key. Realign the docs to the actual key name. The modality-vs-tumor CFG distinction is preserved in prose — anchored to which script + config file reads the value (modality-CFG in `config_maisi_diff_model_*.json` via `scripts.diff_model_infer`; tumor-CFG in `config_infer.json` via `scripts.inference` / `scripts.infer_image_from_mask`), rather than to a key suffix. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The tumor-CFG bullet in infer_image-from-mask.md was 794 chars (limit is 700). Drop the trailing recap sentence — the preceding sentence already explains that the same key gates the modality branch in the image-only path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…VIDIA-Medtech#31) Brings the post-restructure skills layout and reorganized docs/inference.md onto this branch so the cfg key renames can be re-applied against the now-canonical doc structure. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
After merging upstream/main (PR NVIDIA-Medtech#32 restructured skills, PR NVIDIA-Medtech#31 reorg'd docs/inference.md), re-apply the cfg key renames to the new structure: - `infer_image-only.md` — image-only path uses `cfg_guidance_scale_modality` (modality CFG: required `> 0` for MR). - `infer_image-from-mask.md`, `infer_mask-image-paired.md` — mask-conditioned path uses `cfg_guidance_scale_tumor` (CT tumor CFG). - `docs/inference.md` — both keys differentiated in the knobs table and the MR-contrast tuning bullet. Each skill notes that the legacy un-suffixed `cfg_guidance_scale` key is still accepted for one release with a `DeprecationWarning`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The five operator-focused inference skills under skills/ (added in NVIDIA-Medtech#32) work as drop-in inputs for AI coding agents (Claude Code, Cursor, Codex, etc.) — feed one to the agent and it walks the user through the matching workflow end-to-end. This was previously buried in a one-line mention under the §2 Quick Start callout; surface it so it's actually discoverable. - News: dedicated entry naming all five skills and the AI-agent use case. - §2 Quick Start callout: rewritten to lead with the AI-agent angle, with a note that the same files work as standalone reference. - §2.2 through §2.6: each subsection gains a "**Skill:** ..." pointer to the matching skill file. §2.1 (Installation) and §2.7 (community external link) intentionally have no skill pointer. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The five operator-focused inference skills under skills/ (added in NVIDIA-Medtech#32) work as drop-in inputs for AI coding agents (Claude Code, Cursor, Codex, etc.) — feed one to the agent and it walks the user through the matching workflow end-to-end. This was previously buried in a one-line mention under the §2 Quick Start callout; surface it so it's actually discoverable. - News: dedicated entry naming all five skills and the AI-agent use case. - §2 Quick Start callout: rewritten to lead with the AI-agent angle, with a note that the same files work as standalone reference. - §2.2 through §2.6: each subsection gains a "**Skill:** ..." pointer to the matching skill file. §2.1 (Installation) and §2.7 (community external link) intentionally have no skill pointer. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The five operator-focused inference skills under skills/ (added in NVIDIA-Medtech#32) work as drop-in inputs for AI coding agents (Claude Code, Cursor, Codex, etc.) — feed one to the agent and it walks the user through the matching workflow end-to-end. This was previously buried in a one-line mention under the §2 Quick Start callout; surface it so it's actually discoverable. - News: dedicated entry naming all five skills and the AI-agent use case. - §2 Quick Start callout: rewritten to lead with the AI-agent angle, with a note that the same files work as standalone reference. - §2.2 through §2.6: each subsection gains a "**Skill:** ..." pointer to the matching skill file. §2.1 (Installation) and §2.7 (community external link) intentionally have no skill pointer. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The five operator-focused inference skills under skills/ (added in NVIDIA-Medtech#32) work as drop-in inputs for AI coding agents (Claude Code, Cursor, Codex, etc.) — feed one to the agent and it walks the user through the matching workflow end-to-end. This was previously buried in a one-line mention under the §2 Quick Start callout; surface it so it's actually discoverable. - News: dedicated entry naming all five skills and the AI-agent use case. - §2 Quick Start callout: rewritten to lead with the AI-agent angle, with a note that the same files work as standalone reference. - §2.2 through §2.6: each subsection gains a "**Skill:** ..." pointer to the matching skill file. §2.1 (Installation) and §2.7 (community external link) intentionally have no skill pointer. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Highlight inference skills in README News + Quickstart The five operator-focused inference skills under skills/ (added in #32) work as drop-in inputs for AI coding agents (Claude Code, Cursor, Codex, etc.) — feed one to the agent and it walks the user through the matching workflow end-to-end. This was previously buried in a one-line mention under the §2 Quick Start callout; surface it so it's actually discoverable. - News: dedicated entry naming all five skills and the AI-agent use case. - §2 Quick Start callout: rewritten to lead with the AI-agent angle, with a note that the same files work as standalone reference. - §2.2 through §2.6: each subsection gains a "**Skill:** ..." pointer to the matching skill file. §2.1 (Installation) and §2.7 (community external link) intentionally have no skill pointer. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Add example AI-agent prompt under Quickstart callout Drop a concrete one-liner ("Read this README and use the matching skill to generate a T1 whole-brain MR image.") so readers see exactly what the agent flow looks like. Pending end-to-end verification with Claude Code; revert this commit if testing reveals the prompt doesn't elicit the right behavior. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Reorder Quick Start preamble: AI-agent skills first, FOV warning second The previous order led with the FOV/dim/spacing warning, which is only relevant if the user is hand-tuning configs. Now that skills exist for every workflow, lead with the AI-agent path (the simpler default) and demote the hyperparameter warning to a "tuning manually?" callout for the smaller audience that still needs it. Also drop the "same files also work as standalone reference" sentence from the AI callout — the manual-tuning callout below now covers that audience explicitly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Skills now follow a uniform template oriented at someone running inference: Command to run → How to configure a run → Output → Related scripts → Related skills. Algorithm step-by-step walkthroughs and internal function-args tables removed; workflow figures kept.
Changes per skill:
skills/infer_mask-generation.md→ renamed toinfer_mask-only.mdto parallelinfer_image-only. Body rewritten around the two mask-acquisition paths (Path A diffusion-from-scratch vs Path B training-mask DB lookup) and theanatomy_size10-d slot table.infer_image-only.md: restructured around## How to configure a run(6 numbered steps: modality, AE knobs, dim/spacing from FOV, cfg_guidance_scale_modality, cfg_guidance_scale_tumor N/A, num_inference_steps). New end-to-end worked example: T1-axial rflow-mr-brain with concretedimandspacingvalues. CFG section spells out "classifier-free guidance" at first use and links to the per-plane FOV table in docs/inference.md.infer_image-from-mask.md: rewritten as a CLI-operator guide — command to run, input mask format and how to produce one (nv-segment-ct + add_body_envelope, or other segmenter + remap), config knob explanation including cfg_guidance_scale_tumor and the CT-only scope, output file layout. Cross-links to infer_mask-image-paired for the GPU-memory presets.infer_mask-image-paired.md: keeps the LDMSampler dispatch flowchart; drops the algorithmic "Two paths in detail" prose, internal LDMSampler.init state table, and Quality-check loop details. Gains a 6-step## How to configure a runmirroringinfer_image-only, with a GPU-memory presets table (output_size + AE sliding-window knobs by GPU) drawn from the shippedconfig_infer_<XXg>_<dim>.jsonfiles. End-to-end Path B chest CT example.download-models.md: section name standardization (Code reference→Related scripts) and cross-reference style brought in line with the other skills ([name](name.md)).