Generated banner for Nv Generate Mr
Generated logo for Nv Generate Mr

Nv Generate Mr

NVIDIAOfficialCreated by NVIDIA MedTech Team

  • Skill
  • Tool integration
  • Data and AI
  • Apache-2.0
  • Medium risk
  • Has scripts

From the author

Used for generating synthetic body MRI volumes with NV-Generate-CTMR rflow-mr. Not for paired masks or production training data.
— the description by NVIDIA MedTech Team

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

NV-Generate-MR provides a standardized interface for the NVIDIA-Medtech/NV-Generate-CTMR rflow-mr model, enabling the generation of synthetic body MRI volumes. The skill acts as a thin wrapper that manages configuration staging, output path handling, and validation of generated NIfTI volumes. It is designed for research and experimentation, specifically excluding clinical deployment, autonomous diagnosis, or the creation of production training data. Users must provide a model configuration file to define generation parameters, and the tool ensures that outputs meet specific geometric and intensity constraints.

What it does

  • Generates synthetic body MRI volumes using the rflow-mr model.
  • Manages configuration overrides for model inference.
  • Validates output geometry, spacing, and intensity ranges.
  • Records metadata including staged configs and model inventory.
  • Supports multiple MRI modalities including T1, T2, and FLAIR.

When to use it

  • When you need to generate synthetic body MRI images for research purposes.
  • When you require a standardized way to invoke the rflow-mr model with specific configuration overrides.
  • When you need to validate the output of an MRI generation run against predefined engineering invariants.

Advantages

  • Provides a consistent, documented interface for the upstream rflow-mr model.
  • Automates the staging of configurations and output validation.
  • Ensures reproducibility by recording run metadata and model inventory.
  • Integrates validation gates to catch common upstream failures or invalid outputs.

Usage examples

“Generate a synthetic T1-weighted body MRI volume using the configuration file at configs/my_mri_config.json.”
The agent will execute the wrapper script with the provided config, outputting the synthetic MRI volume to the specified directory after validating the results.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/nvidia/nv-generate-mr/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip nv-generate-mr.zip -d .agents/skills

Documentation by NVIDIA MedTech Team

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 model_config_override; outputs are synthetic_mr_volumes and result_json.

Instructions

  • Read skill_manifest.yaml before changing arguments, side effects, or validation gates.

  • Run scripts/run_mr.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_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 "$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.

  • Do not add rm, mkdir, or any cleanup of --output-dir; the wrapper creates it. Use a fresh --output-dir instead of deleting one.

  • Check the emitted JSON and paired verifier guidance before treating the run as evidence.

Available Scripts

ScriptPurposeArguments
scripts/run_mr.pyPrimary entrypoint declared by skill_manifest.yaml.MODEL_CONFIG.json --output-dir OUT_DIR --modality mri_t1 [--random-seed N] [--yes]

Prerequisites

  • 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 contact https://huggingface.co or https://github.com during 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.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 generates image-only synthetic MRI volumes. It does not emit paired segmentation masks.

  • The upstream README recommends rflow-mr-brain instead for brain MRI synthesis; use skills/nv-generate-mr-brain for 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

ErrorCauseFix
Missing dependency or import errorRuntime package drift from skill_manifest.yaml.Install the packages declared in the manifest or use the documented setup command.
Empty or schema-invalid outputWrong input path, unsupported modality, or upstream failure.Re-run with a known fixture and inspect the wrapper JSON plus stderr.
Validation gate failureOutput 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.

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:-$HOME/.cache/nvidia-skills/upstreams/NV-Generate-CTMR-61c4ec7}" && \
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.

Preconditions

If NV_GENERATE_ROOT already names a local checkout, the wrapper uses it and records its current commit in the result. Otherwise, create the recommended pinned default checkout once:

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
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 does not have the required upstream layout.

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.

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-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.

Files

BENCHMARK.md

Evaluation Report

Evaluation of the nv-generate-mr skill before publication through NVSkills-Eval.

This benchmark summarizes 3-Tier Evaluation from NVSkills-Eval results for the skill. The goal is to document whether the skill is safe, discoverable, effective, and useful for agents before it is published for broader workflow use.

Evaluation Summary

  • Skill: nv-generate-mr

  • Evaluation date: 2026-07-08

  • NVSkills-Eval profile: external

  • Environment: astra-sandbox

  • Dataset: 2 evaluation tasks

  • Attempts per task: 1

  • Pass threshold: 50%

  • Overall verdict: PASS

Agents Used

  • claude-code

  • codex

Metrics Used

Reported benchmark dimensions:

  • Security: checks whether skill-assisted execution avoids unsafe behavior such as secret leakage, destructive commands, or unauthorized access.

  • Correctness: checks whether the agent follows the expected workflow and produces the correct final output.

  • Discoverability: checks whether the agent loads the skill when relevant and avoids using it when irrelevant.

  • Effectiveness: checks whether the agent performs measurably better with the skill than without it.

  • Efficiency: checks whether the agent uses fewer tokens and avoids redundant work.

Underlying evaluation signals used in this run:

  • security (Security): checks for unsafe operations, secret leakage, and unauthorized access.

  • skill_execution (Skill Execution): verifies that the agent loaded the expected skill and workflow.

  • skill_efficiency (Efficiency): checks routing quality, decoy avoidance, and redundant tool usage.

  • accuracy (Accuracy): grades final-answer correctness against the reference answer.

  • goal_accuracy (Goal Accuracy): checks whether the overall user task completed successfully.

  • behavior_check (Behavior Check): verifies expected behavior steps, including safety expectations.

  • token_efficiency (Token Efficiency): compares token usage with and without the skill.

Test Tasks

The benchmark dataset contained 2 evaluation tasks:

  • Positive tasks: 1 tasks where the skill was expected to activate.

  • Negative tasks: 1 tasks where no skill was expected.

  • Unlabeled tasks: 0 tasks where positive/negative intent could not be inferred.

Task composition is derived from the evaluation dataset when possible. Entries with expected_skill set are treated as positive skill-activation cases, while entries with expected_skill: null are treated as negative activation cases.

Results

DimensionNumclaude-codecodex
Security2100% (+0%)100% (+0%)
Correctness260% (+22%)85% (+19%)
Discoverability2100% (+25%)90% (+17%)
Effectiveness218% (+6%)57% (+17%)
Efficiency294% (+22%)86% (+14%)

Score values show skill-assisted performance. Values in parentheses show uplift versus the no-skill baseline when baseline data is available.

Tier 1: Static Validation Summary

Tier 1 validation passed with observations. NVSkills-Eval ran 1 checks and found 6 total findings.

Top findings:

  • MEDIUM SCHEMA/body_recommended_section: Missing recommended section: '## Examples' (skills/nv-generate-mr/SKILL.md)

  • LOW SCHEMA/unexpected_file: Unexpected 'validators' in skill root (skills/nv-generate-mr/validators)

  • LOW SCHEMA/unexpected_file: Unexpected 'skill_manifest.yaml' in skill root (skills/nv-generate-mr/skill_manifest.yaml)

  • LOW SCHEMA/unexpected_file: Unexpected 'fixtures' in skill root (skills/nv-generate-mr/fixtures)

  • LOW SCHEMA/unexpected_file: Unexpected 'tests' in skill root (skills/nv-generate-mr/tests)

Tier 2: Deduplication Summary

This tier was not run or did not produce findings in this report.

Publication Recommendation

The skill is suitable to proceed toward NVSkills-Eval publication based on this benchmark. Skill owners should keep this file with the skill and refresh it when the evaluation dataset, skill behavior, or target agents materially change.

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-mr · 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-mr.zip