[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-aws-labs-dicom-processing":3,"mdc--b0nki0-key":50,"related-repo-aws-labs-dicom-processing":2044,"related-org-aws-labs-dicom-processing":2144},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":12,"stars":26,"repoUrl":27,"updatedAt":28,"license":29,"forks":30,"topics":31,"repo":45,"sourceUrl":48,"mdContent":49},"dicom-processing","process medical images with DICOM pipelines","DICOM and NIfTI medical image processing pipeline. Triggers on DICOM, NIfTI, dcm2niix, de-identification, pydicom, DICOM header, conversion, anonymization, BIDS, DICOM tags, medical image format conversion, \"DICOM to NIfTI\", \"burned-in PHI\", \"SeriesInstanceUID\", \"nibabel\", \"DICOM anonymization\".",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},"aws-labs","AWS Labs","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Faws-labs.png","awslabs",[13,17,20,23],{"name":14,"slug":15,"type":16},"Healthcare","healthcare","tag",{"name":18,"slug":19,"type":16},"Data Pipeline","data-pipeline",{"name":21,"slug":22,"type":16},"Imaging","imaging",{"name":24,"slug":25,"type":16},"AWS","aws",4,"https:\u002F\u002Fgithub.com\u002Fawslabs\u002Fhcls-agent-skills","2026-07-12T08:37:32.100909",null,0,[32,33,34,35,36,37,38,39,40,41,42,43,44],"agent-skills","agentcore","ai-agents","amazon-quick-desktop","claims-processing","drug-discovery","genomics","healthcare-ai","kiro","life-sciences","medical-imaging","risk-adjustment","strands-agents",{"repoUrl":27,"stars":26,"forks":30,"topics":46,"description":47},[32,33,34,35,36,37,38,39,40,41,42,43,44],"Agent skills for healthcare and life sciences: genomics, imaging, claims, drug discovery, and more. Works with Amazon Quick, Kiro, Amazon AgentCore, AWS Strands SDK, Claude Code, Codex, and any Agent Skills-compatible platform.","https:\u002F\u002Fgithub.com\u002Fawslabs\u002Fhcls-agent-skills\u002Ftree\u002FHEAD\u002Fskills\u002Fdicom-processing","---\nname: dicom-processing\ndescription: DICOM and NIfTI medical image processing pipeline. Triggers on DICOM, NIfTI, dcm2niix, de-identification, pydicom, DICOM header, conversion, anonymization, BIDS, DICOM tags, medical image format conversion, \"DICOM to NIfTI\", \"burned-in PHI\", \"SeriesInstanceUID\", \"nibabel\", \"DICOM anonymization\".\nusage: Invoke when converting, parsing, or de-identifying DICOM\u002FNIfTI medical images, or organizing data into BIDS format.\nversion: 1.0.0\nvalidated_against:\n  date: 2025-01-15\n  packages: {pydicom: \"2.4\", dcm2niix: \"1.0.20240202\", nibabel: \"5.2\"}\ntags: [skill, category:pipeline, medical-imaging, dicom, nifti, de-identification, hcls]\n---\n\n# DICOM Processing\n\n## Overview\n\nPipeline skill for converting, reading, and de-identifying medical images in DICOM and NIfTI formats. Encodes deterministic commands and code for:\n\n- DICOM → NIfTI conversion with `dcm2niix` (including BIDS sidecars)\n- Reading DICOM headers and pixel data with `pydicom`\n- PHI removal (de-identification) with `pydicom` or CTP DicomAnonymizer\n- NIfTI inspection with `nibabel`\n- Batch processing grouped by `SeriesInstanceUID`\n- BIDS-compliant directory organization\n\nUse this skill whenever the user works with `.dcm`, `.nii`, `.nii.gz`, DICOM directories, or anonymization workflows.\n\n## Usage\n\n### 1. Convert a DICOM series to NIfTI (dcm2niix)\n\n```bash\n# Standard conversion: gzip output, BIDS sidecar, pattern-named files\ndcm2niix -z y -b y -f %p_%s -o output_dir input_dir\n```\n\nFlags (memorize):\n\n| Flag | Meaning |\n| --- | --- |\n| `-z y` | gzip output (`.nii.gz`) |\n| `-b y` | emit BIDS JSON sidecar |\n| `-f %p_%s` | filename pattern: `%p` = protocol, `%s` = series number |\n| `-m n` | do NOT merge 2D slices across series (prevents cross-series mixing) |\n| `-o` | output directory |\n\nCommon naming tokens: `%p` protocol, `%s` series, `%t` time, `%i` patient ID, `%n` patient name, `%d` description.\n\n### 2. Read a DICOM file with pydicom\n\n```python\nimport pydicom\n\nds = pydicom.dcmread('file.dcm')\nprint(ds.PatientName, ds.StudyDate, ds.Modality)\nprint(ds.pixel_array.shape)  # numpy array of pixel data\n```\n\n### 3. De-identify a DICOM file (pydicom)\n\n```python\nimport pydicom\nfrom pydicom.uid import generate_uid\n\nds = pydicom.dcmread('file.dcm')\n\ntags_to_remove = [\n    'PatientName', 'PatientID', 'PatientBirthDate',\n    'InstitutionName', 'ReferringPhysicianName', 'StudyDate',\n]\nfor tag in tags_to_remove:\n    if tag in ds:\n        del ds[tag]\n\nds.PatientID = 'ANON_001'\n\n# Remove private (vendor) tags — they frequently contain PHI\nds.remove_private_tags()\n\n# Replace UIDs so the study\u002Fseries\u002Finstance cannot be linked back\nds.StudyInstanceUID  = generate_uid()\nds.SeriesInstanceUID = generate_uid()\nds.SOPInstanceUID    = generate_uid()\n\nds.save_as('anon.dcm')\n```\n\n### 4. Batch de-identification with CTP DicomAnonymizer\n\n```bash\n# RSNA CTP \u002F DicomBrowser DAP (DICOM Anonymizer Program)\njava -jar DAP.jar -p profile.script -i input\u002F -o output\u002F\n```\n\nUse this for large cohorts or when a validated DICOM Supplement 142 profile is required.\n\n### 5. Load a NIfTI volume with nibabel\n\n```python\nimport nibabel as nib\n\nimg = nib.load('file.nii.gz')\ndata   = img.get_fdata()  # numpy ndarray\naffine = img.affine       # 4x4 voxel-to-world transform\nheader = img.header\n```\n\n### 6. Batch pattern: group by SeriesInstanceUID, convert per series\n\n```python\nfrom pathlib import Path\nfrom collections import defaultdict\nimport pydicom, subprocess\n\ndef group_by_series(input_dir):\n    series = defaultdict(list)\n    for p in Path(input_dir).rglob('*.dcm'):\n        ds = pydicom.dcmread(p, stop_before_pixels=True)\n        series[ds.SeriesInstanceUID].append(p)\n    return series\n\ndef convert_all(input_dir, output_dir):\n    Path(output_dir).mkdir(parents=True, exist_ok=True)\n    # dcm2niix handles series grouping internally when given a directory\n    subprocess.run(\n        ['dcm2niix', '-z', 'y', '-b', 'y', '-f', '%p_%s',\n         '-o', output_dir, input_dir],\n        check=True,\n    )\n```\n\n### 7. BIDS organization\n\n```\ndataset\u002F\n├── dataset_description.json\n├── participants.tsv\n└── sub-01\u002F\n    └── ses-01\u002F\n        ├── anat\u002F  sub-01_ses-01_T1w.nii.gz\n        ├── func\u002F  sub-01_ses-01_task-rest_bold.nii.gz\n        └── dwi\u002F   sub-01_ses-01_dwi.nii.gz\n```\n\nRule: `sub-\u003Clabel>\u002Fses-\u003Clabel>\u002F\u003Cmodality>\u002F\u003Csub>_\u003Cses>_\u003Csuffix>.nii.gz`, with a matching `.json` sidecar.\n\n\n## Response Format\n\n- Lead with the command or code the user needs — explain after\n- Structure as: confirm inputs → working code → key parameters explained → gotchas\n- One complete working example per task; do not show every alternative\n- Keep code comments minimal and functional (what, not why-it-exists)\n- Target: 50-100 lines of code with brief surrounding explanation\n\n## Core Concepts\n\n### Format and De-identification Decision Tree\n\n```\nWhat is the target format?\n├─ NIfTI (analysis) → dcm2niix -z y -b y\n│  ├─ Need BIDS layout? → add -f sub-%i_ses-%t_%p, reorganize post-hoc\n│  └─ Single series only? → point dcm2niix at series directory directly\n└─ DICOM (archive\u002FPACS) → pydicom read\u002Fwrite\n\nDe-identification method:\n├─ Small cohort (\u003C 100 studies) → pydicom script (remove tags + private + replace UIDs)\n├─ Large cohort or regulatory → CTP DicomAnonymizer with Supplement 142 profile\n└─ Burned-in pixel PHI risk?\n   ├─ US \u002F Secondary Capture \u002F Screenshots → YES: add OCR + pixel masking step\n   └─ CT \u002F MR \u002F PT → Usually NO: tag-level de-ID sufficient\n```\n\n**DICOM hierarchy.** `Patient → Study → Series → Instance`. A \"series\" is the atomic unit for conversion — one NIfTI volume typically corresponds to one `SeriesInstanceUID`.\n\n**UIDs are identifiers, not secrets, but they are *linkable*.** Two files sharing a `StudyInstanceUID` came from the same exam. De-identification must replace UIDs (`generate_uid()`) to break linkage across releases.\n\n**Private tags carry PHI.** Vendor-specific tags (odd group numbers) often embed operator notes, patient IDs, or burned-in metadata. Always call `ds.remove_private_tags()`.\n\n**Pixel data can contain PHI too.** Ultrasound frames, secondary captures, and screenshots frequently have burned-in patient name\u002FMRN in the pixels. Tag removal does *not* scrub pixels — run OCR + masking separately when this risk applies.\n\n**Key DICOM tags for geometry and modality:**\n\n| Tag | Name | Purpose |\n| --- | --- | --- |\n| `(0008,0060)` | Modality | CT \u002F MR \u002F CR \u002F US \u002F PT ... |\n| `(0018,0050)` | SliceThickness | mm |\n| `(0028,0030)` | PixelSpacing | in-plane spacing `[row, col]` mm |\n| `(0020,0032)` | ImagePositionPatient | origin of slice in patient coords |\n| `(0020,0037)` | ImageOrientationPatient | row\u002Fcol direction cosines |\n\nThese five tags are sufficient to reconstruct the NIfTI `affine` matrix.\n\n**NIfTI vs DICOM.** NIfTI stores a single 3D\u002F4D volume with one affine; DICOM stores slice-level metadata. Converters (`dcm2niix`) aggregate slices of a series and compute the affine from the tags above.\n\n## Quick Reference\n\n```bash\n# Convert\ndcm2niix -z y -b y -f %p_%s -o out\u002F in\u002F\n\n# Skip merging across series (safer)\ndcm2niix -z y -b y -m n -f %p_%s -o out\u002F in\u002F\n\n# Batch anonymization (CTP)\njava -jar DAP.jar -p profile.script -i input\u002F -o output\u002F\n```\n\n```python\n# Read DICOM\nds = pydicom.dcmread('file.dcm')\nds.PatientName, ds.Modality, ds.pixel_array.shape\n\n# Header-only (fast, no pixels)\nds = pydicom.dcmread('file.dcm', stop_before_pixels=True)\n\n# Anonymize core fields\nfor t in ['PatientName','PatientID','PatientBirthDate',\n          'InstitutionName','ReferringPhysicianName','StudyDate']:\n    if t in ds: del ds[t]\nds.remove_private_tags()\nds.StudyInstanceUID  = generate_uid()\nds.SeriesInstanceUID = generate_uid()\nds.SOPInstanceUID    = generate_uid()\n\n# Load NIfTI\nimg = nib.load('file.nii.gz'); data = img.get_fdata(); aff = img.affine\n```\n\n## Common Mistakes\n\n- **Wrong:** Not removing private tags during DICOM de-identification\n  **Right:** Always call `ds.remove_private_tags()` as part of the de-identification pipeline\n  **Why:** Vendor private tags (odd group numbers) routinely contain PHI that survives standard tag-level scrubbing\n\n- **Wrong:** Keeping original UIDs after anonymization\n  **Right:** Replace `StudyInstanceUID`, `SeriesInstanceUID`, and `SOPInstanceUID` with `generate_uid()` for every de-identified file\n  **Why:** Original UIDs are linkable back to the source PACS — two files sharing a StudyInstanceUID reveal they came from the same exam\n\n- **Wrong:** Using default dcm2niix merge behavior without verification\n  **Right:** Use `-m n` to disable merging, or inspect output file counts against the expected series list\n  **Why:** Default merging can combine distinct acquisitions into one NIfTI volume, corrupting the data\n\n- **Wrong:** Ignoring burned-in annotations in pixel data during de-identification\n  **Right:** Add an OCR detection and pixel masking step for ultrasound, secondary capture, and screenshot modalities\n  **Why:** Tag-level de-identification does not scrub pixels — patient name\u002FMRN burned into the image persists after tag removal\n\n- **Wrong:** Outputting uncompressed `.nii` files from dcm2niix\n  **Right:** Always pass `-z y` to dcm2niix for gzipped `.nii.gz` output unless downstream tools explicitly require uncompressed\n  **Why:** Uncompressed NIfTI files are 3-5× larger, wasting storage and slowing transfers with no benefit for most pipelines\n\n- **Wrong:** Reading full pixel data when only DICOM headers are needed\n  **Right:** Use `pydicom.dcmread(path, stop_before_pixels=True)` for metadata-only scans\n  **Why:** Loading pixel arrays for large cohorts wastes memory and time when only tags like Modality, SeriesInstanceUID, or SliceThickness are needed\n\n- **Wrong:** Treating DICOMDIR as a file directory and iterating its entries\n  **Right:** Iterate actual `.dcm` files using `Path(input_dir).rglob('*.dcm')` instead\n  **Why:** DICOMDIR is an index file with its own structure — it may be incomplete, outdated, or absent; direct file iteration is more reliable\n\n## References\n\n- dcm2niix: Li et al. J Neurosci Methods 2016, https:\u002F\u002Fdoi.org\u002F10.1016\u002Fj.jneumeth.2016.03.001\n- pydicom: https:\u002F\u002Fpydicom.github.io\u002Fpydicom\u002Fstable\u002F\n- BIDS: Gorgolewski et al. Sci Data 2016, https:\u002F\u002Fdoi.org\u002F10.1038\u002Fsdata.2016.44\n- DICOM de-identification: DICOM PS3.15 Annex E, https:\u002F\u002Fdicom.nema.org\u002Fmedical\u002Fdicom\u002Fcurrent\u002Foutput\u002Fchtml\u002Fpart15\u002Fchapter_E.html\n",{"data":51,"body":67},{"name":4,"description":6,"usage":52,"version":53,"validated_against":54,"tags":60},"Invoke when converting, parsing, or de-identifying DICOM\u002FNIfTI medical images, or organizing data into BIDS format.","1.0.0",{"date":55,"packages":56},"2025-01-15",{"pydicom":57,"dcm2niix":58,"nibabel":59},"2.4","1.0.20240202","5.2",[61,62,42,63,64,65,66],"skill","category:pipeline","dicom","nifti","de-identification","hcls",{"type":68,"children":69},"root",[70,78,85,91,160,188,194,201,278,283,419,470,476,528,534,744,750,812,817,823,877,883,1040,1046,1056,1077,1083,1111,1117,1123,1132,1158,1191,1208,1225,1233,1378,1391,1408,1414,1596,1739,1745,1983,1989,2038],{"type":71,"tag":72,"props":73,"children":74},"element","h1",{"id":4},[75],{"type":76,"value":77},"text","DICOM Processing",{"type":71,"tag":79,"props":80,"children":82},"h2",{"id":81},"overview",[83],{"type":76,"value":84},"Overview",{"type":71,"tag":86,"props":87,"children":88},"p",{},[89],{"type":76,"value":90},"Pipeline skill for converting, reading, and de-identifying medical images in DICOM and NIfTI formats. Encodes deterministic commands and code for:",{"type":71,"tag":92,"props":93,"children":94},"ul",{},[95,110,121,133,144,155],{"type":71,"tag":96,"props":97,"children":98},"li",{},[99,101,108],{"type":76,"value":100},"DICOM → NIfTI conversion with ",{"type":71,"tag":102,"props":103,"children":105},"code",{"className":104},[],[106],{"type":76,"value":107},"dcm2niix",{"type":76,"value":109}," (including BIDS sidecars)",{"type":71,"tag":96,"props":111,"children":112},{},[113,115],{"type":76,"value":114},"Reading DICOM headers and pixel data with ",{"type":71,"tag":102,"props":116,"children":118},{"className":117},[],[119],{"type":76,"value":120},"pydicom",{"type":71,"tag":96,"props":122,"children":123},{},[124,126,131],{"type":76,"value":125},"PHI removal (de-identification) with ",{"type":71,"tag":102,"props":127,"children":129},{"className":128},[],[130],{"type":76,"value":120},{"type":76,"value":132}," or CTP DicomAnonymizer",{"type":71,"tag":96,"props":134,"children":135},{},[136,138],{"type":76,"value":137},"NIfTI inspection with ",{"type":71,"tag":102,"props":139,"children":141},{"className":140},[],[142],{"type":76,"value":143},"nibabel",{"type":71,"tag":96,"props":145,"children":146},{},[147,149],{"type":76,"value":148},"Batch processing grouped by ",{"type":71,"tag":102,"props":150,"children":152},{"className":151},[],[153],{"type":76,"value":154},"SeriesInstanceUID",{"type":71,"tag":96,"props":156,"children":157},{},[158],{"type":76,"value":159},"BIDS-compliant directory organization",{"type":71,"tag":86,"props":161,"children":162},{},[163,165,171,173,179,180,186],{"type":76,"value":164},"Use this skill whenever the user works with ",{"type":71,"tag":102,"props":166,"children":168},{"className":167},[],[169],{"type":76,"value":170},".dcm",{"type":76,"value":172},", ",{"type":71,"tag":102,"props":174,"children":176},{"className":175},[],[177],{"type":76,"value":178},".nii",{"type":76,"value":172},{"type":71,"tag":102,"props":181,"children":183},{"className":182},[],[184],{"type":76,"value":185},".nii.gz",{"type":76,"value":187},", DICOM directories, or anonymization workflows.",{"type":71,"tag":79,"props":189,"children":191},{"id":190},"usage",[192],{"type":76,"value":193},"Usage",{"type":71,"tag":195,"props":196,"children":198},"h3",{"id":197},"_1-convert-a-dicom-series-to-nifti-dcm2niix",[199],{"type":76,"value":200},"1. Convert a DICOM series to NIfTI (dcm2niix)",{"type":71,"tag":202,"props":203,"children":208},"pre",{"className":204,"code":205,"language":206,"meta":207,"style":207},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# Standard conversion: gzip output, BIDS sidecar, pattern-named files\ndcm2niix -z y -b y -f %p_%s -o output_dir input_dir\n","bash","",[209],{"type":71,"tag":102,"props":210,"children":211},{"__ignoreMap":207},[212,224],{"type":71,"tag":213,"props":214,"children":217},"span",{"class":215,"line":216},"line",1,[218],{"type":71,"tag":213,"props":219,"children":221},{"style":220},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[222],{"type":76,"value":223},"# Standard conversion: gzip output, BIDS sidecar, pattern-named files\n",{"type":71,"tag":213,"props":225,"children":227},{"class":215,"line":226},2,[228,233,239,244,249,253,258,263,268,273],{"type":71,"tag":213,"props":229,"children":231},{"style":230},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[232],{"type":76,"value":107},{"type":71,"tag":213,"props":234,"children":236},{"style":235},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[237],{"type":76,"value":238}," -z",{"type":71,"tag":213,"props":240,"children":241},{"style":235},[242],{"type":76,"value":243}," y",{"type":71,"tag":213,"props":245,"children":246},{"style":235},[247],{"type":76,"value":248}," -b",{"type":71,"tag":213,"props":250,"children":251},{"style":235},[252],{"type":76,"value":243},{"type":71,"tag":213,"props":254,"children":255},{"style":235},[256],{"type":76,"value":257}," -f",{"type":71,"tag":213,"props":259,"children":260},{"style":235},[261],{"type":76,"value":262}," %p_%s",{"type":71,"tag":213,"props":264,"children":265},{"style":235},[266],{"type":76,"value":267}," -o",{"type":71,"tag":213,"props":269,"children":270},{"style":235},[271],{"type":76,"value":272}," output_dir",{"type":71,"tag":213,"props":274,"children":275},{"style":235},[276],{"type":76,"value":277}," input_dir\n",{"type":71,"tag":86,"props":279,"children":280},{},[281],{"type":76,"value":282},"Flags (memorize):",{"type":71,"tag":284,"props":285,"children":286},"table",{},[287,306],{"type":71,"tag":288,"props":289,"children":290},"thead",{},[291],{"type":71,"tag":292,"props":293,"children":294},"tr",{},[295,301],{"type":71,"tag":296,"props":297,"children":298},"th",{},[299],{"type":76,"value":300},"Flag",{"type":71,"tag":296,"props":302,"children":303},{},[304],{"type":76,"value":305},"Meaning",{"type":71,"tag":307,"props":308,"children":309},"tbody",{},[310,335,352,385,402],{"type":71,"tag":292,"props":311,"children":312},{},[313,323],{"type":71,"tag":314,"props":315,"children":316},"td",{},[317],{"type":71,"tag":102,"props":318,"children":320},{"className":319},[],[321],{"type":76,"value":322},"-z y",{"type":71,"tag":314,"props":324,"children":325},{},[326,328,333],{"type":76,"value":327},"gzip output (",{"type":71,"tag":102,"props":329,"children":331},{"className":330},[],[332],{"type":76,"value":185},{"type":76,"value":334},")",{"type":71,"tag":292,"props":336,"children":337},{},[338,347],{"type":71,"tag":314,"props":339,"children":340},{},[341],{"type":71,"tag":102,"props":342,"children":344},{"className":343},[],[345],{"type":76,"value":346},"-b y",{"type":71,"tag":314,"props":348,"children":349},{},[350],{"type":76,"value":351},"emit BIDS JSON sidecar",{"type":71,"tag":292,"props":353,"children":354},{},[355,364],{"type":71,"tag":314,"props":356,"children":357},{},[358],{"type":71,"tag":102,"props":359,"children":361},{"className":360},[],[362],{"type":76,"value":363},"-f %p_%s",{"type":71,"tag":314,"props":365,"children":366},{},[367,369,375,377,383],{"type":76,"value":368},"filename pattern: ",{"type":71,"tag":102,"props":370,"children":372},{"className":371},[],[373],{"type":76,"value":374},"%p",{"type":76,"value":376}," = protocol, ",{"type":71,"tag":102,"props":378,"children":380},{"className":379},[],[381],{"type":76,"value":382},"%s",{"type":76,"value":384}," = series number",{"type":71,"tag":292,"props":386,"children":387},{},[388,397],{"type":71,"tag":314,"props":389,"children":390},{},[391],{"type":71,"tag":102,"props":392,"children":394},{"className":393},[],[395],{"type":76,"value":396},"-m n",{"type":71,"tag":314,"props":398,"children":399},{},[400],{"type":76,"value":401},"do NOT merge 2D slices across series (prevents cross-series mixing)",{"type":71,"tag":292,"props":403,"children":404},{},[405,414],{"type":71,"tag":314,"props":406,"children":407},{},[408],{"type":71,"tag":102,"props":409,"children":411},{"className":410},[],[412],{"type":76,"value":413},"-o",{"type":71,"tag":314,"props":415,"children":416},{},[417],{"type":76,"value":418},"output directory",{"type":71,"tag":86,"props":420,"children":421},{},[422,424,429,431,436,438,444,446,452,454,460,462,468],{"type":76,"value":423},"Common naming tokens: ",{"type":71,"tag":102,"props":425,"children":427},{"className":426},[],[428],{"type":76,"value":374},{"type":76,"value":430}," protocol, ",{"type":71,"tag":102,"props":432,"children":434},{"className":433},[],[435],{"type":76,"value":382},{"type":76,"value":437}," series, ",{"type":71,"tag":102,"props":439,"children":441},{"className":440},[],[442],{"type":76,"value":443},"%t",{"type":76,"value":445}," time, ",{"type":71,"tag":102,"props":447,"children":449},{"className":448},[],[450],{"type":76,"value":451},"%i",{"type":76,"value":453}," patient ID, ",{"type":71,"tag":102,"props":455,"children":457},{"className":456},[],[458],{"type":76,"value":459},"%n",{"type":76,"value":461}," patient name, ",{"type":71,"tag":102,"props":463,"children":465},{"className":464},[],[466],{"type":76,"value":467},"%d",{"type":76,"value":469}," description.",{"type":71,"tag":195,"props":471,"children":473},{"id":472},"_2-read-a-dicom-file-with-pydicom",[474],{"type":76,"value":475},"2. Read a DICOM file with pydicom",{"type":71,"tag":202,"props":477,"children":481},{"className":478,"code":479,"language":480,"meta":207,"style":207},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import pydicom\n\nds = pydicom.dcmread('file.dcm')\nprint(ds.PatientName, ds.StudyDate, ds.Modality)\nprint(ds.pixel_array.shape)  # numpy array of pixel data\n","python",[482],{"type":71,"tag":102,"props":483,"children":484},{"__ignoreMap":207},[485,493,502,511,519],{"type":71,"tag":213,"props":486,"children":487},{"class":215,"line":216},[488],{"type":71,"tag":213,"props":489,"children":490},{},[491],{"type":76,"value":492},"import pydicom\n",{"type":71,"tag":213,"props":494,"children":495},{"class":215,"line":226},[496],{"type":71,"tag":213,"props":497,"children":499},{"emptyLinePlaceholder":498},true,[500],{"type":76,"value":501},"\n",{"type":71,"tag":213,"props":503,"children":505},{"class":215,"line":504},3,[506],{"type":71,"tag":213,"props":507,"children":508},{},[509],{"type":76,"value":510},"ds = pydicom.dcmread('file.dcm')\n",{"type":71,"tag":213,"props":512,"children":513},{"class":215,"line":26},[514],{"type":71,"tag":213,"props":515,"children":516},{},[517],{"type":76,"value":518},"print(ds.PatientName, ds.StudyDate, ds.Modality)\n",{"type":71,"tag":213,"props":520,"children":522},{"class":215,"line":521},5,[523],{"type":71,"tag":213,"props":524,"children":525},{},[526],{"type":76,"value":527},"print(ds.pixel_array.shape)  # numpy array of pixel data\n",{"type":71,"tag":195,"props":529,"children":531},{"id":530},"_3-de-identify-a-dicom-file-pydicom",[532],{"type":76,"value":533},"3. De-identify a DICOM file (pydicom)",{"type":71,"tag":202,"props":535,"children":537},{"className":478,"code":536,"language":480,"meta":207,"style":207},"import pydicom\nfrom pydicom.uid import generate_uid\n\nds = pydicom.dcmread('file.dcm')\n\ntags_to_remove = [\n    'PatientName', 'PatientID', 'PatientBirthDate',\n    'InstitutionName', 'ReferringPhysicianName', 'StudyDate',\n]\nfor tag in tags_to_remove:\n    if tag in ds:\n        del ds[tag]\n\nds.PatientID = 'ANON_001'\n\n# Remove private (vendor) tags — they frequently contain PHI\nds.remove_private_tags()\n\n# Replace UIDs so the study\u002Fseries\u002Finstance cannot be linked back\nds.StudyInstanceUID  = generate_uid()\nds.SeriesInstanceUID = generate_uid()\nds.SOPInstanceUID    = generate_uid()\n\nds.save_as('anon.dcm')\n",[538],{"type":71,"tag":102,"props":539,"children":540},{"__ignoreMap":207},[541,548,556,563,570,577,586,595,604,613,622,631,640,648,657,665,674,683,691,700,709,718,727,735],{"type":71,"tag":213,"props":542,"children":543},{"class":215,"line":216},[544],{"type":71,"tag":213,"props":545,"children":546},{},[547],{"type":76,"value":492},{"type":71,"tag":213,"props":549,"children":550},{"class":215,"line":226},[551],{"type":71,"tag":213,"props":552,"children":553},{},[554],{"type":76,"value":555},"from pydicom.uid import generate_uid\n",{"type":71,"tag":213,"props":557,"children":558},{"class":215,"line":504},[559],{"type":71,"tag":213,"props":560,"children":561},{"emptyLinePlaceholder":498},[562],{"type":76,"value":501},{"type":71,"tag":213,"props":564,"children":565},{"class":215,"line":26},[566],{"type":71,"tag":213,"props":567,"children":568},{},[569],{"type":76,"value":510},{"type":71,"tag":213,"props":571,"children":572},{"class":215,"line":521},[573],{"type":71,"tag":213,"props":574,"children":575},{"emptyLinePlaceholder":498},[576],{"type":76,"value":501},{"type":71,"tag":213,"props":578,"children":580},{"class":215,"line":579},6,[581],{"type":71,"tag":213,"props":582,"children":583},{},[584],{"type":76,"value":585},"tags_to_remove = [\n",{"type":71,"tag":213,"props":587,"children":589},{"class":215,"line":588},7,[590],{"type":71,"tag":213,"props":591,"children":592},{},[593],{"type":76,"value":594},"    'PatientName', 'PatientID', 'PatientBirthDate',\n",{"type":71,"tag":213,"props":596,"children":598},{"class":215,"line":597},8,[599],{"type":71,"tag":213,"props":600,"children":601},{},[602],{"type":76,"value":603},"    'InstitutionName', 'ReferringPhysicianName', 'StudyDate',\n",{"type":71,"tag":213,"props":605,"children":607},{"class":215,"line":606},9,[608],{"type":71,"tag":213,"props":609,"children":610},{},[611],{"type":76,"value":612},"]\n",{"type":71,"tag":213,"props":614,"children":616},{"class":215,"line":615},10,[617],{"type":71,"tag":213,"props":618,"children":619},{},[620],{"type":76,"value":621},"for tag in tags_to_remove:\n",{"type":71,"tag":213,"props":623,"children":625},{"class":215,"line":624},11,[626],{"type":71,"tag":213,"props":627,"children":628},{},[629],{"type":76,"value":630},"    if tag in ds:\n",{"type":71,"tag":213,"props":632,"children":634},{"class":215,"line":633},12,[635],{"type":71,"tag":213,"props":636,"children":637},{},[638],{"type":76,"value":639},"        del ds[tag]\n",{"type":71,"tag":213,"props":641,"children":643},{"class":215,"line":642},13,[644],{"type":71,"tag":213,"props":645,"children":646},{"emptyLinePlaceholder":498},[647],{"type":76,"value":501},{"type":71,"tag":213,"props":649,"children":651},{"class":215,"line":650},14,[652],{"type":71,"tag":213,"props":653,"children":654},{},[655],{"type":76,"value":656},"ds.PatientID = 'ANON_001'\n",{"type":71,"tag":213,"props":658,"children":660},{"class":215,"line":659},15,[661],{"type":71,"tag":213,"props":662,"children":663},{"emptyLinePlaceholder":498},[664],{"type":76,"value":501},{"type":71,"tag":213,"props":666,"children":668},{"class":215,"line":667},16,[669],{"type":71,"tag":213,"props":670,"children":671},{},[672],{"type":76,"value":673},"# Remove private (vendor) tags — they frequently contain PHI\n",{"type":71,"tag":213,"props":675,"children":677},{"class":215,"line":676},17,[678],{"type":71,"tag":213,"props":679,"children":680},{},[681],{"type":76,"value":682},"ds.remove_private_tags()\n",{"type":71,"tag":213,"props":684,"children":686},{"class":215,"line":685},18,[687],{"type":71,"tag":213,"props":688,"children":689},{"emptyLinePlaceholder":498},[690],{"type":76,"value":501},{"type":71,"tag":213,"props":692,"children":694},{"class":215,"line":693},19,[695],{"type":71,"tag":213,"props":696,"children":697},{},[698],{"type":76,"value":699},"# Replace UIDs so the study\u002Fseries\u002Finstance cannot be linked back\n",{"type":71,"tag":213,"props":701,"children":703},{"class":215,"line":702},20,[704],{"type":71,"tag":213,"props":705,"children":706},{},[707],{"type":76,"value":708},"ds.StudyInstanceUID  = generate_uid()\n",{"type":71,"tag":213,"props":710,"children":712},{"class":215,"line":711},21,[713],{"type":71,"tag":213,"props":714,"children":715},{},[716],{"type":76,"value":717},"ds.SeriesInstanceUID = generate_uid()\n",{"type":71,"tag":213,"props":719,"children":721},{"class":215,"line":720},22,[722],{"type":71,"tag":213,"props":723,"children":724},{},[725],{"type":76,"value":726},"ds.SOPInstanceUID    = generate_uid()\n",{"type":71,"tag":213,"props":728,"children":730},{"class":215,"line":729},23,[731],{"type":71,"tag":213,"props":732,"children":733},{"emptyLinePlaceholder":498},[734],{"type":76,"value":501},{"type":71,"tag":213,"props":736,"children":738},{"class":215,"line":737},24,[739],{"type":71,"tag":213,"props":740,"children":741},{},[742],{"type":76,"value":743},"ds.save_as('anon.dcm')\n",{"type":71,"tag":195,"props":745,"children":747},{"id":746},"_4-batch-de-identification-with-ctp-dicomanonymizer",[748],{"type":76,"value":749},"4. Batch de-identification with CTP DicomAnonymizer",{"type":71,"tag":202,"props":751,"children":753},{"className":204,"code":752,"language":206,"meta":207,"style":207},"# RSNA CTP \u002F DicomBrowser DAP (DICOM Anonymizer Program)\njava -jar DAP.jar -p profile.script -i input\u002F -o output\u002F\n",[754],{"type":71,"tag":102,"props":755,"children":756},{"__ignoreMap":207},[757,765],{"type":71,"tag":213,"props":758,"children":759},{"class":215,"line":216},[760],{"type":71,"tag":213,"props":761,"children":762},{"style":220},[763],{"type":76,"value":764},"# RSNA CTP \u002F DicomBrowser DAP (DICOM Anonymizer Program)\n",{"type":71,"tag":213,"props":766,"children":767},{"class":215,"line":226},[768,773,778,783,788,793,798,803,807],{"type":71,"tag":213,"props":769,"children":770},{"style":230},[771],{"type":76,"value":772},"java",{"type":71,"tag":213,"props":774,"children":775},{"style":235},[776],{"type":76,"value":777}," -jar",{"type":71,"tag":213,"props":779,"children":780},{"style":235},[781],{"type":76,"value":782}," DAP.jar",{"type":71,"tag":213,"props":784,"children":785},{"style":235},[786],{"type":76,"value":787}," -p",{"type":71,"tag":213,"props":789,"children":790},{"style":235},[791],{"type":76,"value":792}," profile.script",{"type":71,"tag":213,"props":794,"children":795},{"style":235},[796],{"type":76,"value":797}," -i",{"type":71,"tag":213,"props":799,"children":800},{"style":235},[801],{"type":76,"value":802}," input\u002F",{"type":71,"tag":213,"props":804,"children":805},{"style":235},[806],{"type":76,"value":267},{"type":71,"tag":213,"props":808,"children":809},{"style":235},[810],{"type":76,"value":811}," output\u002F\n",{"type":71,"tag":86,"props":813,"children":814},{},[815],{"type":76,"value":816},"Use this for large cohorts or when a validated DICOM Supplement 142 profile is required.",{"type":71,"tag":195,"props":818,"children":820},{"id":819},"_5-load-a-nifti-volume-with-nibabel",[821],{"type":76,"value":822},"5. Load a NIfTI volume with nibabel",{"type":71,"tag":202,"props":824,"children":826},{"className":478,"code":825,"language":480,"meta":207,"style":207},"import nibabel as nib\n\nimg = nib.load('file.nii.gz')\ndata   = img.get_fdata()  # numpy ndarray\naffine = img.affine       # 4x4 voxel-to-world transform\nheader = img.header\n",[827],{"type":71,"tag":102,"props":828,"children":829},{"__ignoreMap":207},[830,838,845,853,861,869],{"type":71,"tag":213,"props":831,"children":832},{"class":215,"line":216},[833],{"type":71,"tag":213,"props":834,"children":835},{},[836],{"type":76,"value":837},"import nibabel as nib\n",{"type":71,"tag":213,"props":839,"children":840},{"class":215,"line":226},[841],{"type":71,"tag":213,"props":842,"children":843},{"emptyLinePlaceholder":498},[844],{"type":76,"value":501},{"type":71,"tag":213,"props":846,"children":847},{"class":215,"line":504},[848],{"type":71,"tag":213,"props":849,"children":850},{},[851],{"type":76,"value":852},"img = nib.load('file.nii.gz')\n",{"type":71,"tag":213,"props":854,"children":855},{"class":215,"line":26},[856],{"type":71,"tag":213,"props":857,"children":858},{},[859],{"type":76,"value":860},"data   = img.get_fdata()  # numpy ndarray\n",{"type":71,"tag":213,"props":862,"children":863},{"class":215,"line":521},[864],{"type":71,"tag":213,"props":865,"children":866},{},[867],{"type":76,"value":868},"affine = img.affine       # 4x4 voxel-to-world transform\n",{"type":71,"tag":213,"props":870,"children":871},{"class":215,"line":579},[872],{"type":71,"tag":213,"props":873,"children":874},{},[875],{"type":76,"value":876},"header = img.header\n",{"type":71,"tag":195,"props":878,"children":880},{"id":879},"_6-batch-pattern-group-by-seriesinstanceuid-convert-per-series",[881],{"type":76,"value":882},"6. Batch pattern: group by SeriesInstanceUID, convert per series",{"type":71,"tag":202,"props":884,"children":886},{"className":478,"code":885,"language":480,"meta":207,"style":207},"from pathlib import Path\nfrom collections import defaultdict\nimport pydicom, subprocess\n\ndef group_by_series(input_dir):\n    series = defaultdict(list)\n    for p in Path(input_dir).rglob('*.dcm'):\n        ds = pydicom.dcmread(p, stop_before_pixels=True)\n        series[ds.SeriesInstanceUID].append(p)\n    return series\n\ndef convert_all(input_dir, output_dir):\n    Path(output_dir).mkdir(parents=True, exist_ok=True)\n    # dcm2niix handles series grouping internally when given a directory\n    subprocess.run(\n        ['dcm2niix', '-z', 'y', '-b', 'y', '-f', '%p_%s',\n         '-o', output_dir, input_dir],\n        check=True,\n    )\n",[887],{"type":71,"tag":102,"props":888,"children":889},{"__ignoreMap":207},[890,898,906,914,921,929,937,945,953,961,969,976,984,992,1000,1008,1016,1024,1032],{"type":71,"tag":213,"props":891,"children":892},{"class":215,"line":216},[893],{"type":71,"tag":213,"props":894,"children":895},{},[896],{"type":76,"value":897},"from pathlib import Path\n",{"type":71,"tag":213,"props":899,"children":900},{"class":215,"line":226},[901],{"type":71,"tag":213,"props":902,"children":903},{},[904],{"type":76,"value":905},"from collections import defaultdict\n",{"type":71,"tag":213,"props":907,"children":908},{"class":215,"line":504},[909],{"type":71,"tag":213,"props":910,"children":911},{},[912],{"type":76,"value":913},"import pydicom, subprocess\n",{"type":71,"tag":213,"props":915,"children":916},{"class":215,"line":26},[917],{"type":71,"tag":213,"props":918,"children":919},{"emptyLinePlaceholder":498},[920],{"type":76,"value":501},{"type":71,"tag":213,"props":922,"children":923},{"class":215,"line":521},[924],{"type":71,"tag":213,"props":925,"children":926},{},[927],{"type":76,"value":928},"def group_by_series(input_dir):\n",{"type":71,"tag":213,"props":930,"children":931},{"class":215,"line":579},[932],{"type":71,"tag":213,"props":933,"children":934},{},[935],{"type":76,"value":936},"    series = defaultdict(list)\n",{"type":71,"tag":213,"props":938,"children":939},{"class":215,"line":588},[940],{"type":71,"tag":213,"props":941,"children":942},{},[943],{"type":76,"value":944},"    for p in Path(input_dir).rglob('*.dcm'):\n",{"type":71,"tag":213,"props":946,"children":947},{"class":215,"line":597},[948],{"type":71,"tag":213,"props":949,"children":950},{},[951],{"type":76,"value":952},"        ds = pydicom.dcmread(p, stop_before_pixels=True)\n",{"type":71,"tag":213,"props":954,"children":955},{"class":215,"line":606},[956],{"type":71,"tag":213,"props":957,"children":958},{},[959],{"type":76,"value":960},"        series[ds.SeriesInstanceUID].append(p)\n",{"type":71,"tag":213,"props":962,"children":963},{"class":215,"line":615},[964],{"type":71,"tag":213,"props":965,"children":966},{},[967],{"type":76,"value":968},"    return series\n",{"type":71,"tag":213,"props":970,"children":971},{"class":215,"line":624},[972],{"type":71,"tag":213,"props":973,"children":974},{"emptyLinePlaceholder":498},[975],{"type":76,"value":501},{"type":71,"tag":213,"props":977,"children":978},{"class":215,"line":633},[979],{"type":71,"tag":213,"props":980,"children":981},{},[982],{"type":76,"value":983},"def convert_all(input_dir, output_dir):\n",{"type":71,"tag":213,"props":985,"children":986},{"class":215,"line":642},[987],{"type":71,"tag":213,"props":988,"children":989},{},[990],{"type":76,"value":991},"    Path(output_dir).mkdir(parents=True, exist_ok=True)\n",{"type":71,"tag":213,"props":993,"children":994},{"class":215,"line":650},[995],{"type":71,"tag":213,"props":996,"children":997},{},[998],{"type":76,"value":999},"    # dcm2niix handles series grouping internally when given a directory\n",{"type":71,"tag":213,"props":1001,"children":1002},{"class":215,"line":659},[1003],{"type":71,"tag":213,"props":1004,"children":1005},{},[1006],{"type":76,"value":1007},"    subprocess.run(\n",{"type":71,"tag":213,"props":1009,"children":1010},{"class":215,"line":667},[1011],{"type":71,"tag":213,"props":1012,"children":1013},{},[1014],{"type":76,"value":1015},"        ['dcm2niix', '-z', 'y', '-b', 'y', '-f', '%p_%s',\n",{"type":71,"tag":213,"props":1017,"children":1018},{"class":215,"line":676},[1019],{"type":71,"tag":213,"props":1020,"children":1021},{},[1022],{"type":76,"value":1023},"         '-o', output_dir, input_dir],\n",{"type":71,"tag":213,"props":1025,"children":1026},{"class":215,"line":685},[1027],{"type":71,"tag":213,"props":1028,"children":1029},{},[1030],{"type":76,"value":1031},"        check=True,\n",{"type":71,"tag":213,"props":1033,"children":1034},{"class":215,"line":693},[1035],{"type":71,"tag":213,"props":1036,"children":1037},{},[1038],{"type":76,"value":1039},"    )\n",{"type":71,"tag":195,"props":1041,"children":1043},{"id":1042},"_7-bids-organization",[1044],{"type":76,"value":1045},"7. BIDS organization",{"type":71,"tag":202,"props":1047,"children":1051},{"className":1048,"code":1050,"language":76},[1049],"language-text","dataset\u002F\n├── dataset_description.json\n├── participants.tsv\n└── sub-01\u002F\n    └── ses-01\u002F\n        ├── anat\u002F  sub-01_ses-01_T1w.nii.gz\n        ├── func\u002F  sub-01_ses-01_task-rest_bold.nii.gz\n        └── dwi\u002F   sub-01_ses-01_dwi.nii.gz\n",[1052],{"type":71,"tag":102,"props":1053,"children":1054},{"__ignoreMap":207},[1055],{"type":76,"value":1050},{"type":71,"tag":86,"props":1057,"children":1058},{},[1059,1061,1067,1069,1075],{"type":76,"value":1060},"Rule: ",{"type":71,"tag":102,"props":1062,"children":1064},{"className":1063},[],[1065],{"type":76,"value":1066},"sub-\u003Clabel>\u002Fses-\u003Clabel>\u002F\u003Cmodality>\u002F\u003Csub>_\u003Cses>_\u003Csuffix>.nii.gz",{"type":76,"value":1068},", with a matching ",{"type":71,"tag":102,"props":1070,"children":1072},{"className":1071},[],[1073],{"type":76,"value":1074},".json",{"type":76,"value":1076}," sidecar.",{"type":71,"tag":79,"props":1078,"children":1080},{"id":1079},"response-format",[1081],{"type":76,"value":1082},"Response Format",{"type":71,"tag":92,"props":1084,"children":1085},{},[1086,1091,1096,1101,1106],{"type":71,"tag":96,"props":1087,"children":1088},{},[1089],{"type":76,"value":1090},"Lead with the command or code the user needs — explain after",{"type":71,"tag":96,"props":1092,"children":1093},{},[1094],{"type":76,"value":1095},"Structure as: confirm inputs → working code → key parameters explained → gotchas",{"type":71,"tag":96,"props":1097,"children":1098},{},[1099],{"type":76,"value":1100},"One complete working example per task; do not show every alternative",{"type":71,"tag":96,"props":1102,"children":1103},{},[1104],{"type":76,"value":1105},"Keep code comments minimal and functional (what, not why-it-exists)",{"type":71,"tag":96,"props":1107,"children":1108},{},[1109],{"type":76,"value":1110},"Target: 50-100 lines of code with brief surrounding explanation",{"type":71,"tag":79,"props":1112,"children":1114},{"id":1113},"core-concepts",[1115],{"type":76,"value":1116},"Core Concepts",{"type":71,"tag":195,"props":1118,"children":1120},{"id":1119},"format-and-de-identification-decision-tree",[1121],{"type":76,"value":1122},"Format and De-identification Decision Tree",{"type":71,"tag":202,"props":1124,"children":1127},{"className":1125,"code":1126,"language":76},[1049],"What is the target format?\n├─ NIfTI (analysis) → dcm2niix -z y -b y\n│  ├─ Need BIDS layout? → add -f sub-%i_ses-%t_%p, reorganize post-hoc\n│  └─ Single series only? → point dcm2niix at series directory directly\n└─ DICOM (archive\u002FPACS) → pydicom read\u002Fwrite\n\nDe-identification method:\n├─ Small cohort (\u003C 100 studies) → pydicom script (remove tags + private + replace UIDs)\n├─ Large cohort or regulatory → CTP DicomAnonymizer with Supplement 142 profile\n└─ Burned-in pixel PHI risk?\n   ├─ US \u002F Secondary Capture \u002F Screenshots → YES: add OCR + pixel masking step\n   └─ CT \u002F MR \u002F PT → Usually NO: tag-level de-ID sufficient\n",[1128],{"type":71,"tag":102,"props":1129,"children":1130},{"__ignoreMap":207},[1131],{"type":76,"value":1126},{"type":71,"tag":86,"props":1133,"children":1134},{},[1135,1141,1143,1149,1151,1156],{"type":71,"tag":1136,"props":1137,"children":1138},"strong",{},[1139],{"type":76,"value":1140},"DICOM hierarchy.",{"type":76,"value":1142}," ",{"type":71,"tag":102,"props":1144,"children":1146},{"className":1145},[],[1147],{"type":76,"value":1148},"Patient → Study → Series → Instance",{"type":76,"value":1150},". A \"series\" is the atomic unit for conversion — one NIfTI volume typically corresponds to one ",{"type":71,"tag":102,"props":1152,"children":1154},{"className":1153},[],[1155],{"type":76,"value":154},{"type":76,"value":1157},".",{"type":71,"tag":86,"props":1159,"children":1160},{},[1161,1173,1175,1181,1183,1189],{"type":71,"tag":1136,"props":1162,"children":1163},{},[1164,1166,1172],{"type":76,"value":1165},"UIDs are identifiers, not secrets, but they are ",{"type":71,"tag":1167,"props":1168,"children":1169},"em",{},[1170],{"type":76,"value":1171},"linkable",{"type":76,"value":1157},{"type":76,"value":1174}," Two files sharing a ",{"type":71,"tag":102,"props":1176,"children":1178},{"className":1177},[],[1179],{"type":76,"value":1180},"StudyInstanceUID",{"type":76,"value":1182}," came from the same exam. De-identification must replace UIDs (",{"type":71,"tag":102,"props":1184,"children":1186},{"className":1185},[],[1187],{"type":76,"value":1188},"generate_uid()",{"type":76,"value":1190},") to break linkage across releases.",{"type":71,"tag":86,"props":1192,"children":1193},{},[1194,1199,1201,1207],{"type":71,"tag":1136,"props":1195,"children":1196},{},[1197],{"type":76,"value":1198},"Private tags carry PHI.",{"type":76,"value":1200}," Vendor-specific tags (odd group numbers) often embed operator notes, patient IDs, or burned-in metadata. Always call ",{"type":71,"tag":102,"props":1202,"children":1204},{"className":1203},[],[1205],{"type":76,"value":1206},"ds.remove_private_tags()",{"type":76,"value":1157},{"type":71,"tag":86,"props":1209,"children":1210},{},[1211,1216,1218,1223],{"type":71,"tag":1136,"props":1212,"children":1213},{},[1214],{"type":76,"value":1215},"Pixel data can contain PHI too.",{"type":76,"value":1217}," Ultrasound frames, secondary captures, and screenshots frequently have burned-in patient name\u002FMRN in the pixels. Tag removal does ",{"type":71,"tag":1167,"props":1219,"children":1220},{},[1221],{"type":76,"value":1222},"not",{"type":76,"value":1224}," scrub pixels — run OCR + masking separately when this risk applies.",{"type":71,"tag":86,"props":1226,"children":1227},{},[1228],{"type":71,"tag":1136,"props":1229,"children":1230},{},[1231],{"type":76,"value":1232},"Key DICOM tags for geometry and modality:",{"type":71,"tag":284,"props":1234,"children":1235},{},[1236,1257],{"type":71,"tag":288,"props":1237,"children":1238},{},[1239],{"type":71,"tag":292,"props":1240,"children":1241},{},[1242,1247,1252],{"type":71,"tag":296,"props":1243,"children":1244},{},[1245],{"type":76,"value":1246},"Tag",{"type":71,"tag":296,"props":1248,"children":1249},{},[1250],{"type":76,"value":1251},"Name",{"type":71,"tag":296,"props":1253,"children":1254},{},[1255],{"type":76,"value":1256},"Purpose",{"type":71,"tag":307,"props":1258,"children":1259},{},[1260,1282,1304,1334,1356],{"type":71,"tag":292,"props":1261,"children":1262},{},[1263,1272,1277],{"type":71,"tag":314,"props":1264,"children":1265},{},[1266],{"type":71,"tag":102,"props":1267,"children":1269},{"className":1268},[],[1270],{"type":76,"value":1271},"(0008,0060)",{"type":71,"tag":314,"props":1273,"children":1274},{},[1275],{"type":76,"value":1276},"Modality",{"type":71,"tag":314,"props":1278,"children":1279},{},[1280],{"type":76,"value":1281},"CT \u002F MR \u002F CR \u002F US \u002F PT ...",{"type":71,"tag":292,"props":1283,"children":1284},{},[1285,1294,1299],{"type":71,"tag":314,"props":1286,"children":1287},{},[1288],{"type":71,"tag":102,"props":1289,"children":1291},{"className":1290},[],[1292],{"type":76,"value":1293},"(0018,0050)",{"type":71,"tag":314,"props":1295,"children":1296},{},[1297],{"type":76,"value":1298},"SliceThickness",{"type":71,"tag":314,"props":1300,"children":1301},{},[1302],{"type":76,"value":1303},"mm",{"type":71,"tag":292,"props":1305,"children":1306},{},[1307,1316,1321],{"type":71,"tag":314,"props":1308,"children":1309},{},[1310],{"type":71,"tag":102,"props":1311,"children":1313},{"className":1312},[],[1314],{"type":76,"value":1315},"(0028,0030)",{"type":71,"tag":314,"props":1317,"children":1318},{},[1319],{"type":76,"value":1320},"PixelSpacing",{"type":71,"tag":314,"props":1322,"children":1323},{},[1324,1326,1332],{"type":76,"value":1325},"in-plane spacing ",{"type":71,"tag":102,"props":1327,"children":1329},{"className":1328},[],[1330],{"type":76,"value":1331},"[row, col]",{"type":76,"value":1333}," mm",{"type":71,"tag":292,"props":1335,"children":1336},{},[1337,1346,1351],{"type":71,"tag":314,"props":1338,"children":1339},{},[1340],{"type":71,"tag":102,"props":1341,"children":1343},{"className":1342},[],[1344],{"type":76,"value":1345},"(0020,0032)",{"type":71,"tag":314,"props":1347,"children":1348},{},[1349],{"type":76,"value":1350},"ImagePositionPatient",{"type":71,"tag":314,"props":1352,"children":1353},{},[1354],{"type":76,"value":1355},"origin of slice in patient coords",{"type":71,"tag":292,"props":1357,"children":1358},{},[1359,1368,1373],{"type":71,"tag":314,"props":1360,"children":1361},{},[1362],{"type":71,"tag":102,"props":1363,"children":1365},{"className":1364},[],[1366],{"type":76,"value":1367},"(0020,0037)",{"type":71,"tag":314,"props":1369,"children":1370},{},[1371],{"type":76,"value":1372},"ImageOrientationPatient",{"type":71,"tag":314,"props":1374,"children":1375},{},[1376],{"type":76,"value":1377},"row\u002Fcol direction cosines",{"type":71,"tag":86,"props":1379,"children":1380},{},[1381,1383,1389],{"type":76,"value":1382},"These five tags are sufficient to reconstruct the NIfTI ",{"type":71,"tag":102,"props":1384,"children":1386},{"className":1385},[],[1387],{"type":76,"value":1388},"affine",{"type":76,"value":1390}," matrix.",{"type":71,"tag":86,"props":1392,"children":1393},{},[1394,1399,1401,1406],{"type":71,"tag":1136,"props":1395,"children":1396},{},[1397],{"type":76,"value":1398},"NIfTI vs DICOM.",{"type":76,"value":1400}," NIfTI stores a single 3D\u002F4D volume with one affine; DICOM stores slice-level metadata. Converters (",{"type":71,"tag":102,"props":1402,"children":1404},{"className":1403},[],[1405],{"type":76,"value":107},{"type":76,"value":1407},") aggregate slices of a series and compute the affine from the tags above.",{"type":71,"tag":79,"props":1409,"children":1411},{"id":1410},"quick-reference",[1412],{"type":76,"value":1413},"Quick Reference",{"type":71,"tag":202,"props":1415,"children":1417},{"className":204,"code":1416,"language":206,"meta":207,"style":207},"# Convert\ndcm2niix -z y -b y -f %p_%s -o out\u002F in\u002F\n\n# Skip merging across series (safer)\ndcm2niix -z y -b y -m n -f %p_%s -o out\u002F in\u002F\n\n# Batch anonymization (CTP)\njava -jar DAP.jar -p profile.script -i input\u002F -o output\u002F\n",[1418],{"type":71,"tag":102,"props":1419,"children":1420},{"__ignoreMap":207},[1421,1429,1474,1481,1489,1542,1549,1557],{"type":71,"tag":213,"props":1422,"children":1423},{"class":215,"line":216},[1424],{"type":71,"tag":213,"props":1425,"children":1426},{"style":220},[1427],{"type":76,"value":1428},"# Convert\n",{"type":71,"tag":213,"props":1430,"children":1431},{"class":215,"line":226},[1432,1436,1440,1444,1448,1452,1456,1460,1464,1469],{"type":71,"tag":213,"props":1433,"children":1434},{"style":230},[1435],{"type":76,"value":107},{"type":71,"tag":213,"props":1437,"children":1438},{"style":235},[1439],{"type":76,"value":238},{"type":71,"tag":213,"props":1441,"children":1442},{"style":235},[1443],{"type":76,"value":243},{"type":71,"tag":213,"props":1445,"children":1446},{"style":235},[1447],{"type":76,"value":248},{"type":71,"tag":213,"props":1449,"children":1450},{"style":235},[1451],{"type":76,"value":243},{"type":71,"tag":213,"props":1453,"children":1454},{"style":235},[1455],{"type":76,"value":257},{"type":71,"tag":213,"props":1457,"children":1458},{"style":235},[1459],{"type":76,"value":262},{"type":71,"tag":213,"props":1461,"children":1462},{"style":235},[1463],{"type":76,"value":267},{"type":71,"tag":213,"props":1465,"children":1466},{"style":235},[1467],{"type":76,"value":1468}," out\u002F",{"type":71,"tag":213,"props":1470,"children":1471},{"style":235},[1472],{"type":76,"value":1473}," in\u002F\n",{"type":71,"tag":213,"props":1475,"children":1476},{"class":215,"line":504},[1477],{"type":71,"tag":213,"props":1478,"children":1479},{"emptyLinePlaceholder":498},[1480],{"type":76,"value":501},{"type":71,"tag":213,"props":1482,"children":1483},{"class":215,"line":26},[1484],{"type":71,"tag":213,"props":1485,"children":1486},{"style":220},[1487],{"type":76,"value":1488},"# Skip merging across series (safer)\n",{"type":71,"tag":213,"props":1490,"children":1491},{"class":215,"line":521},[1492,1496,1500,1504,1508,1512,1517,1522,1526,1530,1534,1538],{"type":71,"tag":213,"props":1493,"children":1494},{"style":230},[1495],{"type":76,"value":107},{"type":71,"tag":213,"props":1497,"children":1498},{"style":235},[1499],{"type":76,"value":238},{"type":71,"tag":213,"props":1501,"children":1502},{"style":235},[1503],{"type":76,"value":243},{"type":71,"tag":213,"props":1505,"children":1506},{"style":235},[1507],{"type":76,"value":248},{"type":71,"tag":213,"props":1509,"children":1510},{"style":235},[1511],{"type":76,"value":243},{"type":71,"tag":213,"props":1513,"children":1514},{"style":235},[1515],{"type":76,"value":1516}," -m",{"type":71,"tag":213,"props":1518,"children":1519},{"style":235},[1520],{"type":76,"value":1521}," n",{"type":71,"tag":213,"props":1523,"children":1524},{"style":235},[1525],{"type":76,"value":257},{"type":71,"tag":213,"props":1527,"children":1528},{"style":235},[1529],{"type":76,"value":262},{"type":71,"tag":213,"props":1531,"children":1532},{"style":235},[1533],{"type":76,"value":267},{"type":71,"tag":213,"props":1535,"children":1536},{"style":235},[1537],{"type":76,"value":1468},{"type":71,"tag":213,"props":1539,"children":1540},{"style":235},[1541],{"type":76,"value":1473},{"type":71,"tag":213,"props":1543,"children":1544},{"class":215,"line":579},[1545],{"type":71,"tag":213,"props":1546,"children":1547},{"emptyLinePlaceholder":498},[1548],{"type":76,"value":501},{"type":71,"tag":213,"props":1550,"children":1551},{"class":215,"line":588},[1552],{"type":71,"tag":213,"props":1553,"children":1554},{"style":220},[1555],{"type":76,"value":1556},"# Batch anonymization (CTP)\n",{"type":71,"tag":213,"props":1558,"children":1559},{"class":215,"line":597},[1560,1564,1568,1572,1576,1580,1584,1588,1592],{"type":71,"tag":213,"props":1561,"children":1562},{"style":230},[1563],{"type":76,"value":772},{"type":71,"tag":213,"props":1565,"children":1566},{"style":235},[1567],{"type":76,"value":777},{"type":71,"tag":213,"props":1569,"children":1570},{"style":235},[1571],{"type":76,"value":782},{"type":71,"tag":213,"props":1573,"children":1574},{"style":235},[1575],{"type":76,"value":787},{"type":71,"tag":213,"props":1577,"children":1578},{"style":235},[1579],{"type":76,"value":792},{"type":71,"tag":213,"props":1581,"children":1582},{"style":235},[1583],{"type":76,"value":797},{"type":71,"tag":213,"props":1585,"children":1586},{"style":235},[1587],{"type":76,"value":802},{"type":71,"tag":213,"props":1589,"children":1590},{"style":235},[1591],{"type":76,"value":267},{"type":71,"tag":213,"props":1593,"children":1594},{"style":235},[1595],{"type":76,"value":811},{"type":71,"tag":202,"props":1597,"children":1599},{"className":478,"code":1598,"language":480,"meta":207,"style":207},"# Read DICOM\nds = pydicom.dcmread('file.dcm')\nds.PatientName, ds.Modality, ds.pixel_array.shape\n\n# Header-only (fast, no pixels)\nds = pydicom.dcmread('file.dcm', stop_before_pixels=True)\n\n# Anonymize core fields\nfor t in ['PatientName','PatientID','PatientBirthDate',\n          'InstitutionName','ReferringPhysicianName','StudyDate']:\n    if t in ds: del ds[t]\nds.remove_private_tags()\nds.StudyInstanceUID  = generate_uid()\nds.SeriesInstanceUID = generate_uid()\nds.SOPInstanceUID    = generate_uid()\n\n# Load NIfTI\nimg = nib.load('file.nii.gz'); data = img.get_fdata(); aff = img.affine\n",[1600],{"type":71,"tag":102,"props":1601,"children":1602},{"__ignoreMap":207},[1603,1611,1618,1626,1633,1641,1649,1656,1664,1672,1680,1688,1695,1702,1709,1716,1723,1731],{"type":71,"tag":213,"props":1604,"children":1605},{"class":215,"line":216},[1606],{"type":71,"tag":213,"props":1607,"children":1608},{},[1609],{"type":76,"value":1610},"# Read DICOM\n",{"type":71,"tag":213,"props":1612,"children":1613},{"class":215,"line":226},[1614],{"type":71,"tag":213,"props":1615,"children":1616},{},[1617],{"type":76,"value":510},{"type":71,"tag":213,"props":1619,"children":1620},{"class":215,"line":504},[1621],{"type":71,"tag":213,"props":1622,"children":1623},{},[1624],{"type":76,"value":1625},"ds.PatientName, ds.Modality, ds.pixel_array.shape\n",{"type":71,"tag":213,"props":1627,"children":1628},{"class":215,"line":26},[1629],{"type":71,"tag":213,"props":1630,"children":1631},{"emptyLinePlaceholder":498},[1632],{"type":76,"value":501},{"type":71,"tag":213,"props":1634,"children":1635},{"class":215,"line":521},[1636],{"type":71,"tag":213,"props":1637,"children":1638},{},[1639],{"type":76,"value":1640},"# Header-only (fast, no pixels)\n",{"type":71,"tag":213,"props":1642,"children":1643},{"class":215,"line":579},[1644],{"type":71,"tag":213,"props":1645,"children":1646},{},[1647],{"type":76,"value":1648},"ds = pydicom.dcmread('file.dcm', stop_before_pixels=True)\n",{"type":71,"tag":213,"props":1650,"children":1651},{"class":215,"line":588},[1652],{"type":71,"tag":213,"props":1653,"children":1654},{"emptyLinePlaceholder":498},[1655],{"type":76,"value":501},{"type":71,"tag":213,"props":1657,"children":1658},{"class":215,"line":597},[1659],{"type":71,"tag":213,"props":1660,"children":1661},{},[1662],{"type":76,"value":1663},"# Anonymize core fields\n",{"type":71,"tag":213,"props":1665,"children":1666},{"class":215,"line":606},[1667],{"type":71,"tag":213,"props":1668,"children":1669},{},[1670],{"type":76,"value":1671},"for t in ['PatientName','PatientID','PatientBirthDate',\n",{"type":71,"tag":213,"props":1673,"children":1674},{"class":215,"line":615},[1675],{"type":71,"tag":213,"props":1676,"children":1677},{},[1678],{"type":76,"value":1679},"          'InstitutionName','ReferringPhysicianName','StudyDate']:\n",{"type":71,"tag":213,"props":1681,"children":1682},{"class":215,"line":624},[1683],{"type":71,"tag":213,"props":1684,"children":1685},{},[1686],{"type":76,"value":1687},"    if t in ds: del ds[t]\n",{"type":71,"tag":213,"props":1689,"children":1690},{"class":215,"line":633},[1691],{"type":71,"tag":213,"props":1692,"children":1693},{},[1694],{"type":76,"value":682},{"type":71,"tag":213,"props":1696,"children":1697},{"class":215,"line":642},[1698],{"type":71,"tag":213,"props":1699,"children":1700},{},[1701],{"type":76,"value":708},{"type":71,"tag":213,"props":1703,"children":1704},{"class":215,"line":650},[1705],{"type":71,"tag":213,"props":1706,"children":1707},{},[1708],{"type":76,"value":717},{"type":71,"tag":213,"props":1710,"children":1711},{"class":215,"line":659},[1712],{"type":71,"tag":213,"props":1713,"children":1714},{},[1715],{"type":76,"value":726},{"type":71,"tag":213,"props":1717,"children":1718},{"class":215,"line":667},[1719],{"type":71,"tag":213,"props":1720,"children":1721},{"emptyLinePlaceholder":498},[1722],{"type":76,"value":501},{"type":71,"tag":213,"props":1724,"children":1725},{"class":215,"line":676},[1726],{"type":71,"tag":213,"props":1727,"children":1728},{},[1729],{"type":76,"value":1730},"# Load NIfTI\n",{"type":71,"tag":213,"props":1732,"children":1733},{"class":215,"line":685},[1734],{"type":71,"tag":213,"props":1735,"children":1736},{},[1737],{"type":76,"value":1738},"img = nib.load('file.nii.gz'); data = img.get_fdata(); aff = img.affine\n",{"type":71,"tag":79,"props":1740,"children":1742},{"id":1741},"common-mistakes",[1743],{"type":76,"value":1744},"Common Mistakes",{"type":71,"tag":92,"props":1746,"children":1747},{},[1748,1779,1828,1856,1877,1919,1947],{"type":71,"tag":96,"props":1749,"children":1750},{},[1751,1756,1758,1763,1765,1770,1772,1777],{"type":71,"tag":1136,"props":1752,"children":1753},{},[1754],{"type":76,"value":1755},"Wrong:",{"type":76,"value":1757}," Not removing private tags during DICOM de-identification\n",{"type":71,"tag":1136,"props":1759,"children":1760},{},[1761],{"type":76,"value":1762},"Right:",{"type":76,"value":1764}," Always call ",{"type":71,"tag":102,"props":1766,"children":1768},{"className":1767},[],[1769],{"type":76,"value":1206},{"type":76,"value":1771}," as part of the de-identification pipeline\n",{"type":71,"tag":1136,"props":1773,"children":1774},{},[1775],{"type":76,"value":1776},"Why:",{"type":76,"value":1778}," Vendor private tags (odd group numbers) routinely contain PHI that survives standard tag-level scrubbing",{"type":71,"tag":96,"props":1780,"children":1781},{},[1782,1786,1788,1792,1794,1799,1800,1805,1807,1813,1815,1820,1822,1826],{"type":71,"tag":1136,"props":1783,"children":1784},{},[1785],{"type":76,"value":1755},{"type":76,"value":1787}," Keeping original UIDs after anonymization\n",{"type":71,"tag":1136,"props":1789,"children":1790},{},[1791],{"type":76,"value":1762},{"type":76,"value":1793}," Replace ",{"type":71,"tag":102,"props":1795,"children":1797},{"className":1796},[],[1798],{"type":76,"value":1180},{"type":76,"value":172},{"type":71,"tag":102,"props":1801,"children":1803},{"className":1802},[],[1804],{"type":76,"value":154},{"type":76,"value":1806},", and ",{"type":71,"tag":102,"props":1808,"children":1810},{"className":1809},[],[1811],{"type":76,"value":1812},"SOPInstanceUID",{"type":76,"value":1814}," with ",{"type":71,"tag":102,"props":1816,"children":1818},{"className":1817},[],[1819],{"type":76,"value":1188},{"type":76,"value":1821}," for every de-identified file\n",{"type":71,"tag":1136,"props":1823,"children":1824},{},[1825],{"type":76,"value":1776},{"type":76,"value":1827}," Original UIDs are linkable back to the source PACS — two files sharing a StudyInstanceUID reveal they came from the same exam",{"type":71,"tag":96,"props":1829,"children":1830},{},[1831,1835,1837,1841,1843,1848,1850,1854],{"type":71,"tag":1136,"props":1832,"children":1833},{},[1834],{"type":76,"value":1755},{"type":76,"value":1836}," Using default dcm2niix merge behavior without verification\n",{"type":71,"tag":1136,"props":1838,"children":1839},{},[1840],{"type":76,"value":1762},{"type":76,"value":1842}," Use ",{"type":71,"tag":102,"props":1844,"children":1846},{"className":1845},[],[1847],{"type":76,"value":396},{"type":76,"value":1849}," to disable merging, or inspect output file counts against the expected series list\n",{"type":71,"tag":1136,"props":1851,"children":1852},{},[1853],{"type":76,"value":1776},{"type":76,"value":1855}," Default merging can combine distinct acquisitions into one NIfTI volume, corrupting the data",{"type":71,"tag":96,"props":1857,"children":1858},{},[1859,1863,1865,1869,1871,1875],{"type":71,"tag":1136,"props":1860,"children":1861},{},[1862],{"type":76,"value":1755},{"type":76,"value":1864}," Ignoring burned-in annotations in pixel data during de-identification\n",{"type":71,"tag":1136,"props":1866,"children":1867},{},[1868],{"type":76,"value":1762},{"type":76,"value":1870}," Add an OCR detection and pixel masking step for ultrasound, secondary capture, and screenshot modalities\n",{"type":71,"tag":1136,"props":1872,"children":1873},{},[1874],{"type":76,"value":1776},{"type":76,"value":1876}," Tag-level de-identification does not scrub pixels — patient name\u002FMRN burned into the image persists after tag removal",{"type":71,"tag":96,"props":1878,"children":1879},{},[1880,1884,1886,1891,1893,1897,1899,1904,1906,1911,1913,1917],{"type":71,"tag":1136,"props":1881,"children":1882},{},[1883],{"type":76,"value":1755},{"type":76,"value":1885}," Outputting uncompressed ",{"type":71,"tag":102,"props":1887,"children":1889},{"className":1888},[],[1890],{"type":76,"value":178},{"type":76,"value":1892}," files from dcm2niix\n",{"type":71,"tag":1136,"props":1894,"children":1895},{},[1896],{"type":76,"value":1762},{"type":76,"value":1898}," Always pass ",{"type":71,"tag":102,"props":1900,"children":1902},{"className":1901},[],[1903],{"type":76,"value":322},{"type":76,"value":1905}," to dcm2niix for gzipped ",{"type":71,"tag":102,"props":1907,"children":1909},{"className":1908},[],[1910],{"type":76,"value":185},{"type":76,"value":1912}," output unless downstream tools explicitly require uncompressed\n",{"type":71,"tag":1136,"props":1914,"children":1915},{},[1916],{"type":76,"value":1776},{"type":76,"value":1918}," Uncompressed NIfTI files are 3-5× larger, wasting storage and slowing transfers with no benefit for most pipelines",{"type":71,"tag":96,"props":1920,"children":1921},{},[1922,1926,1928,1932,1933,1939,1941,1945],{"type":71,"tag":1136,"props":1923,"children":1924},{},[1925],{"type":76,"value":1755},{"type":76,"value":1927}," Reading full pixel data when only DICOM headers are needed\n",{"type":71,"tag":1136,"props":1929,"children":1930},{},[1931],{"type":76,"value":1762},{"type":76,"value":1842},{"type":71,"tag":102,"props":1934,"children":1936},{"className":1935},[],[1937],{"type":76,"value":1938},"pydicom.dcmread(path, stop_before_pixels=True)",{"type":76,"value":1940}," for metadata-only scans\n",{"type":71,"tag":1136,"props":1942,"children":1943},{},[1944],{"type":76,"value":1776},{"type":76,"value":1946}," Loading pixel arrays for large cohorts wastes memory and time when only tags like Modality, SeriesInstanceUID, or SliceThickness are needed",{"type":71,"tag":96,"props":1948,"children":1949},{},[1950,1954,1956,1960,1962,1967,1969,1975,1977,1981],{"type":71,"tag":1136,"props":1951,"children":1952},{},[1953],{"type":76,"value":1755},{"type":76,"value":1955}," Treating DICOMDIR as a file directory and iterating its entries\n",{"type":71,"tag":1136,"props":1957,"children":1958},{},[1959],{"type":76,"value":1762},{"type":76,"value":1961}," Iterate actual ",{"type":71,"tag":102,"props":1963,"children":1965},{"className":1964},[],[1966],{"type":76,"value":170},{"type":76,"value":1968}," files using ",{"type":71,"tag":102,"props":1970,"children":1972},{"className":1971},[],[1973],{"type":76,"value":1974},"Path(input_dir).rglob('*.dcm')",{"type":76,"value":1976}," instead\n",{"type":71,"tag":1136,"props":1978,"children":1979},{},[1980],{"type":76,"value":1776},{"type":76,"value":1982}," DICOMDIR is an index file with its own structure — it may be incomplete, outdated, or absent; direct file iteration is more reliable",{"type":71,"tag":79,"props":1984,"children":1986},{"id":1985},"references",[1987],{"type":76,"value":1988},"References",{"type":71,"tag":92,"props":1990,"children":1991},{},[1992,2005,2016,2027],{"type":71,"tag":96,"props":1993,"children":1994},{},[1995,1997],{"type":76,"value":1996},"dcm2niix: Li et al. J Neurosci Methods 2016, ",{"type":71,"tag":1998,"props":1999,"children":2003},"a",{"href":2000,"rel":2001},"https:\u002F\u002Fdoi.org\u002F10.1016\u002Fj.jneumeth.2016.03.001",[2002],"nofollow",[2004],{"type":76,"value":2000},{"type":71,"tag":96,"props":2006,"children":2007},{},[2008,2010],{"type":76,"value":2009},"pydicom: ",{"type":71,"tag":1998,"props":2011,"children":2014},{"href":2012,"rel":2013},"https:\u002F\u002Fpydicom.github.io\u002Fpydicom\u002Fstable\u002F",[2002],[2015],{"type":76,"value":2012},{"type":71,"tag":96,"props":2017,"children":2018},{},[2019,2021],{"type":76,"value":2020},"BIDS: Gorgolewski et al. Sci Data 2016, ",{"type":71,"tag":1998,"props":2022,"children":2025},{"href":2023,"rel":2024},"https:\u002F\u002Fdoi.org\u002F10.1038\u002Fsdata.2016.44",[2002],[2026],{"type":76,"value":2023},{"type":71,"tag":96,"props":2028,"children":2029},{},[2030,2032],{"type":76,"value":2031},"DICOM de-identification: DICOM PS3.15 Annex E, ",{"type":71,"tag":1998,"props":2033,"children":2036},{"href":2034,"rel":2035},"https:\u002F\u002Fdicom.nema.org\u002Fmedical\u002Fdicom\u002Fcurrent\u002Foutput\u002Fchtml\u002Fpart15\u002Fchapter_E.html",[2002],[2037],{"type":76,"value":2034},{"type":71,"tag":2039,"props":2040,"children":2041},"style",{},[2042],{"type":76,"value":2043},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":2045,"total":2143},[2046,2063,2078,2092,2107,2120,2133],{"slug":2047,"name":2047,"fn":2048,"description":2049,"org":2050,"tags":2051,"stars":26,"repoUrl":27,"updatedAt":2062},"aws-genai-ml-architect","design AWS GenAI and ML architectures","Reasoning skill for designing AWS GenAI and ML architectures for healthcare and life sciences workloads. Use when the user asks to choose between SageMaker and Bedrock, design a RAG system over medical literature, architect clinical NLP or medical imaging inference, plan genomics or drug discovery pipelines on AWS, address HIPAA\u002FPHI compliance in ML systems, design MLOps for regulated clinical models, or optimize cost for HCLS ML workloads. Triggers include \"AWS architecture\", \"SageMaker vs Bedrock\", \"HIPAA ML\", \"clinical RAG\", \"medical imaging inference\", \"genomics on AWS\", \"PHI training\", \"MLOps healthcare\", \"Bedrock guardrails\", \"HealthLake\", \"HCLS cloud architecture\", \"BAA compliance\", \"SageMaker endpoint\", \"Bedrock knowledge base\", \"clinical NLP on AWS\", \"FDA SaMD on AWS\".",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2052,2055,2056,2057,2059],{"name":2053,"slug":2054,"type":16},"Architecture","architecture",{"name":24,"slug":25,"type":16},{"name":14,"slug":15,"type":16},{"name":2058,"slug":41,"type":16},"Life Sciences",{"name":2060,"slug":2061,"type":16},"LLM","llm","2026-07-12T08:38:07.975937",{"slug":2064,"name":2064,"fn":2065,"description":2066,"org":2067,"tags":2068,"stars":26,"repoUrl":27,"updatedAt":2077},"biomarker-discovery","guide biomarker discovery and validation","Reason about biomarker discovery and validation in HCLS — classifying biomarker intent, choosing feature-selection and cross-validation strategies, avoiding leakage, and planning external replication. Use when the user asks to discover, develop, or validate a biomarker; select features from high-dimensional omics or clinical data; design a validation study; choose evaluation metrics; justify sample size; combine multi-omics signals; or assess clinical utility. Triggers include \"discover a biomarker\", \"validate biomarker\", \"prognostic vs predictive\", \"feature selection\", \"LASSO vs elastic net\", \"nested cross-validation\", \"data leakage\", \"C-index\", \"time-dependent AUC\", \"decision curve analysis\", \"external validation cohort\", \"events per variable\", \"optimism-corrected\", \"multi-omics integration\", \"clinical utility of a biomarker\", \"is this biomarker ready\".",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2069,2070,2073,2074],{"name":24,"slug":25,"type":16},{"name":2071,"slug":2072,"type":16},"Bioinformatics","bioinformatics",{"name":2058,"slug":41,"type":16},{"name":2075,"slug":2076,"type":16},"Research","research","2026-07-12T08:37:49.295301",{"slug":2079,"name":2079,"fn":2080,"description":2081,"org":2082,"tags":2083,"stars":26,"repoUrl":27,"updatedAt":2091},"cdisc-compliance","reason about CDISC SDTM and ADaM implementation","Reason about CDISC SDTM and ADaM implementation for regulatory submissions. Use when the user asks about SDTM domain mapping, ADaM dataset design, controlled terminology versioning, define.xml completeness, FDA or PMDA submission requirements, query prioritization by clinical impact, SUPPQUAL usage, or CDISC compliance review. Triggers include \"SDTM mapping\", \"ADaM dataset\", \"CDISC compliance\", \"controlled terminology\", \"define.xml\", \"FDA submission data\", \"PMDA submission\", \"SDTM domain\", \"ADSL\", \"ADAE\", \"ADLB\", \"BDS structure\", \"SUPPQUAL\", \"RELREC\", \"value-level metadata\", \"CDISC CT\", \"regulatory submission data standards\", \"eCTD datasets\", \"SDTM 3.3\", \"ADaM 1.1\", \"query prioritization\", \"clinical data review\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2084,2087,2088],{"name":2085,"slug":2086,"type":16},"Clinical Trials","clinical-trials",{"name":2058,"slug":41,"type":16},{"name":2089,"slug":2090,"type":16},"Regulatory Compliance","regulatory-compliance","2026-07-12T08:37:33.35594",{"slug":2093,"name":2093,"fn":2094,"description":2095,"org":2096,"tags":2097,"stars":26,"repoUrl":27,"updatedAt":2106},"cell-type-annotation","annotate single-cell RNA-seq clusters","Generate code to assign cell type labels to single-cell RNA-seq clusters using CellTypist, SingleR, marker-based annotation, or reference label transfer (scANVI\u002Fingest). Triggers on requests to \"annotate cell types\", \"label clusters\", \"run CellTypist\", \"SingleR annotation\", \"marker gene dotplot\", \"transfer labels from reference atlas\", \"cell identity\", \"automated annotation\", \"reference mapping\", \"scANVI label transfer\", \"canonical markers\", \"immune cell types\", \"hierarchical annotation\", \"majority voting CellTypist\", \"over-clustering annotation\".",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2098,2099,2102,2103],{"name":2071,"slug":2072,"type":16},{"name":2100,"slug":2101,"type":16},"Data Analysis","data-analysis",{"name":2058,"slug":41,"type":16},{"name":2104,"slug":2105,"type":16},"RNA-seq","rna-seq","2026-07-12T08:38:05.443454",{"slug":2108,"name":2108,"fn":2109,"description":2110,"org":2111,"tags":2112,"stars":26,"repoUrl":27,"updatedAt":2119},"cheminformatics","calculate molecular properties with RDKit","Cheminformatics pipeline for small-molecule property calculation, filtering, and similarity analysis using RDKit. Use when the user asks to compute molecular descriptors, filter compounds by Lipinski or Veber rules, detect PAINS, calculate fingerprint similarity, run matched molecular pair analysis, generate ADMET descriptors, or process SMILES. Triggers include \"RDKit\", \"molecular descriptors\", \"Lipinski\", \"rule of five\", \"Veber\", \"PAINS\", \"pan-assay interference\", \"Morgan fingerprint\", \"Tanimoto\", \"fingerprint similarity\", \"matched molecular pair\", \"MMP\", \"mmpdb\", \"ADMET\", \"druglikeness\", \"SMILES\", \"cheminformatics\", \"compound filtering\", \"chemical similarity\".",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2113,2114,2117,2118],{"name":2071,"slug":2072,"type":16},{"name":2115,"slug":2116,"type":16},"Chemistry","chemistry",{"name":2100,"slug":2101,"type":16},{"name":2075,"slug":2076,"type":16},"2026-07-12T08:37:28.334619",{"slug":2121,"name":2121,"fn":2122,"description":2123,"org":2124,"tags":2125,"stars":26,"repoUrl":27,"updatedAt":2132},"claims-analytics","analyze and parse healthcare claims data","Pipeline skill for healthcare claims data parsing, analysis, and fraud detection. Use when the user asks to parse X12 837 or 835 claim files, manipulate ICD-10 CPT or HCPCS codes, detect billing pattern anomalies, profile providers against specialty peers, identify outlier billing behavior, validate NCCI edits programmatically, detect duplicate claims, run Benford's law analysis on charges, build claims data pipelines, or analyze E&M code distributions. Triggers include \"parse X12 837\", \"parse 835\", \"claims SQL\", \"ICD-10 manipulation\", \"CPT code analysis\", \"provider profiling\", \"billing outlier\", \"NCCI validation code\", \"duplicate claim detection\", \"Benford's law charges\", \"claims ETL\", \"E&M distribution analysis\", \"claims analytics pipeline\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2126,2127,2128,2131],{"name":2100,"slug":2101,"type":16},{"name":14,"slug":15,"type":16},{"name":2129,"slug":2130,"type":16},"Insurance","insurance",{"name":2058,"slug":41,"type":16},"2026-07-12T08:37:34.815088",{"slug":2134,"name":2134,"fn":2135,"description":2136,"org":2137,"tags":2138,"stars":26,"repoUrl":27,"updatedAt":2142},"claims-billing-rules","analyze healthcare claims billing rules","Reasoning skill for healthcare claims billing rules and fraud detection logic. Use when the user asks about CMS billing rules, place of service codes, global surgery periods, modifier usage (25 59 76 77), NCCI edit logic, column 1 column 2 code pairs, mutually exclusive procedures, modifier indicators, fraud waste and abuse patterns, E&M upcoding, unbundling, phantom billing, impossible day detection, coding error versus fraud distinction, FWA investigation methodology, or claims audit logic. Triggers include \"CMS billing rules\", \"NCCI edits\", \"modifier 25\", \"modifier 59\", \"global surgery period\", \"upcoding\", \"unbundling\", \"phantom billing\", \"impossible day\", \"FWA\", \"fraud waste abuse\", \"coding error vs fraud\", \"claims audit\", \"billing compliance\", \"E&M level selection\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2139,2140,2141],{"name":14,"slug":15,"type":16},{"name":2129,"slug":2130,"type":16},{"name":2089,"slug":2090,"type":16},"2026-07-12T08:38:28.210856",40,{"items":2145,"total":2321},[2146,2165,2186,2196,2209,2222,2232,2242,2263,2278,2293,2308],{"slug":2147,"name":2147,"fn":2148,"description":2149,"org":2150,"tags":2151,"stars":2162,"repoUrl":2163,"updatedAt":2164},"agentcore-investigation","investigate Bedrock AgentCore runtime sessions","Investigate Bedrock AgentCore runtime sessions via CloudWatch Logs Insights — resolve session\u002Ftrace IDs, query OTEL spans, filter noise, build timelines. Use when debugging AgentCore agent sessions, tracing tool calls, or analyzing latency.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2152,2153,2156,2159],{"name":24,"slug":25,"type":16},{"name":2154,"slug":2155,"type":16},"Debugging","debugging",{"name":2157,"slug":2158,"type":16},"Logs","logs",{"name":2160,"slug":2161,"type":16},"Observability","observability",9427,"https:\u002F\u002Fgithub.com\u002Fawslabs\u002Fmcp","2026-07-12T08:37:22.601527",{"slug":2166,"name":2167,"fn":2168,"description":2169,"org":2170,"tags":2171,"stars":2162,"repoUrl":2163,"updatedAt":2185},"amazon-aurora-dsql","amazon aurora dsql","build applications with Aurora DSQL","Build with Aurora DSQL — manage schemas, execute queries, handle migrations, diagnose query plans, load data, and develop applications with a serverless, distributed SQL database. Covers IAM auth, multi-tenant patterns, MySQL-to-DSQL and PostgreSQL-to-DSQL schema conversion, FK replacement code generation, OCC retry patterns, ORM migration (Django\u002FHibernate\u002FRails), DDL operations, query plan explainability, SQL compatibility validation, and bulk data loading. Triggers on phrases like: DSQL, Aurora DSQL, create DSQL table, DSQL schema, migrate to DSQL, distributed SQL database, serverless PostgreSQL-compatible database, DSQL query plan, DSQL EXPLAIN ANALYZE, why is my DSQL query slow, DSQL foreign key, DSQL OCC retry, DSQL multi-region, load into DSQL, load CSV into DSQL, bulk load DSQL, aurora-dsql-loader.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2172,2175,2176,2179,2182],{"name":2173,"slug":2174,"type":16},"Aurora","aurora",{"name":24,"slug":25,"type":16},{"name":2177,"slug":2178,"type":16},"Database","database",{"name":2180,"slug":2181,"type":16},"Serverless","serverless",{"name":2183,"slug":2184,"type":16},"SQL","sql","2026-07-12T08:36:45.053393",{"slug":2187,"name":2188,"fn":2168,"description":2169,"org":2189,"tags":2190,"stars":2162,"repoUrl":2163,"updatedAt":2195},"aurora-dsql","aurora dsql",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2191,2192,2193,2194],{"name":24,"slug":25,"type":16},{"name":2177,"slug":2178,"type":16},{"name":2180,"slug":2181,"type":16},{"name":2183,"slug":2184,"type":16},"2026-07-12T08:36:42.694299",{"slug":2197,"name":2198,"fn":2168,"description":2169,"org":2199,"tags":2200,"stars":2162,"repoUrl":2163,"updatedAt":2208},"aws-dsql","aws dsql",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2201,2202,2203,2206,2207],{"name":24,"slug":25,"type":16},{"name":2177,"slug":2178,"type":16},{"name":2204,"slug":2205,"type":16},"Migration","migration",{"name":2180,"slug":2181,"type":16},{"name":2183,"slug":2184,"type":16},"2026-07-12T08:36:38.584057",{"slug":2210,"name":2211,"fn":2168,"description":2169,"org":2212,"tags":2213,"stars":2162,"repoUrl":2163,"updatedAt":2221},"distributed-postgres","distributed postgres",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2214,2215,2216,2219,2220],{"name":24,"slug":25,"type":16},{"name":2177,"slug":2178,"type":16},{"name":2217,"slug":2218,"type":16},"PostgreSQL","postgresql",{"name":2180,"slug":2181,"type":16},{"name":2183,"slug":2184,"type":16},"2026-07-12T08:36:46.530743",{"slug":2223,"name":2224,"fn":2168,"description":2169,"org":2225,"tags":2226,"stars":2162,"repoUrl":2163,"updatedAt":2231},"distributed-sql","distributed sql",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2227,2228,2229,2230],{"name":24,"slug":25,"type":16},{"name":2177,"slug":2178,"type":16},{"name":2180,"slug":2181,"type":16},{"name":2183,"slug":2184,"type":16},"2026-07-12T08:36:48.104182",{"slug":2233,"name":2233,"fn":2168,"description":2169,"org":2234,"tags":2235,"stars":2162,"repoUrl":2163,"updatedAt":2241},"dsql",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2236,2237,2238,2239,2240],{"name":24,"slug":25,"type":16},{"name":2177,"slug":2178,"type":16},{"name":2204,"slug":2205,"type":16},{"name":2180,"slug":2181,"type":16},{"name":2183,"slug":2184,"type":16},"2026-07-12T08:36:36.374512",{"slug":2243,"name":2243,"fn":2244,"description":2245,"org":2246,"tags":2247,"stars":2260,"repoUrl":2261,"updatedAt":2262},"cost-efficiency-analyzer","analyze cost efficiency and expenses","Analyzes cost structure, cost efficiency, and expense management from P&L data. Use when the user asks about costs, expenses, COGS, operating expenses, cost ratios, cost control, spending efficiency, margin compression from cost side, or wants to understand where money is going. Also use for \"are we spending too much\", \"cost breakdown\", \"expense analysis\", or \"how efficient are our operations\". NOT for revenue or top-line analysis.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2248,2251,2254,2257],{"name":2249,"slug":2250,"type":16},"Accounting","accounting",{"name":2252,"slug":2253,"type":16},"Analytics","analytics",{"name":2255,"slug":2256,"type":16},"Cost Optimization","cost-optimization",{"name":2258,"slug":2259,"type":16},"Finance","finance",3176,"https:\u002F\u002Fgithub.com\u002Fawslabs\u002Fagentcore-samples","2026-07-12T08:40:03.29555",{"slug":2264,"name":2264,"fn":2265,"description":2266,"org":2267,"tags":2268,"stars":2260,"repoUrl":2261,"updatedAt":2277},"executive-financial-briefing","generate executive financial briefings","Generates a concise executive-level financial briefing or summary suitable for a CEO, CFO, or board presentation. Use when the user asks for a summary, briefing, executive summary, board update, financial overview, financial health check, or \"how is the business doing\". Covers the full P&L picture in one page. Also use for \"give me the highlights\", \"what do I need to know\", or \"quick financial update\".",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2269,2270,2271,2274],{"name":24,"slug":25,"type":16},{"name":2258,"slug":2259,"type":16},{"name":2272,"slug":2273,"type":16},"Management","management",{"name":2275,"slug":2276,"type":16},"Reporting","reporting","2026-07-12T08:40:02.066471",{"slug":2279,"name":2279,"fn":2280,"description":2281,"org":2282,"tags":2283,"stars":2260,"repoUrl":2261,"updatedAt":2292},"multi-quarter-trend-analysis","analyze multi-quarter financial trends","Analyzes financial trends across multiple quarters by comparing P&L metrics over time. Use when the user wants to see trends, patterns, trajectories, or directional movement across 3 or more quarters. Also use for \"how are we trending\", \"show me the trend\", \"track performance over time\", \"quarter over quarter comparison across all quarters\", or any multi-period longitudinal analysis.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2284,2285,2286,2289],{"name":2252,"slug":2253,"type":16},{"name":2258,"slug":2259,"type":16},{"name":2287,"slug":2288,"type":16},"Financial Statements","financial-statements",{"name":2290,"slug":2291,"type":16},"Variance Analysis","variance-analysis","2026-07-12T08:40:00.79141",{"slug":2294,"name":2294,"fn":2295,"description":2296,"org":2297,"tags":2298,"stars":2260,"repoUrl":2261,"updatedAt":2307},"pdf","process and manipulate PDF documents","Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text\u002Ftables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting\u002Fdecrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2299,2302,2305],{"name":2300,"slug":2301,"type":16},"Automation","automation",{"name":2303,"slug":2304,"type":16},"Documents","documents",{"name":2306,"slug":2294,"type":16},"PDF","2026-07-12T08:41:44.135656",{"slug":2309,"name":2309,"fn":2310,"description":2311,"org":2312,"tags":2313,"stars":2260,"repoUrl":2261,"updatedAt":2320},"quarterly-kpi-calculator","calculate quarterly financial KPIs","Calculates quarterly financial KPIs from P&L data. P&L figures can be provided directly by the user or fetched from the financial data MCP server. Use when the user wants KPI calculations such as Gross Margin %, EBITDA Margin %, Operating Expense Ratio, or Revenue Growth % QoQ. Also use for quarterly performance review, P&L analysis, or interpreting financial ratios against benchmarks.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2314,2315,2316,2317],{"name":2249,"slug":2250,"type":16},{"name":2100,"slug":2101,"type":16},{"name":2258,"slug":2259,"type":16},{"name":2318,"slug":2319,"type":16},"KPI","kpi","2026-07-12T08:39:59.54971",150]