Generated banner for Dicom Metadata Extract
Generated logo for Dicom Metadata Extract

Dicom Metadata Extract

NVIDIAOfficialCreated by NVIDIA MedTech Team

  • Skill
  • Tool integration
  • Science and research
  • Apache-2.0
  • Medium risk
  • Has scripts

From the author

Used for extracting selected metadata from one DICOM file and flagging standard-tag PHI presence. Not for anonymization or clinical use.
— the description by NVIDIA MedTech Team

AutoGineer summary

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

The dicom-metadata-extract skill provides a programmatic interface for reading DICOM files to retrieve core metadata and identify the presence of Protected Health Information (PHI) based on a subset of standard tags. It is designed for technical evaluation and data processing workflows rather than clinical or regulatory use. The skill outputs structured JSON containing modality, transfer syntax, and grouped study information, while explicitly warning against its use for anonymization or clinical decision-making.

What it does

  • Extracts study, series, and image metadata from a single DICOM file.
  • Flags the presence of PHI based on standard DICOM tags.
  • Outputs metadata in a structured JSON format.
  • Provides a command-line interface for integration into automated pipelines.
  • Supports validation of output quality through dedicated verification tools.

When to use it

  • When you need to inspect DICOM file headers for technical metadata.
  • When performing initial data screening to identify standard PHI tags.
  • When building automated data processing pipelines for medical imaging research.
  • When verifying the structure of DICOM files during development or testing.

Advantages

  • Provides a lightweight and standardized way to access DICOM metadata.
  • Includes built-in PHI flagging for common standard tags.
  • Integrates easily with existing Python-based medical imaging workflows.
  • Supports trusted execution patterns for evidence-based review.

Usage examples

“Extract metadata from the file scan_01.dcm and save it to output.json.”
The agent runs the extraction script on the specified file and generates a JSON file containing the extracted metadata and PHI flags.
“Check if the DICOM file at /data/ct_scan.dcm contains any standard PHI tags.”
The agent processes the file and returns a report indicating whether PHI was detected and which specific tags were identified.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/nvidia/dicom-metadata-extract/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip dicom-metadata-extract.zip -d .agents/skills

Documentation by NVIDIA MedTech Team

DICOM Metadata Extract

Purpose

  • Used for extracting selected metadata from one DICOM file and flagging standard-tag PHI presence. Not for anonymization or clinical use.

  • Use the wrapper exactly as documented; do not replace the upstream entrypoint with a handwritten implementation.

  • Manifest I/O: inputs are dicom_path; outputs are metadata_json.

Instructions

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

  • Run scripts/extract_metadata.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/extract_metadata.py", args=[...]); otherwise run the Bash/Python command shown below.

  • Check the emitted JSON and run medagent.verifiers.dicom_metadata_quality_v1 on evidence packs before treating the run as reviewed evidence.

Available Scripts

ScriptPurposeArguments
scripts/extract_metadata.pyPrimary entrypoint declared by skill_manifest.yaml.PATH_TO_DICOM [--output OUT.json]

Prerequisites

  • Runtime requirements: Python packages listed in runtime.side_effects.pip_packages.

  • Run commands from the repository root unless an existing section below says otherwise.

Limitations

  • Small PS3.15-inspired standard-tag subset only; not a complete Basic Application Confidentiality Profile implementation.

  • Private tags not checked

  • Burnt-in pixel PHI not detected

  • Multi-frame handling minimal

  • Not for clinical deployment, regulatory de-identification, autonomous diagnosis, patient-facing use.

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.

Reads one DICOM file with pydicom and emits JSON on stdout.

python scripts/extract_metadata.py PATH_TO_DICOM
python scripts/extract_metadata.py PATH_TO_DICOM --output result.json

Output includes transfer_syntax, modality, grouped study/series/image metadata, phi_present, and phi_tags_found.

Use this as the smallest end-to-end example of a Medical AI Skills skill. Do not use it for anonymization, private-tag review, pixel PHI detection, or clinical interpretation.

For second-pass evidence review, generate a trusted run:

python -m eval_engine.run_trusted skills/dicom-metadata-extract \
  --fixture skills/dicom-metadata-extract/fixtures/sample_ct.dcm \
  --out runs/dicom_metadata_trusted

Files

skill_manifest.yaml

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

id: medagent.dicom_metadata_extract
version: 0.1.0
upstream_refs:
  - kind: pypi_package
    name: pydicom
    version_constraint: ">=2.4.5,<4,!=3.0.0,!=3.0.1"
