Terminal
Terminal/Skill
Advises on medical imaging study design, including preprocessing, registration target, biomarker choice, DICOM de-identification and harmonization.
By Amazon Web Services
Works with
npx skills add awslabs/hcls-agent-skills --skill imaging-study-designThis skill encodes methodology for designing medical imaging studies and selecting imaging biomarkers. It guides decisions about preprocessing, registration targets, de-identification, biomarker choice, radiomics stability, and multi-site harmonization. It is a reasoning skill — it does not generate pipeline code. For concrete tooling (FreeSurfer, FSL, ANTs, PyRadiomics, nnU-Net, MONAI), pair this skill with a pipeline skill after the study design is settled.
The central principle: preprocessing and biomarker choice must preserve the signal that answers the clinical question. A pipeline that is standard for one question (e.g., MNI registration for group comparison) can destroy the signal for another (e.g., individual atrophy in longitudinal studies).
Invoke this skill when planning an imaging study or critiquing an existing imaging pipeline. Typical prompts:
Use the Decision Framework at the end of Core Concepts to structure any imaging study question.
There is no universal "preprocess MRI" recipe. The pipeline must match the analysis target.
| Downstream goal | Preprocessing priorities | What to avoid |
|---|---|---|
| Group comparison (cross-sectional) | Register to common template (MNI/SPM), smooth, modulate if VBM | Native-space-only analysis |
| Longitudinal atrophy / change | Rigid register follow-ups to subject baseline, then (optionally) baseline to template | Registering each timepoint independently to MNI |
| Lesion segmentation | Bias field correction, skull strip, intensity normalization; registration often optional | Aggressive smoothing that blurs lesion edges |
| Radiomics / texture | Standardize acquisition first (voxel size, reconstruction, binning); resample to isotropic; discretize intensity deterministically | Mixing protocols without harmonization; default-bin radiomics on heterogeneous data |
| Functional MRI | Slice-timing (if long TR), motion correction, distortion correction, coregister to anatomical, normalize if group, bandpass filter as appropriate | Normalizing before motion scrubbing; smoothing before ICA denoising |
| Diffusion MRI | Denoise, Gibbs unringing, eddy + motion correction, bias correction, then tensor/ODF fitting | Reordering these steps; skipping distortion correction when reverse-PE is available |
The registration target encodes an assumption about where the signal lives.
Heuristic: ask "if I warp this image, do I still measure the thing I care about?" If the answer is no (volume change, lesion shape, tumor texture), keep the measurement in native or within-subject space.
Standard tag-based de-identification (DICOM PS 3.15 Basic Application Level Confidentiality Profile) is necessary but not sufficient. Residual PHI risks:
0029,xx10 / 0029,xx20) may contain protocol and sometimes patient info; GE private blocks (e.g., 0043,xx) and Philips MR private tags can hold acquisition metadata that includes identifiers or free-text. Default DICOM profiles may retain or only partially scrub these. Decide per-vendor: strip all private tags unless a specific block is needed, and validate.A defensible de-identification plan specifies: which profile is applied, how private tags are handled, whether pixel data is inspected, how SR/PDF objects are handled, UID remapping strategy, defacing policy, and a QC sample checked by a human.
Match the biomarker to the biology being probed.
| Indication | Modality / contrast | Biomarker | Rationale |
|---|---|---|---|
| Alzheimer's disease, MCI | Structural T1 MRI | Hippocampal volume, cortical thickness, ventricular volume | Measures neurodegeneration directly |
| Multiple sclerosis | T2/FLAIR + T1 | Lesion load, lesion count, brain parenchymal fraction, cord area | Disease burden and atrophy |
| White matter disease, DAI, schizophrenia | Diffusion MRI | FA, MD, RD, AD (tract-based or voxelwise) | Microstructural integrity |
| Acute stroke | DWI + PWI | DWI lesion volume, PWI-DWI mismatch, CBF | Core vs penumbra triage |
| Brain tumor (glioma) | DSC/DCE perfusion, MRS, diffusion | rCBV, Ktrans, ADC, NAA/Cho ratio | Grade, treatment response, pseudoprogression vs recurrence |
| Presurgical planning (epilepsy, tumor) | Task and resting-state fMRI, DTI tractography | Language/motor activation maps, tract-to-lesion distance | Functional localization |
| Neuronal integrity (various) | 1H-MRS | NAA/Cr, Cho/Cr, mI/Cr | Metabolic markers of neuronal loss, membrane turnover |
| Oncology outside brain | CT, PET/CT, mpMRI | Volumetry, SUVmax/SUVpeak, radiomic signatures, ADC | Staging, response (RECIST, PERCIST) |
| Cardiac | Cine, LGE, T1/T2 mapping | EF, strain, LGE burden, native T1, ECV | Function, fibrosis, edema |
Selection criteria: (1) biological plausibility — is this biomarker mechanistically linked to the question? (2) measurability — does the available scanner/protocol yield adequate SNR and reliability? (3) validity — has it been validated for this indication and this population? (4) practicality — can it be obtained within the study's scan time and cost?
Radiomics features are notoriously unstable. A signature built on unstable features will not generalize.
Multi-site studies trade statistical power for between-site heterogeneity. Plan for the heterogeneity.
Before writing a single line of pipeline code, answer four questions:
If any of the four is unclear or contested, resolve it before building the pipeline. Most imaging study failures are failures of step 1 or 3, not failures of the tool.
Wrong: Registering each longitudinal timepoint independently to MNI Right: Build a within-subject template or rigidly register follow-ups to baseline first; only then normalize to MNI if needed Why: Subject-specific atrophy is absorbed into the warp field and the longitudinal change signal is lost
Wrong: Relying solely on tag-based DICOM de-identification Right: Include pixel inspection, private-tag policy, SR/PDF handling, UID remapping, and defacing in the de-identification plan Why: Burned-in PHI in pixels, private tags, SR/PDF narratives, and date-encoded UIDs all survive a naive tag-level scrub
Wrong: Building a radiomics model using features with test-retest ICC < 0.75 Right: Filter features by ICC ≥ 0.75 (preferably ≥ 0.9) and by segmentation robustness before any supervised selection Why: Unstable features poison reproducibility — signatures built on them will not generalize to external cohorts
Wrong: Ignoring scanner/site effects in multi-site imaging studies Right: Standardize protocols, apply ComBat or mixed-effects modeling, include site as a covariate, and pre-register the analysis plan Why: Site confounding can fully explain apparent biological effects, producing false-positive findings
Wrong: Fitting dozens of radiomics features to a dataset with few outcome events Right: Enforce EPV ≥ 10 (events per variable), use nested cross-validation, and report external validation Why: Over-fitting produces signatures that appear strong internally but fail completely on any external cohort
Wrong: Choosing an imaging biomarker by convenience rather than biological relevance Right: Run the Decision Framework (question → modality → biomarker) — the biomarker should be mechanistically linked to the clinical question Why: Using whole-brain volume when the question is hippocampal atrophy, or ADC when the question is perfusion, measures the wrong thing
Wrong: Deciding QC exclusion thresholds after seeing the analysis results Right: Pre-specify QC metrics and exclusion thresholds before analysis; report inclusion/exclusion counts transparently Why: Post-hoc threshold selection biases the study toward desired results
Wrong: Smoothing or interpolating through a lesion or tumor ROI Right: Keep ROI-based measurements in native space, or use lesion-filling / cost-function masking before template normalization Why: Smoothing across lesion boundaries corrupts texture features and blurs lesion edges, invalidating radiomics and lesion-aware analyses