Nv Generate Ct Rflow
NVIDIAOfficialCreated by NVIDIA MedTech Team
- Skill
- Tool integration
- Science and research
- Apache-2.0
- Medium risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The nv-generate-ct-rflow skill provides a standardized interface for the NVIDIA-Medtech NV-Generate-CTMR rectified-flow synthesis pipeline. It manages configuration staging, output path handling, and validation for generating synthetic CT volumes and paired masks. The skill includes helper utilities for anatomy lookup, diagnostic mask generation, and image-only synthesis, while delegating core inference and sampling to the upstream repository.
What it does
- Generates synthetic CT volumes and corresponding label masks.
- Supports controllable anatomy generation for specific tumor types.
- Provides diagnostic tools for raw mask generation and image-from-mask synthesis.
- Validates input configurations against schema bounds and anatomy constraints.
- Produces summary cards for visual inspection of generated outputs.
- Maps paired output labels back to standard MAISI label IDs.
When to use it
- When you need to generate synthetic CT image data for research purposes.
- When you require paired CT volumes and segmentation masks.
- When you need to perform controllable synthesis of specific anatomical regions or tumors.
- When you need to validate configuration files before executing large-scale inference.
Advantages
- Automates environment setup and dependency management for the upstream pipeline.
- Ensures consistent output structure and metadata recording.
- Provides built-in preflight checks to prevent common configuration errors.
- Simplifies complex inference workflows through standardized wrapper commands.
Usage examples
- “Generate a synthetic CT volume using the chest lung tumor controllable configuration.”
- The agent executes the wrapper script with the specified configuration, producing synthetic CT volumes and masks in the designated output directory.
- “List all available chest anatomies for generation.”
- The agent runs the anatomy lookup tool and returns a list of 132-class labels grouped by the chest region.
- “Validate the abdomen liver and spleen configuration without running full inference.”
- The agent performs a preflight check on the configuration file and reports any schema or constraint violations without generating image data.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/nvidia/nv-generate-ct-rflow/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip nv-generate-ct-rflow.zip -d .agents/skills
Documentation by NVIDIA MedTech Team
NV-Generate-CT (rflow-ct)
Purpose
Used for generating synthetic CT volumes and masks with NV-Generate-CTMR rflow-ct. Not for production training data without review.
Use the wrapper exactly as documented; do not replace the upstream entrypoint with a handwritten implementation.
Do not write custom inference code for normal runs. The wrapper owns config staging, output paths, label mapping evidence, and validation.
Manifest I/O: inputs are
config_infer_override; outputs aresynthetic_ct_volumesandresult_json.
Instructions
Read
skill_manifest.yamlbefore changing arguments, side effects, or validation gates.Run
scripts/run_rflow_ct.pythrough the documented command below; keep outputs under a caller-provided run directory.If a host agent exposes
run_script, userun_script("scripts/run_rflow_ct.py", args=[...]); otherwise run the Bash/Python command shown below.Emit a single bash code block, and keep the
python -m pip install -r "$NV_GENERATE_ROOT/requirements.txt"step in that same command — the runtime may be a fresh environment withoutnibabel/MONAI, so dropping the install fails withModuleNotFoundError.Do not add
rm,mkdir, or any cleanup of--output-dir; the wrapper creates it. Use a fresh--output-dirinstead of deleting one.Check the emitted JSON and paired verifier guidance before treating the run as evidence.
Available Scripts
| Script | Purpose | Arguments |
|---|---|---|
scripts/_anatomy.py | Internal helper used by the primary entrypoint. | Imported only; do not call directly. |
scripts/_summary_card.py | Internal helper used by the primary entrypoint. | Imported only; do not call directly. |
scripts/list_anatomies.py | Helper command for catalog or anatomy lookup. | [--region REGION] [--filter TEXT] [--controllable] |
scripts/run_rflow_ct.py | Primary entrypoint declared by skill_manifest.yaml. | CONFIG_INFER.json --output-dir OUT_DIR [--random-seed N] [--version rflow-ct] [--yes] |
scripts/run_ct_mask.py | Advanced diagnostic helper for standalone raw MAISI mask generation. | REQUEST.json --output-dir OUT_DIR [--random-seed N] [--preflight-only] [--yes] |
scripts/run_ct_from_mask.py | Advanced helper for CT image generation from a MAISI label mask. | REQUEST.json --output-dir OUT_DIR [--random-seed N] [--yes] |
scripts/run_ct_image.py | Advanced helper for CT image-only generation without paired labels. | MODEL_CONFIG.json --output-dir OUT_DIR [--version rflow-ct] [--random-seed N] [--yes] |
Prerequisites
Required environment variables:
NV_GENERATE_ROOT.Runtime requirements: GPU/CUDA when declared by the manifest; Python packages listed in
runtime.side_effects.pip_packages.Side effects: writes generated outputs under the caller's
--output-dir, may cache model assets under~/.cache/huggingface/, and may contacthttps://huggingface.coorhttps://github.comduring setup.Run commands from the repository root unless an existing section below says otherwise.
Limitations
This is a thin wrapper. Inference, sampling, and decoding are delegated entirely to NVIDIA-Medtech/NV-Generate-CTMR's
scripts.inference. Do not modify code under $NV_GENERATE_ROOT.rflow-ct requires CUDA and ≈ 16 GB VRAM minimum for the default 256³ output_size. Larger output_size (e.g. 512×512×768) needs an A100/H100.
Output volumes are synthetic. They are not safe to use as training data for production medtech models without an independent quality review.
Not for clinical deployment, clinical interpretation, autonomous diagnosis, regulatory submission.
Troubleshooting
| Error | Cause | Fix |
|---|---|---|
| Missing dependency or import error | Runtime package drift from skill_manifest.yaml. | Install the packages declared in the manifest or use the documented setup command. |
| Empty or schema-invalid output | Wrong input path, unsupported modality, or upstream failure. | Re-run with a known fixture and inspect the wrapper JSON plus stderr. |
| Validation gate failure | Output violated a declared engineering invariant. | Keep the failed evidence pack and use the gate message to repair inputs or wrapper code. |
Wraps the upstream
NVIDIA-Medtech/NV-Generate-CTMR
rectified-flow synthesis pipeline. The wrapper does not reimplement diffusion,
sampling, or autoencoder decoding — it shells out to the upstream
scripts.inference entry point exactly as the project's README documents and
inspects the produced image/mask pairs.
Preconditions
If
NV_GENERATE_ROOTalready names a local checkout, the wrapper uses it and records its current commit in the result. Otherwise, create the recommended pinned default checkout (one-time):if [ -z "${NV_GENERATE_ROOT:-}" ]; then export NV_GENERATE_COMMIT=61c4ec709b84cad468852243c48e250bec732074 export NV_GENERATE_ROOT="$HOME/.cache/nvidia-skills/upstreams/NV-Generate-CTMR-61c4ec7" if [ ! -d "$NV_GENERATE_ROOT/.git" ]; then git clone https://github.com/NVIDIA-Medtech/NV-Generate-CTMR.git "$NV_GENERATE_ROOT" git -C "$NV_GENERATE_ROOT" checkout --detach "$NV_GENERATE_COMMIT" fi fi python -m pip install -r "$NV_GENERATE_ROOT/requirements.txt"Download the
rflow-ctweights and the mask-candidate datasets into the clone (one-time, ≈ 5.5 GB):cd "$NV_GENERATE_ROOT" python -m scripts.download_model_data --version rflow-ct --root_dir "./"The mask candidates (
datasets/all_masks_flexible_size_and_spacing_4000) condition the diffusion sampler; omitting them via--model_onlywill make the inference script fail with a missing-file error at startup. The anatomy-size condition file is also part of the full CT download and is needed for controllable mask generation.NVIDIA GPU with ≥ 16 GB VRAM and CUDA. There is no CPU fallback.
For agent-generated user run commands, prefer the short wrapper command in
Usage. Do not prepend clone or model-download setup steps when NV_GENERATE_ROOT
or the repo-local upstream cache is already present. In a fresh Python
environment, still include python -m pip install -r "$NV_GENERATE_ROOT/requirements.txt"
before the wrapper unless the active environment has already proven those
imports are available; cached weights do not imply cached Python packages. Run
the wrapper from the medical-AI-skills repo root. If setup requires cd "$NV_GENERATE_ROOT", return to the Medical AI Skills repo before invoking
skills/nv-generate-ct-rflow/scripts/run_rflow_ct.py.
Usage
export NV_GENERATE_ROOT="${NV_GENERATE_ROOT:-$HOME/.cache/nvidia-skills/upstreams/NV-Generate-CTMR-61c4ec7}" && \
python -m pip install -r "$NV_GENERATE_ROOT/requirements.txt" && \
python skills/nv-generate-ct-rflow/scripts/run_rflow_ct.py \
PATH_TO_CONFIG_INFER.json \
--output-dir runs/nv_generate_ct_rflow_demo \
--random-seed 0 \
--version rflow-ctReplace PATH_TO_CONFIG_INFER.json with the user's actual request/config
path. Do not copy the fixture path from this document unless the user
explicitly asked to run that fixture. If the user says "the case request is at
runs/.../chest_lung_tumor_controllable.json", that exact path is the first
positional argument to scripts/run_rflow_ct.py.
The fixture argument is a config_infer.json override file: it can replace
num_output_samples, body_region, anatomy_list, controllable_anatomy_size,
output_size, and spacing. Pass default to use the upstream config
verbatim. The wrapper stages the override into the upstream tree before
running.
Fixture catalog
fixtures/ ships curated configs for common paired synthesis use cases: chest
lung lobes, chest with controllable lung tumor, abdomen solid organs,
abdomen with controllable hepatic tumor, head + cervical spine, pelvis.
See fixtures/README.md for the full table.
Helper commands
# Browse the 132-class label_dict grouped by body region.
python skills/nv-generate-ct-rflow/scripts/list_anatomies.py --region chest
python skills/nv-generate-ct-rflow/scripts/list_anatomies.py --controllable
python skills/nv-generate-ct-rflow/scripts/list_anatomies.py --filter tumor
# Validate a fixture and preview cost without launching inference.
NV_GENERATE_ROOT=$HOME/.cache/nvidia-skills/upstreams/NV-Generate-CTMR-61c4ec7 \
python skills/nv-generate-ct-rflow/scripts/run_rflow_ct.py \
skills/nv-generate-ct-rflow/fixtures/abdomen_liver_spleen.json \
--output-dir runs/preview --preflight-onlyAdvanced helpers stay inside this skill for debugging and less-common CT generation modes. Use them only when the user explicitly asks for that mode:
# Raw MAISI mask diagnostic, useful for checking lung tumor -> label 23.
python skills/nv-generate-ct-rflow/scripts/run_ct_mask.py \
skills/nv-generate-ct-rflow/fixtures/ct_mask_lung_tumor.json \
--output-dir runs/ct_mask_debug --preflight-only
# CT image from an existing MAISI label mask with body label 200.
python skills/nv-generate-ct-rflow/scripts/run_ct_from_mask.py \
skills/nv-generate-ct-rflow/fixtures/ct_from_mask_request_example.json \
--output-dir runs/ct_from_mask_demo
# CT image-only generation without paired labels.
python skills/nv-generate-ct-rflow/scripts/run_ct_image.py \
skills/nv-generate-ct-rflow/fixtures/ct_image_only_default.json \
--output-dir runs/ct_image_only_demo --version rflow-ctThe wrapper runs preflight on every invocation (regardless of
--preflight-only): config-schema bounds, anatomy names matched
against the upstream label_dict, body_region in the supported set,
controllable_anatomy_size constraints, upstream CT output-size/spacing
contracts, body-region-aware x/y FOV minimums, dataset presence under
$NV_GENERATE_ROOT/datasets/, CUDA available, and an estimated peak VRAM /
wall-time. Runs estimated to exceed 5 min wall-time or 30 GB VRAM peak require
--yes to proceed.
Each invocation runs python -m scripts.inference -t configs/config_network_rflow.json -i configs/config_infer.json -e configs/environment_rflow-ct.json --random-seed <s> --version rflow-ct. Output evidence records the upstream git commit, model
checkpoint hashes, the rendered config, per-sample image/mask geometry, mask
label set, image HU range summary, and per-class voxel volumes.
When controllable_anatomy_size is non-empty, upstream ignores the broader
anatomy_list for the saved paired label map and filters labels to the
controllable anatomy names. The saved paired label values are local 1..N
ordinals, not raw MAISI label IDs. Read output.output_label_mapping in
result_json to map saved output labels back to source labels; for example,
output label 1 can represent MAISI label 23 (lung tumor).
For curated lung-tumor examples, prefer a controllable size around 0.5 or
larger; smaller requests such as 0.2 can produce absent or extremely small
label-23 components for some seeds.
For FOV and setup details, see references/fov-and-downloads.md. For
advanced helper label-space details, see
references/ct-mask-label-space.md and references/ct-from-mask-format.md.
Visual sample card
Alongside the NIfTI pairs, the wrapper writes summary.html to the
output directory: a per-sample mid-slice triptych (axial / coronal /
sagittal) with label overlay, plus a table of the rendered config and
verifier-facing aggregates. Lets you eyeball the result without firing
up 3D Slicer. Pass --no-summary-card to skip.
Anatomy plausibility (label-set sanity, voxel HU range as CT, image/mask
geometry match, declared output labels present, lung-lobe HU floor) is checked by
verifiers/ct_synthesis_quality_v1.
Not for clinical interpretation, training data for production deployment, or any non-synthetic-research use.
Files
- ATTRIBUTION.mdAdded by AutoGineer931 B
- BENCHMARK.md3.9 KiB
- LICENSELicence file added by AutoGineer11.2 KiB
- SKILL.md12.0 KiB
- evals/evals.json1.4 KiB
- fixtures/README.md4.4 KiB
- fixtures/abdomen_hepatic_tumor.json787 B
- fixtures/abdomen_liver_spleen.json747 B
- fixtures/chest_lung_lobes.json680 B
- fixtures/chest_lung_tumor_controllable.json850 B
- fixtures/ct_from_mask_request_example.json204 B
- fixtures/ct_image_only_default.json284 B
- fixtures/ct_mask_lung_tumor.json413 B
- fixtures/default_config_infer.json679 B
- fixtures/head_brain.json710 B
- fixtures/pelvis.json707 B
- references/ct-from-mask-format.md672 B
- references/ct-mask-label-space.md761 B
- references/fov-and-downloads.md2.0 KiB
- scripts/_anatomy.pyScript11.8 KiB
- scripts/_summary_card.pyScript10.9 KiB
- scripts/list_anatomies.pyScript4.5 KiB
- scripts/run_ct_from_mask.pyScript17.5 KiB
- scripts/run_ct_image.pyScript20.4 KiB
- scripts/run_ct_mask.pyScript20.0 KiB
- scripts/run_rflow_ct.pyScript38.6 KiB
- scripts/wrapper_utils.pyScript2.1 KiB
- skill-card.md4.2 KiB
- skill.oms.sig11.1 KiB
- skill_manifest.yaml7.9 KiB
- tests/test_run_ct_from_mask.pyScript2.7 KiB
- tests/test_run_ct_image.pyScript3.2 KiB
- tests/test_run_ct_mask.pyScript2.9 KiB
- tests/test_run_rflow_ct.pyScript12.0 KiB
- validators/output_schema.json6.4 KiB
scripts/_anatomy.py
#!/usr/bin/env python3
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Anatomy / region taxonomy for the nv_generate_ct_rflow skill.
Mirrors what `scripts/sample.py` in NVIDIA-Medtech/NV-Generate-CTMR
enforces at inference time, surfaced here so the wrapper can validate
user input *before* loading the diffusion model (which takes ~30s on a
warm GPU). All sources cited inline; nothing here is reverse-engineered.
"""
from __future__ import annotations
import json
import os
from pathlib import Path
from typing import Any
# Authoritative source: $NV_GENERATE_ROOT/scripts/sample.py:
# available_body_region = ["head", "chest", "thorax", "abdomen", "pelvis", "lower"]
SUPPORTED_BODY_REGIONS: tuple[str, ...] = (
"head",
"chest",
"thorax",
"abdomen",
"pelvis",
"lower",
)
# Authoritative source: $NV_GENERATE_ROOT/scripts/sample.py
# available_controllable_organ = ["liver", "gallbladder", "stomach", "pancreas", "colon"]
CONTROLLABLE_ORGANS: tuple[str, ...] = (
"liver",
"gallbladder",
"stomach",
"pancreas",
"colon",
)
# Authoritative source: $NV_GENERATE_ROOT/scripts/sample.py
# available_controllable_tumor = ["hepatic tumor", "bone lesion", "lung tumor",
# "colon cancer primaries", "pancreatic tumor"]
CONTROLLABLE_TUMORS: tuple[str, ...] = (
"hepatic tumor",
"bone lesion",
"lung tumor",
"colon cancer primaries",
"pancreatic tumor",
)
# Region groupings used only for display in list_anatomies.py. The model
# does not enforce these; a user can pair any anatomy_list with any
# body_region. Membership is curated by anatomical convention; some
# classes (e.g. aorta, vena cava) span regions and appear once where
# their bulk lives.
_REGION_GROUPS: dict[str, tuple[str, ...]] = {
"head": (
"brain",
"skull",
"spinal cord",
"thyroid gland",
"trachea",
"vertebrae C1",
"vertebrae C2",
"vertebrae C3",
"vertebrae C4",
"vertebrae C5",
"vertebrae C6",
"vertebrae C7",
),
"chest": (
"left lung upper lobe",
"left lung lower lobe",
"right lung upper lobe",
"right lung middle lobe",
"right lung lower lobe",
"lung tumor",
"heart",
"left atrial appendage",
"pulmonary vein",
"esophagus",
"airway",
"sternum",
"costal cartilages",
"left clavicula",
"right clavicula",
"left scapula",
"right scapula",
"left humerus",
"right humerus",
"left rib 1",
"left rib 2",
"left rib 3",
"left rib 4",
"left rib 5",
"left rib 6",
"left rib 7",
"left rib 8",
"left rib 9",
"left rib 10",
"left rib 11",
"left rib 12",
"right rib 1",
"right rib 2",
"right rib 3",
"right rib 4",
"right rib 5",
"right rib 6",
"right rib 7",
"right rib 8",
"right rib 9",
"right rib 10",
"right rib 11",
"right rib 12",
"vertebrae T1",
"vertebrae T2",
"vertebrae T3",
"vertebrae T4",
"vertebrae T5",
"vertebrae T6",
"vertebrae T7",
"vertebrae T8",
"vertebrae T9",
"vertebrae T10",
"vertebrae T11",
"vertebrae T12",
"aorta",
"inferior vena cava",
"superior vena cava",
"brachiocephalic trunk",
"left brachiocephalic vein",
"right brachiocephalic vein",
"left common carotid artery",
"right common carotid artery",
"left subclavian artery",
"right subclavian artery",
),
"abdomen": (
"liver",
"spleen",
"pancreas",
"right kidney",
"left kidney",
"right adrenal gland",
"left adrenal gland",
"gallbladder",
"stomach",
"duodenum",
"small bowel",
"colon",
"hepatic vessel",
"hepatic tumor",
"pancreatic tumor",
"colon cancer primaries",
"portal vein and splenic vein",
"right kidney cyst",
"left kidney cyst",
"bone lesion",
"vertebrae L1",
"vertebrae L2",
"vertebrae L3",
"vertebrae L4",
"vertebrae L5",
),
"pelvis": (
"bladder",
"prostate",
"sacrum",
"vertebrae S1",
"left hip",
"right hip",
"left iliac artery",
"right iliac artery",
"left iliac vena",
"right iliac vena",
"left iliopsoas",
"right iliopsoas",
"left autochthon",
"right autochthon",
),
"lower": (
"left femur",
"right femur",
"left gluteus maximus",
"right gluteus maximus",
"left gluteus medius",
"right gluteus medius",
"left gluteus minimus",
"right gluteus minimus",
),
"general": ("body",),
}
def resolve_nv_generate_root() -> Path:
raw = os.environ.get("NV_GENERATE_ROOT", "").strip()
if not raw:
raise RuntimeError(
"NV_GENERATE_ROOT is unset. Clone "
"https://github.com/NVIDIA-Medtech/NV-Generate-CTMR and export "
"NV_GENERATE_ROOT=<clone-path>."
)
p = Path(raw).expanduser().resolve()
if not p.is_dir():
raise RuntimeError(f"NV_GENERATE_ROOT does not exist: {p}")
return p
def load_label_dict(upstream_root: Path | None = None) -> dict[str, int]:
"""Read the upstream's label_dict.json. Drops the `dummy*` placeholder
entries (they're holes in the VISTA3D index space, not real classes).
"""
root = upstream_root or resolve_nv_generate_root()
path = root / "configs" / "label_dict.json"
if not path.is_file():
raise FileNotFoundError(
f"{path} not found. Re-clone NV-Generate-CTMR or check $NV_GENERATE_ROOT."
)
raw = json.loads(path.read_text())
return {name: idx for name, idx in raw.items() if not name.startswith("dummy")}
def region_for_class(class_name: str) -> str | None:
"""Return the region grouping for a class name, or None if it has no
canonical region. Display-only; the upstream model does not enforce.
"""
for region, members in _REGION_GROUPS.items():
if class_name in members:
return region
return None
def classes_by_region(label_dict: dict[str, int]) -> dict[str, list[tuple[str, int]]]:
"""Group `label_dict` entries by region. Classes with no canonical
region land under "other"."""
out: dict[str, list[tuple[str, int]]] = {r: [] for r in _REGION_GROUPS}
out["other"] = []
for name, idx in label_dict.items():
region = region_for_class(name)
out[region or "other"].append((name, idx))
for r in out:
out[r].sort(key=lambda x: x[1])
return out
def validate_anatomy_list(
anatomy_list: list[str] | None,
label_dict: dict[str, int],
) -> list[str]:
"""Return a list of error messages (empty if valid)."""
errors: list[str] = []
if anatomy_list is None:
return errors
if not isinstance(anatomy_list, list):
return [f"anatomy_list must be a list of strings, got {type(anatomy_list).__name__}"]
valid_names = set(label_dict.keys())
for entry in anatomy_list:
if not isinstance(entry, str):
errors.append(f"anatomy_list entry must be a string, got {entry!r}")
continue
if entry not in valid_names:
close = _suggest_close(entry, valid_names)
hint = f" (did you mean {close!r}?)" if close else ""
errors.append(f"anatomy_list entry not in upstream label_dict: {entry!r}{hint}")
return errors
def validate_body_region(body_region: list[str] | None) -> list[str]:
errors: list[str] = []
if body_region is None:
return errors
if not isinstance(body_region, list):
return [f"body_region must be a list of strings, got {type(body_region).__name__}"]
for entry in body_region:
if entry not in SUPPORTED_BODY_REGIONS:
errors.append(
f"body_region entry {entry!r} not in supported set "
f"{list(SUPPORTED_BODY_REGIONS)}"
)
return errors
def validate_controllable_anatomy_size(
controllable_anatomy_size: list[Any] | None,
) -> list[str]:
errors: list[str] = []
if controllable_anatomy_size is None or controllable_anatomy_size == []:
return errors
if not isinstance(controllable_anatomy_size, list):
return ["controllable_anatomy_size must be a list of [name, size] pairs"]
if len(controllable_anatomy_size) > int("10"):
errors.append(
f"controllable_anatomy_size length must be <= 10, got {len(controllable_anatomy_size)}"
)
valid = set(CONTROLLABLE_ORGANS) | set(CONTROLLABLE_TUMORS)
tumors_seen: list[str] = []
names_seen: list[str] = []
for i, pair in enumerate(controllable_anatomy_size):
if not (isinstance(pair, (list, tuple)) and len(pair) == 2):
errors.append(
f"controllable_anatomy_size[{i}] must be a [name, size] pair, got {pair!r}"
)
continue
name, size = pair
if name not in valid:
errors.append(
f"controllable_anatomy_size[{i}] name {name!r} not in "
f"controllable organs {list(CONTROLLABLE_ORGANS)} or "
f"tumors {list(CONTROLLABLE_TUMORS)}"
)
if name in CONTROLLABLE_TUMORS:
tumors_seen.append(name)
names_seen.append(name)
if not isinstance(size, (int, float)):
errors.append(f"controllable_anatomy_size[{i}] size must be numeric, got {size!r}")
elif size != -1 and not (0.0 <= size <= 1.0):
errors.append(
f"controllable_anatomy_size[{i}] size must be in [0, 1] or -1, got {size}"
)
if len(tumors_seen) > 1:
errors.append(f"controllable_anatomy_size may include at most one tumor; got {tumors_seen}")
if len(names_seen) != len(set(names_seen)):
errors.append(f"controllable_anatomy_size must not repeat anatomy names; got {names_seen}")
return errors
def _suggest_close(needle: str, haystack: set[str], max_distance: int = int("4")) -> str | None:
"""Tiny Levenshtein-ish suggestion for typos. No external deps."""
needle_l = needle.lower()
best: tuple[int, str] | None = None
for candidate in haystack:
d = _edit_distance(needle_l, candidate.lower(), cap=max_distance + 1)
if d <= max_distance and (best is None or d < best[0]):
best = (d, candidate)
return best[1] if best else None
def _edit_distance(a: str, b: str, cap: int) -> int:
if abs(len(a) - len(b)) >= cap:
return cap
prev = list(range(len(b) + 1))
for i, ca in enumerate(a, 1):
cur = [i] + [0] * len(b)
row_min = cur[0]
for j, cb in enumerate(b, 1):
cur[j] = min(
prev[j] + 1,
cur[j - 1] + 1,
prev[j - 1] + (0 if ca == cb else 1),
)
row_min = min(row_min, cur[j])
if row_min >= cap:
return cap
prev = cur
return prev[-1]
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Declares allowed tools, Needs a command-line tool, Needs Python
Security
What our scanner noticed· Medium risk
- Large base64-encoded blobs
- Instructions that use the network
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- NVIDIA MedTech Team
- Publisher
- NVIDIA (Official)
- Source
- NVIDIA/skills · skills/nv-generate-ct-rflow · commit fce3cca
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE-APACHE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by NVIDIA MedTech Team or NVIDIA.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download nv-generate-ct-rflow.zip