npx skills add nvidia/skills --skill nv-generate-mr
promptingcompany/nv-skills
nv-generate-mr
Used for generating synthetic body MRI volumes with NV-Generate-CTMR rflow-mr. Not for paired masks or production training data.
Installation
npx skills add promptingcompany/nv-skills --skill nv-generate-mr
Similar popular skills
Related neighbors and high-traction skills in the same topics — useful to compare before installing.
Used for generating synthetic body MRI volumes with NV-Generate-CTMR rflow-mr. Not for paired m…
1.7K installsRead data from a Google Sheet and create a formatted Google Docs report.
27.5K installsGenerate a Playwright test based on a scenario using Playwright MCP
18K installsMigration and code evolution instructions generator for GitHub Copilot. Analyzes differences be…
9K installsTransform this Python script into a polished, beginner-friendly project by refactoring the code…
8.9K installsStructured Autonomy Implementation Generator Prompt
8.8K installsAlso in this package
Other skills from promptingcompany/nv-skills · top by installs.
npx skills add promptingcompany/nv-skills
More details
Agent compatibility
Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.
Also listed on
Alternate registries and mirrors of this skill.
Repository health
main
Skill metadata
Parsed from SKILL.md frontmatter.
BashMore metadata
- author
- NVIDIA MedTech Team
- tags
- ["MedTech","MRI","generation"]
Package contents
Files included with this skill beyond the listing page.
-
skill md
SKILL.md7,767 B -
docs
SUMMARY.md150 B
History
- First seen on skills.sh
- First recorded snapshot · 39 installs
SKILL.md
NV-Generate-MR
Purpose
- Used for generating synthetic body MRI volumes with NV-Generate-CTMR rflow-mr. Not for paired masks or production training data.
- 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, and validation.
- Manifest I/O: inputs are
modelconfigoverride; outputs aresyntheticmrvolumesandresult_json.
Instructions
- Read
skill_manifest.yamlbefore changing arguments, side effects, or validation gates. - Run
scripts/run_mr.pythrough the documented command below; keep outputs under a caller-provided run directory. - If a host agent exposes
runscript, userunscript("scripts/run_mr.py", args=[...]); otherwise run the Bash/Python command shown below. - Emit a single bash code block, and keep the
python -m pip install -r "$NVGENERATEROOT/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/run_mr.py |
Primary entrypoint declared by skill_manifest.yaml. | MODELCONFIG.json --output-dir OUTDIR --modality mri_t1 [--random-seed N] [--yes] |
Prerequisites
- Runtime requirements: GPU/CUDA when declared by the manifest; Python packages listed in
runtime.sideeffects.pippackages. - 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.diffmodelinfer. Do not modify code under $NVGENERATEROOT or the repo-local fallback at .workbench_data/upstreams/NV-Generate-CTMR. - rflow-mr generates image-only synthetic MRI volumes. It does not emit paired segmentation masks.
- The upstream README recommends
rflow-mr-braininstead for brain MRI synthesis; useskills/nv-generate-mr-brainfor that path. - NV-Generate-MR weights are listed by upstream as NVIDIA Non-Commercial. Do not use outputs as production training data without legal and 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 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.diffmodelinfer command for rflow-mr, then summarizes the generated NIfTI volume.
Exact Runnable Surface
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 nvgeneratemr commands. PATHTOMR_CONFIG.json must be the user's supplied request path.
Preconditions
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 .workbenchdata/upstreams/NV-Generate-CTMR if NVGENERATE_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 "$NVGENERATEROOT/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 "$NVGENERATEROOT", return to the Medical AI Skills repo before invoking skills/nv-generate-mr/scripts/run_mr.py.
Usage
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 PATHTOMRCONFIG.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/.../defaultmrit1.json", that exact path is the first positional argument to scripts/runmr.py.
Supported rflow-mr modality names are mri, mrit1, mrit2, 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/configmaisidiffmodelrflow-mr.json. Pass default to use the upstream defaults plus the CLI modality and random seed. Common override keys are dim, spacing, numinferencesteps, cfgguidancescale, 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.