{"slug":"dcmnorm","title":"dcmnorm","summary":"Read, inspect, edit, anonymize, convert, transcode, and render DICOM medical imaging files using the dcmnorm CLI, and send/receive/query them over a DICOM network using the dcmtalk CLI. Use this skill whenever the user mentions DICOM, .dcm files, medical images (CT/MR/US/DX/SR), ","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-11-21T17:57:04.580238Z","repo":{"url":"https://github.com/pohcee/dcmnorm","stars":14,"forks":0,"license":"Apache-2.0","updatedAt":"2026-11-21T17:53:10Z"},"bodyHtml":"<hr>\n<h2>name: dcmnorm\ndescription: Read, inspect, edit, anonymize, convert, transcode, and render DICOM medical imaging files using the dcmnorm CLI, and send/receive/query them over a DICOM network using the dcmtalk CLI. Use this skill whenever the user mentions DICOM, .dcm files, medical images (CT/MR/US/DX/SR), DICOM tags/metadata (PatientName, StudyInstanceUID, transfer syntax, SOP class), DICOM JSON, de-identifying/redacting medical images, wants to view/export DICOM pixel data as PNG/JPEG/MP4, or wants to talk to a PACS/DICOM node — connectivity checks (C-ECHO), sending files (C-STORE), querying (C-FIND), retrieving (C-MOVE), or receiving files (a storage SCP) — even if they don't name the dcmnorm or dcmtalk tools. Also use it to check whether files are valid DICOM or to batch-process directories of medical images.</h2>\n<h1>dcmnorm — DICOM read / edit / write / render CLI</h1>\n<p><code>dcmnorm</code> is a CLI that converts between DICOM and JSON, edits DICOM elements, transcodes transfer syntaxes, validates files, and renders pixel data to PNG/JPEG/raw/MPEG4. Make sure it's installed first (see <a href=\"#setup\">Setup</a>); run <code>dcmnorm --help</code> for the full option list.</p>\n<h2>Setup</h2>\n<p>This skill is written for <strong>dcmnorm 0.17.1</strong>. Before the first <code>dcmnorm</code> or <code>dcmtalk</code> command in a session, run <code>dcmnorm --version</code> (it prints e.g. <code>dcmnorm 0.7.2-&lt;build id&gt;</code>).</p>\n<ul>\n<li><strong>Found, version 0.17.1 or newer:</strong> go ahead.</li>\n<li><strong>Not found, or older:</strong> tell the user you're installing the dcmnorm command-line tools (native binaries from PyPI, nothing runs in Python), then install the pinned version with the first of these that's available:\n<pre><code>uv tool install --force dcmnorm==0.17.1\npipx install --force dcmnorm==0.17.1\npython3 -m pip install dcmnorm==0.17.1\n</code></pre>\nIf pip refuses with <code>externally-managed-environment</code>: on the user's own machine, install uv or pipx instead; in a disposable sandbox, add <code>--user --break-system-packages</code>.\nThis installs both <code>dcmnorm</code> and <code>dcmtalk</code>. Run <code>dcmnorm --version</code> again; if the command still isn't found, the installer's scripts directory isn't on <code>PATH</code> (uv/pipx print it; for pip it's <code>python3 -m site --user-base</code> plus <code>/bin</code>), so call the binary by its full path.</li>\n<li><strong>Install not possible</strong> (no network, no Python, a sandbox that blocks package downloads): say so plainly and point the user at the other install options at <a href=\"https://github.com/pohcee/dcmnorm#install\">https://github.com/pohcee/dcmnorm#install</a> (release archives, <code>.deb</code>, Docker). Don't substitute another DICOM tool without asking.</li>\n</ul>\n<p>Only the video transfer syntaxes (MPEG-2, MPEG-4 AVC/H.264, HEVC) and <code>.mp4</code>/<code>.mov</code> output also need the <code>ffmpeg</code> command. Check <code>ffmpeg -version</code> when a task needs one of those; if it's missing, dcmnorm fails with an install hint, so pass that on (<code>apt install ffmpeg</code>, <code>brew install ffmpeg</code>, <code>winget install ffmpeg</code>). <code>dcmnorm --list-transfer-syntaxes</code> shows what the installed build can decode and encode.</p>\n<p>For talking to a DICOM network peer (PACS, modality, another node) instead of local files, use the companion <code>dcmtalk</code> CLI — see <a href=\"#network-operations-with-dcmtalk\">Network operations with <code>dcmtalk</code></a> below.</p>\n<p>The core invocation is:</p>\n<pre><code>dcmnorm [OPTIONS] [INPUT] [OUTPUT]\n</code></pre>\n<p>The operation is <strong>inferred from the file extensions</strong> of INPUT and OUTPUT:</p>\n<table>\n<thead>\n<tr>\n<th>INPUT</th>\n<th>OUTPUT</th>\n<th>Operation</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>.dcm</code></td>\n<td><em>(none)</em></td>\n<td>Print DICOM as JSON to stdout</td>\n</tr>\n<tr>\n<td><code>.dcm</code></td>\n<td><code>.json</code></td>\n<td>DICOM → JSON file</td>\n</tr>\n<tr>\n<td><code>.json</code></td>\n<td><code>.dcm</code></td>\n<td>JSON → DICOM file</td>\n</tr>\n<tr>\n<td><code>.dcm</code></td>\n<td><code>.dcm</code></td>\n<td>DICOM → DICOM (edit / transcode)</td>\n</tr>\n<tr>\n<td><code>.dcm</code></td>\n<td><code>.png</code> / <code>.jpg</code> / <code>.raw</code></td>\n<td>Render a frame to an image</td>\n</tr>\n<tr>\n<td><code>.dcm</code></td>\n<td><code>.mp4</code> / <code>.mov</code></td>\n<td>Render frames to MPEG4 video</td>\n</tr>\n<tr>\n<td><code>.dcm</code> (+ <code>--mpr</code>)</td>\n<td><code>.png</code> / <code>.dcm</code> / <code>.nii(.gz)</code> / <code>.nrrd</code></td>\n<td>Multiplanar reformation — see <a href=\"#multiplanar-reformation-mpr\">MPR</a> below</td>\n</tr>\n<tr>\n<td><code>.dcm</code></td>\n<td><code>.gputex</code></td>\n<td>Lossless GPU texture export — see <a href=\"#gpu-texture-export-gputex\">GPU texture export</a> below</td>\n</tr>\n</tbody>\n</table>\n<p>When extensions are missing or misleading, override detection with <code>--input-type dicom|json</code> and <code>--output-type dicom|json|raw|png|jpeg|mpeg4|texture</code>.</p>\n<h2>Patient data</h2>\n<p>dcmnorm is a file and network toolkit, not a medical device: don't present its output as a basis for diagnosis or treatment. DICOM files usually carry protected health information (names, IDs, birth dates, accession numbers). Prefer synthetic or de-identified files, keep files on the user's machine, and don't repeat patient identifiers back in the conversation unless the user asks for them. De-identification with <code>--set</code> removes only what the edits name, so check the result (for example <code>dcmnorm out.dcm | grep -i -E 'name|id|birth'</code>) before anyone shares it. <code>dcmtalk</code> sends data to whatever DICOM node the user names, so confirm the destination before C-STORE or C-MOVE.</p>\n<h2>Reading / inspecting DICOM</h2>\n<p>Print the whole dataset as flat JSON to stdout (bulk data like PixelData becomes a <code>BulkDataURI</code> reference, so output stays small):</p>\n<pre><code>dcmnorm file.dcm\n</code></pre>\n<p>Read only specific elements — much faster on big files since only filtered elements are parsed. Keys are DICOM keywords or <code>GGGG,EEEE</code> tags, repeated or comma-separated:</p>\n<pre><code>dcmnorm --filter PatientName,Modality,StudyInstanceUID file.dcm\n# → {\"Modality\":\"CT\",\"PatientName\":\"Anonymized\",\"StudyInstanceUID\":\"1.2...\"}\n</code></pre>\n<p>JSON shape options (defaults: <code>--format flat --keys name</code>):</p>\n<ul>\n<li><code>--format standard</code> — PS3.18 DICOM JSON (<code>{\"00080060\":{\"vr\":\"CS\",\"Value\":[\"CT\"]}}</code>)</li>\n<li><code>--keys hex</code> — hex tags instead of keywords</li>\n<li><code>--bulk-data inline</code> — base64-embed binary values instead of URI references (large output; avoid unless a full self-contained JSON is required)</li>\n<li><code>--omit-keyword-vm</code> — with <code>--format standard</code>, leave out the non-standard <code>Keyword</code> and <code>VM</code> members (PS3.18 Annex F output)</li>\n</ul>\n<h3>Validating files</h3>\n<p><code>--check-dicom</code> prints the path if the file is valid DICOM and exits non-zero otherwise:</p>\n<pre><code>dcmnorm --check-dicom file.dcm\n</code></pre>\n<p>Batch mode — pipe paths via <code>-I</code> / <code>--stdin-paths</code>; only valid DICOM paths are printed (great for finding DICOM files without relying on extensions):</p>\n<pre><code>find /data -type f | dcmnorm -I --check-dicom\n</code></pre>\n<p><code>-I</code> also works for batch conversion/edit operations on many files.</p>\n<p><code>--check-dicom-logic</code> goes further: the file parses fine, but does its metadata actually make\nsense (bits/samples/photometric relationships, pixel data length, transfer-syntax-vs-actual-bytes,\nUID sanity, geometry)? Useful for catching a file that will fail or produce garbage output only\nonce you try to decompress/render/route it:</p>\n<pre><code>dcmnorm --check-dicom-logic --verbose file.dcm     # OK/WARN/FAIL + per-finding detail\ndcmnorm --check-dicom-logic --output-type json file.dcm   # structured report\nfind /data -type f | dcmnorm -I --check-dicom-logic        # batch, NDJSON with --output-type json\n</code></pre>\n<p>Errors (will plausibly break downstream decompress/render/routing) fail the exit code by default;\nwarnings (suspicious but usually survivable) only fail it with <code>--strict</code>.</p>\n<h2>Editing / updating DICOM</h2>\n<p>Set or remove elements (keywords or <code>GGGG,EEEE</code> tags, repeatable):</p>\n<pre><code>dcmnorm --set \"PatientName=DOE^JOHN\" --set \"PatientID=12345\" in.dcm out.dcm\ndcmnorm --remove PatientBirthDate --remove \"0010,1000\" in.dcm out.dcm\ndcmnorm --remove-private-tags in.dcm out.dcm   # strip all private tags\n</code></pre>\n<p>Edit in place with <code>--overwrite</code> (no OUTPUT argument):</p>\n<pre><code>dcmnorm --overwrite --set PatientName=ANON file.dcm\n</code></pre>\n<p>Editing flags combine freely with each other and with conversion/transcoding in one pass. A typical de-identification:</p>\n<pre><code>dcmnorm --set PatientName=ANON --set PatientID=ANON \\\n        --remove PatientBirthDate --remove-private-tags in.dcm out.dcm\n</code></pre>\n<h2>Writing DICOM from JSON</h2>\n<p>JSON (flat or standard format, auto-detected) converts back to DICOM:</p>\n<pre><code>dcmnorm dataset.json out.dcm\n</code></pre>\n<p>For a lossless DICOM → JSON → DICOM round trip, export with a bulk-data source so binary values (PixelData etc.) can be resolved on the way back:</p>\n<pre><code>dcmnorm in.dcm dataset.json --bulk-data-source   # embeds file:// URIs pointing at in.dcm\n# ...edit dataset.json...\ndcmnorm dataset.json out.dcm                     # URIs resolved automatically\n</code></pre>\n<p><strong>Gotcha:</strong> <code>--bulk-data-source</code> takes an <em>optional</em> value. If a positional path follows it, the flag swallows that path as its value. When using the no-value form, put the flag <strong>after</strong> INPUT/OUTPUT (as above). With a value (<code>--bulk-data-source /path/to/source.dcm</code>, used on JSON→DICOM to resolve relative URIs), position doesn't matter.</p>\n<h2>Transcoding transfer syntaxes</h2>\n<pre><code>dcmnorm --list-transfer-syntaxes                 # table of supported UIDs + decode/encode capability\ndcmnorm --transfer-syntax 1.2.840.10008.1.2.1 in.dcm out.dcm\n</code></pre>\n<p>Common targets: <code>1.2.840.10008.1.2.1</code> Explicit VR Little Endian (uncompressed, maximally compatible), <code>1.2.840.10008.1.2.4.90</code> JPEG 2000 lossless, <code>1.2.840.10008.1.2.4.201</code> HTJ2K lossless (faster to encode/decode, ~3.5% larger), <code>1.2.840.10008.1.2.4.50</code> JPEG baseline. Check the PIXEL_ENCODE column in the list before targeting a compressed syntax. <code>--jpeg2000-codec openjpeg|kakadu</code> forces a specific <em>classic</em> JPEG 2000 decoder if needed; HTJ2K always decodes with OpenHTJ2K.</p>\n<h2>Visualizing / rendering</h2>\n<p>Render to PNG or JPEG (modality LUT, VOI windowing, and ICC profile applied automatically):</p>\n<pre><code>dcmnorm file.dcm out.png\ndcmnorm --jpeg-quality 95 file.dcm out.jpg\n</code></pre>\n<p>Frame selection and video:</p>\n<pre><code>dcmnorm --render-frame 5 multi.dcm frame5.png    # zero-based index\ndcmnorm --render-all-frames multi.dcm frame.png  # writes frame_000001.png, frame_000002.png, ...\ndcmnorm --render-fps 30 cine.dcm loop.mp4        # fps defaults to DICOM metadata, else 24\n</code></pre>\n<p>Windowing and sizing:</p>\n<pre><code>dcmnorm --window-center 40 --window-width 400 ct.dcm soft-tissue.png\ndcmnorm --scale-max-size 512 file.dcm thumb.png            # longer side = 512, aspect preserved\ndcmnorm --output-width 256 file.dcm out.png                # height auto from aspect ratio\ndcmnorm --pad --pad-color '#000000' file.dcm square.png    # pad to square canvas\n</code></pre>\n<p><code>--no-voi-lut</code> / <code>--no-modality-lut</code> / <code>--no-icc-profile</code> disable those pipeline stages when raw-er values are wanted.</p>\n<p>Burn redaction boxes over the pixels (e.g. to mask burned-in PHI). Coordinates are in output pixels; negative X/Y anchor from right/bottom; W/H accept pixels or <code>%</code>; repeatable:</p>\n<pre><code>dcmnorm --redact-box 10,10,200,40 --redact-box -110,-60,100,50 \\\n        --redact-color '#000000' us.dcm redacted.png\n</code></pre>\n<h2>Multiplanar Reformation (MPR)</h2>\n<p><code>--mpr</code> combines multiple slice files from one parallel stack (e.g. a CT/MR/PT series) into a 3D volume — honoring real <code>ImagePositionPatient</code>/<code>ImageOrientationPatient</code>/spacing, not just stacking images — and reformats a plane or a whole stack of planes out of it. Give it every slice file as INPUT with the last path as OUTPUT (shell globs work as usual):</p>\n<pre><code>dcmnorm --mpr axial series_dir/*.dcm axial.png\ndcmnorm --mpr coronal series_dir/*.dcm coronal.png\ndcmnorm --mpr 15,30,0 series_dir/*.dcm oblique.png   # YAW,PITCH,ROLL degrees, oblique camera\n</code></pre>\n<p>Useful modifiers (all require <code>--mpr</code>): <code>--mpr-origin X,Y,Z</code> (mm, defaults to volume center), <code>--mpr-depth MM</code> (offset along the plane's own normal), <code>--mpr-spacing MM</code> (output pixel size), <code>--mpr-thickness MM</code> + <code>--mpr-projection mip|minip|average</code> (thick-slab projection instead of an infinitely-thin plane).</p>\n<p><code>--mpr-depth</code> also accepts a range (<code>START:END</code>, <code>START:END:STEP</code>, or <code>all</code>/<code>all:STEP</code>) to reformat a whole stack of slices instead of one plane — output extension decides the result shape: numbered PNGs, a proper multi-instance DICOM series (<code>.dcm</code>), or one whole-volume file (<code>.nii</code>/<code>.nii.gz</code>/<code>.nrrd</code>, float32 physical values, never 8-bit/windowed):</p>\n<pre><code>dcmnorm --mpr coronal --mpr-depth -40:40:2 series_dir/*.dcm coronal.dcm       # multi-instance DICOM series\ndcmnorm --mpr coronal --mpr-depth all --mpr-spacing 1 series_dir/*.dcm coronal.nii.gz\n</code></pre>\n<p>MPR mode is incompatible with <code>--filter</code>/<code>--transfer-syntax</code>/<code>--set</code>/<code>--remove</code>/<code>--render-all-frames</code>/<code>--render-fps</code>/<code>--scale-max-size</code>, and errors clearly (rather than silently mis-rendering) on an inconsistent/gantry-tilted stack.</p>\n<h2>GPU texture export (<code>.gputex</code>)</h2>\n<p><code>--output-type texture</code> (or a <code>.gputex</code> output extension) packs a frame or volume as a lossless, GPU-upload-ready payload — the raw <code>int16</code>/<code>uint16</code> sample lattice plus a <code>rescaleSlope</code>/<code>rescaleIntercept</code> pair for recovering physical values — instead of an 8-bit windowed render. Every export writes <code>OUTPUT</code> (payload bytes) plus <code>OUTPUT.json</code> (a metadata sidecar: dimensions, physical geometry, rescale slope/intercept, default window/level, compression):</p>\n<pre><code>dcmnorm frame.dcm frame.gputex                                       # single frame, depth-1 texture\ndcmnorm --mpr axial series_dir/*.dcm volume.gputex                   # whole series as one volume texture\ndcmnorm --mpr axial series_dir/*.dcm volume.gputex --texture-compression none  # skip gzip\n</code></pre>\n<p><code>--texture-max-dim &lt;N&gt;</code> caps the longest axis (proportional downsample), for both a single-frame export and a <code>--mpr</code> volume export. A frame-stack variant (independent frames packed as a texture array, e.g. a cine loop's frames or one file per series instance, no resampling/physical geometry) exists only via each binding's own <code>exportFrameStackTexture</code>/<code>export_frame_stack_texture</code> (Node, Python, Java) — no CLI flag for it yet.</p>\n<h2>Tips</h2>\n<ul>\n<li>After creating or editing a file, verify with <code>dcmnorm --check-dicom out.dcm</code> and spot-check tags with <code>--filter</code>.</li>\n<li>To view a DICOM image yourself (e.g. to answer \"what does this scan show?\" or verify a redaction), render it to PNG and read the image file.</li>\n<li>CT images often need explicit windowing to be readable: brain ≈ C40/W80, soft tissue ≈ C40/W400, lung ≈ C-600/W1500, bone ≈ C300/W1500.</li>\n<li><code>--verbose</code> prints conversion/rendering diagnostics when a command fails or produces unexpected output.</li>\n<li>Detection handles files missing the standard preamble/meta group; for files with wrong or missing extensions, force it with <code>--input-type dicom</code>.</li>\n</ul>\n<h2>Network operations with <code>dcmtalk</code></h2>\n<p><code>dcmtalk</code> is a CLI for DICOM network (DIMSE) operations — the same ground as dcmtk's <code>echoscu</code>/<code>storescu</code>/<code>findscu</code>/<code>movescu</code>/<code>storescp</code>. It's installed together with <code>dcmnorm</code> (see <a href=\"#setup\">Setup</a>); run <code>dcmtalk --help</code> or <code>dcmtalk &lt;subcommand&gt; --help</code> for the full option list. Every subcommand takes a peer address as <code>HOST:PORT</code> and accepts <code>-v</code>/<code>--verbose</code> to log association negotiation, presentation contexts, and each DIMSE command/response to stderr — reach for <code>--verbose</code> first whenever a connection to a real PACS behaves unexpectedly.</p>\n<p>Check connectivity to a peer (C-ECHO):</p>\n<pre><code>dcmtalk echoscu pacs.example.com:11112\n</code></pre>\n<p>Send DICOM file(s) or a whole directory (recursive) to a peer (C-STORE):</p>\n<pre><code>dcmtalk storescu pacs.example.com:11112 study.dcm\ndcmtalk storescu pacs.example.com:11112 ./study_dir/\n</code></pre>\n<p>Query a peer's studies (C-FIND) — keys are DICOM keywords, <code>KEY=VALUE</code> to match or bare <code>KEY</code> as a return key; matches print as one DICOM JSON line per study:</p>\n<pre><code>dcmtalk findscu pacs.example.com:11112 -k PatientID=12345 -k StudyDate\n</code></pre>\n<p>Ask a peer to push a study to another AE title it already knows (C-MOVE):</p>\n<pre><code>dcmtalk movescu pacs.example.com:11112 MY_STORE_AE 1.2.840.113619.2.55.3.604688119.971.1600000000.123\n</code></pre>\n<p>Retrieve one series (<code>--level SERIES --series-uid &lt;UID&gt;</code>) or specific instances (<code>--level IMAGE --series-uid &lt;UID&gt; --sop-uid &lt;UID&gt; [--sop-uid &lt;UID&gt; ...]</code>) of that study instead of the whole thing.</p>\n<p>Run a temporary receiver to capture what a peer sends (a storescp), e.g. to inspect what a modality/PACS is actually transmitting — instances land under <code>--cache-path</code> as <code>S_&lt;StudyInstanceUID&gt;/&lt;Modality&gt;_&lt;SOPInstanceUID&gt;.dcm</code>, ready for <code>dcmnorm</code> to inspect:</p>\n<pre><code>dcmtalk storescp 11112 --ae-title MY_STORE_AE --cache-path ./received --verbose\n</code></pre>\n<p><code>dcmtalk storescp</code> is receive-only: it answers C-FIND/C-MOVE requests with \"unable to process\" rather than serving a real query index or retrieve queue.</p>\n<p>Most <code>dcmtalk</code> peers require the calling/called AE titles to match what they've been configured to accept — set them with <code>-a</code>/<code>--calling-aet</code> and <code>-c</code>/<code>--called-aet</code> if the default calling AE title (<code>DCMTALK</code>) or an unset called AE title gets an association rejected.</p>\n","files":[{"path":"SKILL.md","sizeBytes":16424,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-11-21T17:58:17.815929Z","sha256":"C11ECA6813AA327AFBB3B8B443DF26D693A625C1CB7752F199B34E67466737E0","sizeBytes":7140},"review":null,"source":{"repositoryUrl":"https://github.com/pohcee/dcmnorm","path":"plugin/skills/dcmnorm","license":"Apache-2.0","commit":"9a68e9c552de4a3fda4c3fd429e1e95d02ea7f35","subtreeSha":"1DAD67D1C252BB008BE13FA6EACA912EE38AD55D689F9BD423B2689818543749","lastSyncedAt":"2026-11-21T17:57:04.573745Z"},"reviewedAt":"2026-11-21T18:01:40.79051Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/pohcee/dcmnorm/tree/main/plugin/skills/dcmnorm"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install pohcee-dcmnorm@llmmart"},{"target":"git","command":"git clone https://github.com/pohcee/dcmnorm.git"}]}