AGENT SKILL

nv-segment-ct

Used for running NV-Segment-CT VISTA3D on CT NIfTI volumes and recording label-map evidence.

License 许可
Apache-2.0
最近更新
2026-11-13
Stars
★ 2
Forks
2

01 前言 Front Matter

name
nv-segment-ct
license
Apache-2.0
version
1.0.0
category
development-code
metadata
{ "tags": [ "MedTech", "CT", "segmentation" ], "author": "NVIDIA MedTech Team" }
description
Used for running NV-Segment-CT VISTA3D on CT NIfTI volumes and recording label-map evidence.
allowed-tools
Bash

02 资源文件 11

03 SKILL.md 正文

NV-Segment-CT

Purpose

  • Used for running NV-Segment-CT VISTA3D on CT NIfTI volumes and recording label-map evidence. Not for clinical interpretation.
  • Use the wrapper exactly as documented; do not replace the upstream entrypoint with a handwritten implementation.
  • Manifest I/O: inputs are ct_volume; outputs are label_map and result_json.

Instructions

  • Read skill_manifest.yaml before changing arguments, side effects, or validation gates.
  • Run scripts/run_vista3d.py through the documented command below; keep outputs under a caller-provided run directory.
  • If a host agent exposes run_script, use run_script("scripts/run_vista3d.py", args=[...]); otherwise run the Bash/Python command shown below.
  • Check the emitted JSON and paired verifier guidance before treating the run as evidence.

Available Scripts

Script Purpose Arguments
scripts/run_vista3d.py Primary entrypoint declared by skill_manifest.yaml. PATH_TO_CT.nii.gz [--output-dir OUT_DIR] [--label-prompts IDS]

Prerequisites

  • Runtime requirements: GPU/CUDA when declared by the manifest; Python packages listed in runtime.side_effects.pip_packages.
  • Side effects: writes the downloaded bundle under skills/nv-segment-ct/bundle/, may cache model assets under ~/.cache/huggingface/, and may contact https://huggingface.co during first setup; the optional spleen fixture fetcher downloads MSD09 from https://msd-for-monai.s3-us-west-2.amazonaws.com.
  • Run commands from the repository root unless an existing section below says otherwise.

Limitations

  • This is a thin wrapper. Inference, preprocessing, and postprocessing are delegated entirely to the official hugging_face_pipeline.HuggingFacePipelineHelper in bundle/. Do not modify code under bundle/.
  • transformers must be a 4.x release; the HF model code uses pre-5.x idioms (e.g. _tied_weights_keys).
  • Device auto-detected (cuda if available, else cpu); --device flag overrides.
  • Output may be schema-valid but semantically empty (e.g. label prompts that do not match the input anatomy). Sanity gates assert at least one foreground voxel per requested anatomy.
  • 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/NV-Segment-CT helper. The wrapper does not reimplement VISTA3D inference.

Exact Runnable Surface

For CT segmentation user runs, use this repo-root wrapper path exactly:

python skills/nv-segment-ct/scripts/run_vista3d.py PATH_TO_CT.nii.gz --label-prompts "1,3,5,14" --output-dir OUT_DIR

Do not invent infer.py, Medical AI Skills run, python -m nv_segment_ct, or anatomy-name-only flags. For spleen, liver, right kidney, and left kidney, the required VISTA3D label IDs are exactly 1,3,5,14.

Preconditions

The skill assumes a Python 3.12 environment with no pre-installed runtime deps — its documented command installs everything it needs. Pinned dep list is at requirements.txt.

Two one-time downloads (the documented command does the first one; the fixture fetch is a separate step you run when bootstrapping):

# Spleen example fixture from Decathlon MSD09 (~1.5 GB tar, ~11 MB
# fixture extracted into skills/nv-segment-ct/fixtures/spleen_03.nii.gz):
python skills/nv-segment-ct/fixtures/fetch_spleen_fixture.py

Both downloads (the bundle below, and the fixture) are gitignored (Medical AI Skills policy: no medical data or model weights in git). The fetch script is idempotent and caches the tar under .workbench_data/datasets/ so re-runs are no-ops.

Runtime needs an NVIDIA GPU with CUDA. CPU fallback is supported but slow.

Usage