license: Apache-2.0
intended_use:
  summary: Engineering-time DICOM metadata extraction with a PHI-tag-presence flag.
  scope: development
  not_for:
    - clinical deployment
    - regulatory de-identification
    - autonomous diagnosis
    - patient-facing use
inputs:
  - name: dicom_path
    type: file_path
    formats: [dicom]
    max_size_bytes: 104857600
outputs:
  - name: metadata_json
    type: json
    schema: validators/output_schema.json
runtime:
  language: python
  entrypoint: scripts/extract_metadata.py
  python: ">=3.10"
  args:
    - "${python}"
    - "${script}"
    - "${fixture}"
  dependencies:
    pydicom: ">=2.4.5,<4,!=3.0.0,!=3.0.1"
    typer: ">=0.9"
  test_dependencies:
    jsonschema: ">=4.0"
  side_effects:
    pip_packages: ["pydicom>=2.4.5,<4,!=3.0.0,!=3.0.1", "typer>=0.9"]
    local_writes:
      - {path: "<caller-provided --output>", approx_mb_max: 1, optional: true}
    home_writes: []
    network_endpoints: []
    requires_docker: false
    requires_gpu: none
    env_required: []

cost:
  # Per-invocation agent-overhead token cost measured by NeMo Agent Toolkit
  # (NAT) profiler — the cost an LLM-driven agent pays to call this skill
  # once. The skill itself emits zero tokens. See tools/nat_audit/README.md
  # for methodology (pinned model, agent type, tool registry size).
  token_estimate:
    common:
      model: meta/llama-3.3-70b-instruct
      agent_type: tool_calling_agent
      measured_at: 2026-05-16
      methodology: tools/nat_audit/README.md
    isolated_tool_call:
      prompt_tokens: 2250
      completion_tokens: 40
      total_tokens: 2290
      llm_calls: 2
      n_tools_in_workflow: 9
    end_to_end_workflow:
      prompt_tokens: 4810
      completion_tokens: 83
      total_tokens: 4893
      llm_calls: 3
      n_tools_in_workflow: 11
      scenario: realistic_user_workflow

paired_verifiers:
  - id: medagent.verifiers.dicom_metadata_quality_v1
    status: implemented
    consumes: evidence_pack_dir
    purpose: >
      Second-pass metadata evidence audit. Confirms the source pack passed,
      required header facts are present, PHI flag and tag-list semantics are
      consistent, and the limited PHI scope is disclosed. Standard PHI tag
      presence is warning-only because this skill does not de-identify data.

limitations:
  - Small PS3.15-inspired standard-tag subset only; not a complete Basic
    Application Confidentiality Profile implementation.
  - Private tags not checked
  - Burnt-in pixel PHI not detected
  - Multi-frame handling minimal
phi_scope_disclaimer: >
  This skill flags PHI presence in a small standard DICOM tag subset only.
  It is NOT a de-identifier and does NOT remove or modify data. Private
  tags and burnt-in pixel text are out of scope.
validation:
  expected_runtime_seconds:
    max: 5.0
  sanity_checks:
    # The extractor must always populate Modality and the PHI-presence
    # flag from a readable DICOM. matches: ".+" requires non-empty.
    - {path: modality, matches: ".+"}
    - {path: phi_present, exists: true}
    - {path: phi_scope_disclaimer, matches: "Standard DICOM"}
    - {path: study.StudyInstanceUID, matches: ".+"}
    - {path: image.Rows, gt: 0}
    - {path: image.Columns, gt: 0}
  expected_cost:
    # Pydicom header read on a single CT slice is essentially I/O bound.
    # Bounds are intentionally generous — the canonical silent-failure
    # detector here is the runtime envelope, not cost. cpu_seconds.max is
    # a soft fence for "interpreter spun up but did real work".
    wall_seconds:        {max: 5}
    cpu_seconds:         {max: 5}
    rss_mb_peak:         {max: 250}
    gpu_seconds:         {max: 0}
    gpu_memory_mb_peak:  {max: 0}
  env_pin:
    # PEP 440 constraints on upstream tools whose behaviour this skill
    # depends on. The eval_engine's env_pin gate fails the run if any
    # installed version drifts outside these bounds — catches what the
    # loose `runtime.dependencies` ranges silently allow (e.g. a pydicom
    # 3 → 4 bump that changes the save_as API).
    pydicom: ">=2.4.5,<4,!=3.0.0,!=3.0.1"
  reproducibility:
    mode: repeat
    fixture: fixtures/sample_ct.dcm
    fixture_builder: fixtures/generate_sample.py
    runs: 2

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 Python

Security

What our scanner noticed· Medium risk

  • Large base64-encoded blobs
  • 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/dicom-metadata-extract · 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 dicom-metadata-extract.zip