一键导入
nv-generate-mr
Used for generating synthetic body MRI volumes with NV-Generate-CTMR rflow-mr. Not for paired masks or production training data.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Used for generating synthetic body MRI volumes with NV-Generate-CTMR rflow-mr. Not for paired masks or production training data.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use for any question about a codebase, its architecture, file relationships, or project content — especially when graphify-out/ exists, where the question should be treated as a graphify query first. Turns any input (code, docs, papers, images, videos) into a persistent knowledge graph with god nodes, community detection, and query/path/explain tools.
Use when asked to run deep research or AI-Q research through a reachable NVIDIA AI-Q Blueprint backend.
Trace and interpret the Pareto frontier across competing objectives using repeated single-objective cuOpt solves (weighted-sum and ε-constraint).
LP, MILP, and QP (beta) with cuOpt — C API only. Use when the user is embedding LP, MILP, or QP in C/C++.
LP, MILP, and QP (beta) with cuOpt — CLI only (MPS files, cuopt_cli). Use when the user is solving LP, MILP, or QP from MPS via command line.
Solve LP, MILP, QP (beta) with cuOpt Python API — linear/quadratic objectives, integer variables, scheduling, portfolio, least squares.
| name | nv-generate-mr |
| description | Used for generating synthetic body MRI volumes with NV-Generate-CTMR rflow-mr. Not for paired masks or production training data. |
| license | Apache-2.0 |
| allowed-tools | Bash |
| metadata | {"author":"NVIDIA MedTech Team","tags":["MedTech","MRI","generation"]} |
model_config_override; outputs are synthetic_mr_volumes and result_json.skill_manifest.yaml before changing arguments, side effects, or validation gates.scripts/run_mr.py through the documented command below; keep outputs under a caller-provided run directory.run_script, use run_script("scripts/run_mr.py", args=[...]); otherwise run the Bash/Python command shown below.python -m pip install -r "$NV_GENERATE_ROOT/requirements.txt" step in that same command — the runtime may be a fresh environment without nibabel/MONAI, so dropping the install fails with ModuleNotFoundError.rm, mkdir, or any cleanup of --output-dir; the wrapper creates it. Use a fresh --output-dir instead of deleting one.| Script | Purpose | Arguments |
|---|---|---|
scripts/run_mr.py | Primary entrypoint declared by skill_manifest.yaml. | MODEL_CONFIG.json --output-dir OUT_DIR --modality mri_t1 [--random-seed N] [--yes] |
runtime.side_effects.pip_packages.--output-dir, may cache model assets under ~/.cache/huggingface/, and may contact https://huggingface.co or https://github.com during setup.scripts.diff_model_infer. Do not modify code under $NV_GENERATE_ROOT or the repo-local fallback at .workbench_data/upstreams/NV-Generate-CTMR.rflow-mr-brain instead for brain MRI synthesis; use skills/nv-generate-mr-brain for that path.| 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
MR image-only generation workflow. The wrapper does not reimplement diffusion
sampling or autoencoder decoding. It stages config overrides, runs the
documented python -m scripts.diff_model_infer command for rflow-mr, then
summarizes the generated NIfTI volume.
For user run commands in a fresh benchmark environment, use this setup plus repo-root wrapper command exactly:
export NV_GENERATE_ROOT="${NV_GENERATE_ROOT:-.workbench_data/upstreams/NV-Generate-CTMR}" && \
python -m pip install -r "$NV_GENERATE_ROOT/requirements.txt" && \
python skills/nv-generate-mr/scripts/run_mr.py PATH_TO_MR_CONFIG.json --output-dir OUT_DIR --modality mri_t1 --random-seed 0
Do not invent generate.sh, infer.py, Medical AI Skills run, or python -m nv_generate_mr commands. PATH_TO_MR_CONFIG.json must be the user's supplied request path.
Clone and install the upstream repo once. In this Medical AI Skills checkout, prefer the repo-local cache path when it exists:
mkdir -p .workbench_data/upstreams
test -d .workbench_data/upstreams/NV-Generate-CTMR/.git || \
git clone https://github.com/NVIDIA-Medtech/NV-Generate-CTMR.git \
.workbench_data/upstreams/NV-Generate-CTMR
export NV_GENERATE_ROOT=.workbench_data/upstreams/NV-Generate-CTMR
pip install -r "$NV_GENERATE_ROOT/requirements.txt"
Download the MR weights:
cd "$NV_GENERATE_ROOT"
python -m scripts.download_model_data --version rflow-mr --root_dir ./ --model_only
Runtime needs an NVIDIA GPU with at least 16 GB VRAM. There is no CPU fallback in the upstream path.
The wrapper also searches .workbench_data/upstreams/NV-Generate-CTMR if
NV_GENERATE_ROOT is unset or points at a stale clone.
For agent-generated user run commands, use the command in Usage. Do not prepend
clone or model-download setup steps when the repo-local upstream cache already
exists. In a fresh Python environment, still include
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. If setup requires cd "$NV_GENERATE_ROOT", return to the Medical AI Skills repo before invoking
skills/nv-generate-mr/scripts/run_mr.py.
export NV_GENERATE_ROOT="${NV_GENERATE_ROOT:-.workbench_data/upstreams/NV-Generate-CTMR}" && \
python -m pip install -r "$NV_GENERATE_ROOT/requirements.txt" && \
python skills/nv-generate-mr/scripts/run_mr.py \
PATH_TO_MR_CONFIG.json \
--output-dir runs/nv_generate_mr_demo \
--modality mri_t1 \
--random-seed 0
Replace PATH_TO_MR_CONFIG.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 request is at
runs/.../default_mri_t1.json", that exact path is the first positional
argument to scripts/run_mr.py.
Supported rflow-mr modality names are mri, mri_t1, mri_t2, and
mri_flair, matching the upstream MR image-generation guide. The upstream
README recommends rflow-mr-brain instead when synthesizing brain images;
use skills/nv-generate-mr-brain for that path.
For FOV and setup details, see references/fov-and-downloads.md.
The fixture argument is a small JSON override for
configs/config_maisi_diff_model_rflow-mr.json. Pass default to use the
upstream defaults plus the CLI modality and random seed. Common override keys
are dim, spacing, num_inference_steps, cfg_guidance_scale, and
modality.
Each run records the staged config, model inventory, upstream command, output geometry, spacing, affine, intensity range, and non-constant / finite-data checks. Output volumes are synthetic and are not safe as production training data without independent review.
Not for clinical interpretation, production deployment, autonomous diagnosis, or regulatory submission.