From Medical AI Skills repo root, run all steps in a single command so the skill is self-bootstrapping against a fresh Python 3.12 venv:

pip install -r skills/nv-segment-ct/requirements.txt && \
huggingface-cli download nvidia/NV-Segment-CT \
  --local-dir skills/nv-segment-ct/bundle/ && \
python skills/nv-segment-ct/scripts/run_vista3d.py PATH_TO_CT.nii.gz \
  --label-prompts "1,3,5,14" \
  --output-dir vista3d_outputs

When the user names anatomies, translate them to VISTA3D class IDs before running. For the common abdominal CT request:

Anatomy VISTA3D class ID
liver 1
spleen 3
right kidney 5
left kidney 14

For "segment the spleen, liver, right kidney, and left kidney", the correct --label-prompts value is exactly "1,3,5,14". Do not substitute kidney IDs from another label dictionary; the wrapper validates the requested label set and will mark the run invalid if the emitted mask contains labels outside the requested set.

The pip install step is load-bearing: do not assume monai/torch/etc. are already in the active environment. The huggingface-cli download step is also part of the contract — it pulls the ~832 MB model bundle into skills/nv-segment-ct/bundle/ (cached after first run; subsequent calls are no-ops).

label-prompts are VISTA3D class IDs. The evidence output records input geometry, output mask path, observed label IDs, unexpected labels, per-class voxel counts, per-class physical volumes computed from the output mask header spacing, runtime, model identity, and fixed code-derived artifact checks such as mask shape, affine match, label set, foreground count, and class-volume bounds.

Pass --ground-truth PATH to record a reference label-map path under input.ground_truth_path. The skill does not compute Dice; that is the paired verifier's job.

Anatomy plausibility (per-class volume bounds, fragmentation, bilateral symmetry, liver larger than spleen) and optional per-class Dice/IoU against the recorded ground truth are checked by verifiers/ct_segmentation_quality_v1.

Not for clinical interpretation, production deployment, or non-CT modalities.

04 同仓库更多 Skills

YYC-Cube
YYC-Cube/YYC3-AI-Agent-Archive

yingmi-skill

当用户需要查询基金、策略、公告、财经资讯,做资产配置、组合诊断、风险回测、现金流分析,或生成图表、PDF 时,优先使用本 Skill 获取真实数据与可执行能力。

★ 2
YYC-Cube
YYC-Cube/YYC3-AI-Agent-Archive

web-access

所有联网操作必须通过此 skill 处理,包括:搜索、网页抓取、登录后操作、网络交互等。

★ 2
YYC-Cube
YYC-Cube/YYC3-AI-Agent-Archive

tencentmap-map-assistant

腾讯位置服务·地图助手 Skill,一句自然语言调用腾讯地图全套能力,无需开发者账号、开箱即用。提供 AI 旅游攻略、地点搜索(含评分/人均/营业时间)、关键词提示、路线规划(驾车/步行/公交/骑行)、地址解析与逆解析、行政区划、IP 定位、距离计算、天气查询,并可将行程或多 POI 渲染成网页地图。涉及找地点、规划路线、旅游行程、查天气、坐标转换等出行场景时使用。

★ 2
YYC-Cube
YYC-Cube/YYC3-AI-Agent-Archive

skill-scanner

Scan any agent skill for security risks before you install or use it. Powered by Tencent Zhuque Lab A.I.G (AI-Infra-Guard). 100% local static analysis — no file contents or credentials leave your device. Compatible with CodeBuddy, Cursor, Windsurf, Claude Code, OpenClaw and more. Triggers on: 这个 skill 安全吗, skill 安全扫描, 检查 skill 安全, audit skill, scan skill, check skill safety, analyze skill, inspect skill, verify skill, skill security, skill supply chain. Do NOT trigger for general agent usage, full system health checks, project debugging, or normal development.

★ 2
YYC-Cube
YYC-Cube/YYC3-AI-Agent-Archive

skill-creator

Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends agent capabilities with specialized knowledge, workflows, or tool integrations.

★ 2
YYC-Cube
YYC-Cube/YYC3-AI-Agent-Archive

shader-dev

Comprehensive GLSL shader techniques for creating stunning visual effects — ray marching, SDF modeling, fluid simulation, particle systems, procedural generation, lighting, post-processing, and more.

★ 2