[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AKMHWV21MS88EFBVCRFVB7":3,"skill-same:01M7AKMHWV21MS88EFBVCRFVB7":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M7AKMHWV21MS88EFBVCRFVB7","biomed-signals-and-medical-imaging",null,"Use when working with physiological signals or medical images: the signals and their frequency bands (ECG, EEG, EMG, PPG), the filtering constraints specific to this domain, detection and feature extraction; and medical imaging — modality physics for CT, MRI, ultrasound, PET and X-ray, the DICOM internals that produce silent errors, reconstruction, and registration and segmentation. Includes the router for the whole biomedical-engineering reference.","the-vibey-project\u002Fvibey","the-vibey-project","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F329298758?v=4","01M7AJHGZ9722CTJ4JNQZVRH0Q","the vibey project","01M7AJHGZVMG2K7TGXQ6XFHVG3",5,"MIT","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fbiomedical-engineering-technical\u002Fskills\u002Fbiomed-signals-and-medical-imaging\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: biomed-signals-and-medical-imaging\ndescription: \"Use when working with physiological signals or medical images: the signals and their frequency bands (ECG, EEG, EMG, PPG), the filtering constraints specific to this domain, detection and feature extraction; and medical imaging — modality physics for CT, MRI, ultrasound, PET and X-ray, the DICOM internals that produce silent errors, reconstruction, and registration and segmentation. Includes the router for the whole biomedical-engineering reference.\"\n---\n\n# Biomedical Engineering: Physiological Signal Processing and Medical Imaging\n\n> **Part 1 of 5** of the *Biomedical Engineering* reference (plugin `biomedical-engineering-technical`), covering §0–§2. Sibling skills: `biomed-clinical-data-ml-and-bioinformatics` (§3–§5), `biomed-structural-systems-biology-and-pharmacology` (§6–§9), `biomed-biomechanics-devices-and-biostatistics` (§10–§15), `biomed-reference` (§16–§20). Section numbers are shared across the set; a reference written as §N → `skill` points into that sibling skill.\n>\n> **Currency:** The physics, physiology and mathematics are stable; tool and pipeline recommendations shift slowly.\n\n> **Scope note.** This is the engineering and science. **Regulatory pathways, quality\n> systems, and lifecycle process are deliberately excluded** — they're a separate subject\n> and they'd swamp the technical content.\n>\n> **⚠️ GOTCHA** boxes mark where a silent wrong answer is produced — which in this domain\n> is the dangerous failure mode, not a crash.\n>\n> **The three technical facts that recur everywhere below:**\n> 1. **⚠️ Biological signals are non-stationary, and most DSP assumes stationarity.** Every\n>    windowing choice is an assumption about how long the physiology holds still (§1).\n> 2. **⚠️ Prevalence governs predictive value.** Sensitivity and specificity are properties\n>    of a test; PPV is a property of a test *in a population*. Confusing them is the single\n>    most common quantitative error in the field (§4.1 → `biomed-clinical-data-ml-and-bioinformatics`).\n> 3. **⚠️ Biological variability is the signal's competitor.** Between-subject variance\n>    usually exceeds the effect you're measuring, which is why normalization,\n>    within-subject designs, and mixed-effects models dominate (§15 → `biomed-biomechanics-devices-and-biostatistics`).\n\n---\n\n## §0. Routing\n\n| You want... | Go to |\n|---|---|\n| **Physiological signal processing** | **§1** |\n| Medical imaging physics and DICOM | §2 |\n| Registration and segmentation | §2.4 |\n| Clinical data structures | §3 → `biomed-clinical-data-ml-and-bioinformatics` |\n| **Clinical ML technicals** | **§4 → `biomed-clinical-data-ml-and-bioinformatics`** |\n| Bioinformatics: sequences and variants | §5 → `biomed-clinical-data-ml-and-bioinformatics` |\n| Structural biology | §6 → `biomed-structural-systems-biology-and-pharmacology` |\n| Systems biology and network models | §7 → `biomed-structural-systems-biology-and-pharmacology` |\n| **PK\u002FPD modeling** | **§8 → `biomed-structural-systems-biology-and-pharmacology`** |\n| Physiological models | §9 → `biomed-structural-systems-biology-and-pharmacology` |\n| Biomechanics | §10 → `biomed-biomechanics-devices-and-biostatistics` |\n| Biomaterials | §11 → `biomed-biomechanics-devices-and-biostatistics` |\n| Tissue engineering | §12 → `biomed-biomechanics-devices-and-biostatistics` |\n| **Neural interfaces and prosthetics** | **§13 → `biomed-biomechanics-devices-and-biostatistics`** |\n| Lab automation and instrumentation | §14 → `biomed-biomechanics-devices-and-biostatistics` |\n| Biostatistics | §15 → `biomed-biomechanics-devices-and-biostatistics` |\n| Misconceptions | §16 → `biomed-reference` |\n| Numbers | §17 → `biomed-reference` |\n| Books | §18 → `biomed-reference` |\n| Quick reference | §19 → `biomed-reference` |\n\n---\n\n## §1. Physiological Signal Processing\n\n### 1.1 The signals and their bands\n\n| Signal | Band | Amplitude | Sampling |\n|---|---|---|---|\n| **ECG** | 0.05–150 Hz (diagnostic) | 0.1–5 mV | ≥500 Hz diagnostic, 250 monitoring |\n| **EEG** | 0.5–100 Hz | ⚠️ **10–100 µV** | 250–1000 Hz |\n| **EMG** | 20–500 Hz | 50 µV–5 mV | ≥1000 Hz |\n| **PPG** | 0.5–8 Hz | — (AC\u002FDC ratio) | 25–500 Hz |\n| **Respiration** | 0.1–2 Hz | — | 25–50 Hz |\n| **EOG** | 0.1–30 Hz | 10–100 µV | 250 Hz |\n| **Intracortical spikes** | ⚠️ **300–6000 Hz** | 50–500 µV | ⚠️ **≥20–30 kHz** |\n| **LFP** | 1–300 Hz | 0.1–1 mV | 1–2 kHz |\n\n**EEG rhythms**: δ 0.5–4, θ 4–8, α 8–13, β 13–30, γ 30–100 Hz.\n\n### 1.2 ⚠️ The filtering constraints that are specific to this domain\n\n**⚠️ Powerline interference (50\u002F60 Hz) sits inside the ECG diagnostic band.** A notch\nfilter at 60 Hz removes real QRS spectral content — the QRS complex has energy up to\n~100 Hz. **A narrow notch rings; a wide notch distorts.** Prefer **adaptive filtering\nagainst a reference sinusoid**, or a very narrow IIR notch applied with zero phase.\n\n**⚠️ Phase distortion changes measured intervals, and intervals are diagnoses.**\nA causal high-pass at 0.5 Hz shifts and distorts the **ST segment** — and ST elevation is\nmyocardial infarction. **The standard fix: zero-phase forward-backward filtering\n(`filtfilt`), or a high-pass at 0.05 Hz for diagnostic ECG.**\n```\n⚠️ Monitoring ECG:  0.5–40 Hz  — acceptable, suppresses wander, NOT diagnostic\n⚠️ Diagnostic ECG:  0.05–150 Hz — required for ST analysis\n```\n**Confusing the two produces plausible, wrong ST measurements.**\n\n**Baseline wander** (respiration, electrode motion, ~0.15–0.3 Hz) — high-pass or\n**cubic-spline fitting through the PQ segments**, which avoids filter distortion entirely.\n\n**Motion artifact** overlaps the signal band and cannot be filtered out spectrally.\n⚠️ **Use an accelerometer as a reference channel and adaptive-cancel** — this is what\nwearable PPG does.\n\n### 1.3 Detection and feature extraction\n\n**Pan–Tompkins QRS detection** — the durable algorithm, and the structure is worth\nknowing because it generalizes:\n```\nbandpass 5–15 Hz  →  differentiate (emphasize slope)  →  square (rectify, emphasize\nlarge)  →  moving-window integrate (~150 ms)  →  adaptive dual thresholds\n   + ⚠️ 200 ms refractory (physiologically impossible to have two QRS closer)\n   + ⚠️ searchback: if no beat in 1.66× the running RR average, re-search at low threshold\n```\n**⚠️ The refractory period and searchback are the parts that make it robust** — they encode\nphysiology as constraints, which is the general lesson.\n\n**HRV** from the RR interval series: **time domain** (SDNN, **RMSSD** — ⚠️ **the\nparasympathetic index**, pNN50), **frequency domain** (LF 0.04–0.15 Hz, HF 0.15–0.4 Hz,\nLF\u002FHF ratio — ⚠️ **whose interpretation as \"sympathovagal balance\" is contested**), and\n**nonlinear** (Poincaré SD1\u002FSD2, sample entropy, DFA).\n**⚠️ RR series are irregularly sampled** — interpolate to a uniform grid before FFT, or use\nLomb–Scargle.\n\n**EEG artifact removal**: **ICA** is the workhorse — ⚠️ **eye blinks and cardiac artifact\nseparate into identifiable components** with characteristic scalp topographies.\n**Regression against EOG channels** for blinks. **ASR (Artifact Subspace\nReconstruction)** for motion.\n**⚠️ Reference choice changes everything**: average reference, linked mastoids, or\n**Laplacian** — and results are not comparable across reference schemes.\n\n**Time-frequency**, because the signals are non-stationary: **STFT** (⚠️ **fixed\nresolution trade — Heisenberg**), **wavelets** (⚠️ **Morlet for EEG oscillations; better\ntime resolution at high frequency**), **Hilbert–Huang\u002FEMD**, and **multitaper** for\nnoisy spectral estimates.\n\n---\n\n## §2. Medical Imaging\n\n### 2.1 Modality physics\n\n| Modality | Physics | Resolution | ⚠️ Constraint |\n|---|---|---|---|\n| **CT** | X-ray attenuation, filtered backprojection or iterative recon | 0.5–1 mm | ⚠️ **Ionizing dose; ALARA** |\n| **MRI** | Nuclear magnetic resonance, T1\u002FT2 relaxation | 1 mm | Long acquisition; ⚠️ **field is a physical hazard** |\n| **Ultrasound** | Acoustic reflection, ~1–15 MHz | 0.3–2 mm | ⚠️ **Operator-dependent; acoustic shadowing** |\n| **PET** | Positron annihilation, 511 keV coincidence | 4–5 mm | ⚠️ **Functional, not anatomical; needs CT for attenuation correction** |\n| **SPECT** | Single-photon gamma | 8–10 mm | Lower resolution than PET |\n| **OCT** | Low-coherence interferometry | ⚠️ **1–15 µm** | Penetration only ~1–2 mm |\n| **Digital pathology** | Whole-slide scanning | 0.25 µm\u002Fpx | ⚠️ **Gigapixel — pyramidal tiling mandatory** |\n\n**CT numbers** are in **Hounsfield units**: `HU = 1000 × (µ − µ_water)\u002Fµ_water`.\n⚠️ **Water = 0, air = −1000, dense bone ≈ +1000 to +3000.** Fixed and physical, which is\nwhy CT is quantitative and MRI intensity is not.\n\n**MRI contrast** comes from **TR and TE**: T1-weighted (short TR\u002FTE — fat bright, fluid\ndark), T2-weighted (long TR\u002FTE — ⚠️ **fluid bright, which is why pathology shows**), FLAIR\n(T2 with CSF suppressed), DWI\u002FADC (diffusion — ⚠️ **restricted diffusion in acute stroke\nwithin minutes**), and functional\u002FBOLD.\n\n> **⚠️ GOTCHA — MRI intensity has no absolute meaning.** Unlike CT's Hounsfield units, MRI\n> signal depends on scanner, coil, sequence, and shim. **Intensity values are not\n> comparable across scans without normalization** (histogram matching, z-scoring within a\n> tissue mask, or N4 bias-field correction first). **Training an ML model on raw MRI\n> intensities across sites is a well-known way to learn the scanner instead of the\n> disease.**\n\n### 2.2 ⚠️ DICOM internals that produce silent errors\n\n**Hierarchy**: Patient → Study → Series → Instance, identified by **UIDs**.\n⚠️ **UIDs must be globally unique; generating them incorrectly corrupts archives\nirreversibly.** Use a registered root plus a unique suffix.\n\n**The specific traps:**\n- **⚠️ Rescale.** `HU = pixel_value × RescaleSlope + RescaleIntercept`. **Stored pixels are\n  not HU.** Skipping this is the most common CT bug and produces confidently wrong\n  measurements.\n- **⚠️ Photometric interpretation.** `MONOCHROME1` = minimum is white; `MONOCHROME2` =\n  minimum is black. **Getting it wrong inverts the image** and a radiologist will notice\n  but a model won't.\n- **⚠️ Orientation.** `ImageOrientationPatient` (two direction cosine vectors) and\n  `ImagePositionPatient` define anatomical space. **Left\u002Fright confusion means the wrong\n  side, and wrong-side surgery is a real event class.** Always derive laterality from the\n  geometry, never from the display convention.\n- **Slice spacing ≠ slice thickness.** `SliceThickness` is the acquisition; spacing must be\n  computed from consecutive `ImagePositionPatient` values. ⚠️ **They disagree with gaps or\n  overlap**, and using the wrong one distorts volumes.\n- **Window\u002Flevel** (`WindowCenter`, `WindowWidth`) is display only — ⚠️ **never bake it\n  into stored data you intend to analyse.**\n- **Multi-frame and enhanced DICOM** put per-frame attributes in functional group\n  sequences, not at the top level.\n\n**⚠️ De-identification is harder than stripping tags.** PHI hides in **private tags**,\n**burned-in pixel annotation**, `StudyDescription` free text, and ⚠️ **the face itself —\nfacial reconstruction from head CT\u002FMRI is demonstrated, so \"defacing\" is a genuine\nrequirement for shared neuroimaging.**\n\n### 2.3 Reconstruction\n**Filtered backprojection** — the Radon transform inverted, with a **ramp filter** in\nfrequency (⚠️ **the ramp amplifies high-frequency noise; apodize with Shepp-Logan or\nHann**). **Iterative reconstruction** (ART, SART, MBIR) is slower and permits substantially\nlower dose. **⚠️ Undersampling produces streak artifacts**; compressed sensing exploits\nsparsity to recover from fewer projections, which is what makes fast MRI possible.\n\n### 2.4 Registration and segmentation\n\n**Registration** = find the transform aligning two images:\n```\nT* = argmin_T  S(I_fixed, T(I_moving)) + λR(T)\n```\n**Transform models**: rigid (6 DOF) → affine (12) → **deformable** (B-spline free-form,\ndiffeomorphic\u002FLDDMM, Demons).\n**Similarity metrics**: SSD (⚠️ **same modality only**), normalized cross-correlation, and\n⚠️ **mutual information — the standard for multimodal (CT↔MRI), because it makes no\nassumption about intensity relationship, only statistical dependence.**\n```\nMI(A,B) = H(A) + H(B) − H(A,B)\n```\n**⚠️ Practical requirements**: multi-resolution pyramids (avoids local minima), and\n**regularization to keep the deformation invertible** — an unregularized deformable\nregistration will happily fold tissue through itself.\n\n**Segmentation**: thresholding → region growing → **level sets \u002F active contours** →\n**atlas-based** → **deep learning**.\n⚠️ **nnU-Net remains the strong baseline that beats most novel architectures on medical\nsegmentation** — its contribution is automated configuration of preprocessing, patch size,\nand augmentation, which matters more than architecture.\n**Metrics**: **Dice** `2|A∩B|\u002F(|A|+|B|)`, **IoU**, **Hausdorff distance** (⚠️ **worst-case\nboundary error — the one that matters clinically, because Dice is insensitive to a small\nbut catastrophic boundary error**), and **surface Dice**.\n\n**⚠️ Class imbalance is severe** — a lesion may be 0.1% of voxels. **Dice loss or\nTversky loss rather than cross-entropy**, and patch sampling biased toward foreground.\n\n**Toolkits**: ITK\u002FSimpleITK, ANTs (registration), 3D Slicer, MONAI, nnU-Net, FSL and\nFreeSurfer (neuro), pydicom, dcm4che, OHIF, OpenSlide (pathology).\n","# Biomedical Engineering: Physiological Signal Processing and Medical Imaging\n\n> **Part 1 of 5** of the *Biomedical Engineering* reference (plugin `biomedical-engineering-technical`), covering §0–§2. Sibling skills: `biomed-clinical-data-ml-and-bioinformatics` (§3–§5), `biomed-structural-systems-biology-and-pharmacology` (§6–§9), `biomed-biomechanics-devices-and-biostatistics` (§10–§15), `biomed-reference` (§16–§20). Section numbers are shared across the set; a reference written as §N → `skill` points into that sibling skill.\n>\n> **Currency:** The physics, physiology and mathematics are stable; tool and pipeline recommendations shift slowly.\n\n> **Scope note.** This is the engineering and science. **Regulatory pathways, quality\n> systems, and lifecycle process are deliberately excluded** — they're a separate subject\n> and they'd swamp the technical content.\n>\n> **⚠️ GOTCHA** boxes mark where a silent wrong answer is produced — which in this domain\n> is the dangerous failure mode, not a crash.\n>\n> **The three technical facts that recur everywhere below:**\n> 1. **⚠️ Biological signals are non-stationary, and most DSP assumes stationarity.** Every\n>    windowing choice is an assumption about how long the physiology holds still (§1).\n> 2. **⚠️ Prevalence governs predictive value.** Sensitivity and specificity are properties\n>    of a test; PPV is a property of a test *in a population*. Confusing them is the single\n>    most common quantitative error in the field (§4.1 → `biomed-clinical-data-ml-and-bioinformatics`).\n> 3. **⚠️ Biological variability is the signal's competitor.** Between-subject variance\n>    usually exceeds the effect you're measuring, which is why normalization,\n>    within-subject designs, and mixed-effects models dominate (§15 → `biomed-biomechanics-devices-and-biostatistics`).\n\n---\n\n## §0. Routing\n\n| You want... | Go to |\n|---|---|\n| **Physiological signal processing** | **§1** |\n| Medical imaging physics and DICOM | §2 |\n| Registration and segmentation | §2.4 |\n| Clinical data structures | §3 → `biomed-clinical-data-ml-and-bioinformatics` |\n| **Clinical ML technicals** | **§4 → `biomed-clinical-data-ml-and-bioinformatics`** |\n| Bioinformatics: sequences and variants | §5 → `biomed-clinical-data-ml-and-bioinformatics` |\n| Structural biology | §6 → `biomed-structural-systems-biology-and-pharmacology` |\n| Systems biology and network models | §7 → `biomed-structural-systems-biology-and-pharmacology` |\n| **PK\u002FPD modeling** | **§8 → `biomed-structural-systems-biology-and-pharmacology`** |\n| Physiological models | §9 → `biomed-structural-systems-biology-and-pharmacology` |\n| Biomechanics | §10 → `biomed-biomechanics-devices-and-biostatistics` |\n| Biomaterials | §11 → `biomed-biomechanics-devices-and-biostatistics` |\n| Tissue engineering | §12 → `biomed-biomechanics-devices-and-biostatistics` |\n| **Neural interfaces and prosthetics** | **§13 → `biomed-biomechanics-devices-and-biostatistics`** |\n| Lab automation and instrumentation | §14 → `biomed-biomechanics-devices-and-biostatistics` |\n| Biostatistics | §15 → `biomed-biomechanics-devices-and-biostatistics` |\n| Misconceptions | §16 → `biomed-reference` |\n| Numbers | §17 → `biomed-reference` |\n| Books | §18 → `biomed-reference` |\n| Quick reference | §19 → `biomed-reference` |\n\n---\n\n## §1. Physiological Signal Processing\n\n### 1.1 The signals and their bands\n\n| Signal | Band | Amplitude | Sampling |\n|---|---|---|---|\n| **ECG** | 0.05–150 Hz (diagnostic) | 0.1–5 mV | ≥500 Hz diagnostic, 250 monitoring |\n| **EEG** | 0.5–100 Hz | ⚠️ **10–100 µV** | 250–1000 Hz |\n| **EMG** | 20–500 Hz | 50 µV–5 mV | ≥1000 Hz |\n| **PPG** | 0.5–8 Hz | — (AC\u002FDC ratio) | 25–500 Hz |\n| **Respiration** | 0.1–2 Hz | — | 25–50 Hz |\n| **EOG** | 0.1–30 Hz | 10–100 µV | 250 Hz |\n| **Intracortical spikes** | ⚠️ **300–6000 Hz** | 50–500 µV | ⚠️ **≥20–30 kHz** |\n| **LFP** | 1–300 Hz | 0.1–1 mV | 1–2 kHz |\n\n**EEG rhythms**: δ 0.5–4, θ 4–8, α 8–13, β 13–30, γ 30–100 Hz.\n\n### 1.2 ⚠️ The filtering constraints that are specific to this domain\n\n**⚠️ Powerline interference (50\u002F60 Hz) sits inside the ECG diagnostic band.** A notch\nfilter at 60 Hz removes real QRS spectral content — the QRS complex has energy up to\n~100 Hz. **A narrow notch rings; a wide notch distorts.** Prefer **adaptive filtering\nagainst a reference sinusoid**, or a very narrow IIR notch applied with zero phase.\n\n**⚠️ Phase distortion changes measured intervals, and intervals are diagnoses.**\nA causal high-pass at 0.5 Hz shifts and distorts the **ST segment** — and ST elevation is\nmyocardial infarction. **The standard fix: zero-phase forward-backward filtering\n(`filtfilt`), or a high-pass at 0.05 Hz for diagnostic ECG.**\n```\n⚠️ Monitoring ECG:  0.5–40 Hz  — acceptable, suppresses wander, NOT diagnostic\n⚠️ Diagnostic ECG:  0.05–150 Hz — required for ST analysis\n```\n**Confusing the two produces plausible, wrong ST measurements.**\n\n**Baseline wander** (respiration, electrode motion, ~0.15–0.3 Hz) — high-pass or\n**cubic-spline fitting through the PQ segments**, which avoids filter distortion entirely.\n\n**Motion artifact** overlaps the signal band and cannot be filtered out spectrally.\n⚠️ **Use an accelerometer as a reference channel and adaptive-cancel** — this is what\nwearable PPG does.\n\n### 1.3 Detection and feature extraction\n\n**Pan–Tompkins QRS detection** — the durable algorithm, and the structure is worth\nknowing because it generalizes:\n```\nbandpass 5–15 Hz  →  differentiate (emphasize slope)  →  square (rectify, emphasize\nlarge)  →  moving-window integrate (~150 ms)  →  adaptive dual thresholds\n   + ⚠️ 200 ms refractory (physiologically impossible to have two QRS closer)\n   + ⚠️ searchback: if no beat in 1.66× the running RR average, re-search at low threshold\n```\n**⚠️ The refractory period and searchback are the parts that make it robust** — they encode\nphysiology as constraints, which is the general lesson.\n\n**HRV** from the RR interval series: **time domain** (SDNN, **RMSSD** — ⚠️ **the\nparasympathetic index**, pNN50), **frequency domain** (LF 0.04–0.15 Hz, HF 0.15–0.4 Hz,\nLF\u002FHF ratio — ⚠️ **whose interpretation as \"sympathovagal balance\" is contested**), and\n**nonlinear** (Poincaré SD1\u002FSD2, sample entropy, DFA).\n**⚠️ RR series are irregularly sampled** — interpolate to a uniform grid before FFT, or use\nLomb–Scargle.\n\n**EEG artifact removal**: **ICA** is the workhorse — ⚠️ **eye blinks and cardiac artifact\nseparate into identifiable components** with characteristic scalp topographies.\n**Regression against EOG channels** for blinks. **ASR (Artifact Subspace\nReconstruction)** for motion.\n**⚠️ Reference choice changes everything**: average reference, linked mastoids, or\n**Laplacian** — and results are not comparable across reference schemes.\n\n**Time-frequency**, because the signals are non-stationary: **STFT** (⚠️ **fixed\nresolution trade — Heisenberg**), **wavelets** (⚠️ **Morlet for EEG oscillations; better\ntime resolution at high frequency**), **Hilbert–Huang\u002FEMD**, and **multitaper** for\nnoisy spectral estimates.\n\n---\n\n## §2. Medical Imaging\n\n### 2.1 Modality physics\n\n| Modality | Physics | Resolution | ⚠️ Constraint |\n|---|---|---|---|\n| **CT** | X-ray attenuation, filtered backprojection or iterative recon | 0.5–1 mm | ⚠️ **Ionizing dose; ALARA** |\n| **MRI** | Nuclear magnetic resonance, T1\u002FT2 relaxation | 1 mm | Long acquisition; ⚠️ **field is a physical hazard** |\n| **Ultrasound** | Acoustic reflection, ~1–15 MHz | 0.3–2 mm | ⚠️ **Operator-dependent; acoustic shadowing** |\n| **PET** | Positron annihilation, 511 keV coincidence | 4–5 mm | ⚠️ **Functional, not anatomical; needs CT for attenuation correction** |\n| **SPECT** | Single-photon gamma | 8–10 mm | Lower resolution than PET |\n| **OCT** | Low-coherence interferometry | ⚠️ **1–15 µm** | Penetration only ~1–2 mm |\n| **Digital pathology** | Whole-slide scanning | 0.25 µm\u002Fpx | ⚠️ **Gigapixel — pyramidal tiling mandatory** |\n\n**CT numbers** are in **Hounsfield units**: `HU = 1000 × (µ − µ_water)\u002Fµ_water`.\n⚠️ **Water = 0, air = −1000, dense bone ≈ +1000 to +3000.** Fixed and physical, which is\nwhy CT is quantitative and MRI intensity is not.\n\n**MRI contrast** comes from **TR and TE**: T1-weighted (short TR\u002FTE — fat bright, fluid\ndark), T2-weighted (long TR\u002FTE — ⚠️ **fluid bright, which is why pathology shows**), FLAIR\n(T2 with CSF suppressed), DWI\u002FADC (diffusion — ⚠️ **restricted diffusion in acute stroke\nwithin minutes**), and functional\u002FBOLD.\n\n> **⚠️ GOTCHA — MRI intensity has no absolute meaning.** Unlike CT's Hounsfield units, MRI\n> signal depends on scanner, coil, sequence, and shim. **Intensity values are not\n> comparable across scans without normalization** (histogram matching, z-scoring within a\n> tissue mask, or N4 bias-field correction first). **Training an ML model on raw MRI\n> intensities across sites is a well-known way to learn the scanner instead of the\n> disease.**\n\n### 2.2 ⚠️ DICOM internals that produce silent errors\n\n**Hierarchy**: Patient → Study → Series → Instance, identified by **UIDs**.\n⚠️ **UIDs must be globally unique; generating them incorrectly corrupts archives\nirreversibly.** Use a registered root plus a unique suffix.\n\n**The specific traps:**\n- **⚠️ Rescale.** `HU = pixel_value × RescaleSlope + RescaleIntercept`. **Stored pixels are\n  not HU.** Skipping this is the most common CT bug and produces confidently wrong\n  measurements.\n- **⚠️ Photometric interpretation.** `MONOCHROME1` = minimum is white; `MONOCHROME2` =\n  minimum is black. **Getting it wrong inverts the image** and a radiologist will notice\n  but a model won't.\n- **⚠️ Orientation.** `ImageOrientationPatient` (two direction cosine vectors) and\n  `ImagePositionPatient` define anatomical space. **Left\u002Fright confusion means the wrong\n  side, and wrong-side surgery is a real event class.** Always derive laterality from the\n  geometry, never from the display convention.\n- **Slice spacing ≠ slice thickness.** `SliceThickness` is the acquisition; spacing must be\n  computed from consecutive `ImagePositionPatient` values. ⚠️ **They disagree with gaps or\n  overlap**, and using the wrong one distorts volumes.\n- **Window\u002Flevel** (`WindowCenter`, `WindowWidth`) is display only — ⚠️ **never bake it\n  into stored data you intend to analyse.**\n- **Multi-frame and enhanced DICOM** put per-frame attributes in functional group\n  sequences, not at the top level.\n\n**⚠️ De-identification is harder than stripping tags.** PHI hides in **private tags**,\n**burned-in pixel annotation**, `StudyDescription` free text, and ⚠️ **the face itself —\nfacial reconstruction from head CT\u002FMRI is demonstrated, so \"defacing\" is a genuine\nrequirement for shared neuroimaging.**\n\n### 2.3 Reconstruction\n**Filtered backprojection** — the Radon transform inverted, with a **ramp filter** in\nfrequency (⚠️ **the ramp amplifies high-frequency noise; apodize with Shepp-Logan or\nHann**). **Iterative reconstruction** (ART, SART, MBIR) is slower and permits substantially\nlower dose. **⚠️ Undersampling produces streak artifacts**; compressed sensing exploits\nsparsity to recover from fewer projections, which is what makes fast MRI possible.\n\n### 2.4 Registration and segmentation\n\n**Registration** = find the transform aligning two images:\n```\nT* = argmin_T  S(I_fixed, T(I_moving)) + λR(T)\n```\n**Transform models**: rigid (6 DOF) → affine (12) → **deformable** (B-spline free-form,\ndiffeomorphic\u002FLDDMM, Demons).\n**Similarity metrics**: SSD (⚠️ **same modality only**), normalized cross-correlation, and\n⚠️ **mutual information — the standard for multimodal (CT↔MRI), because it makes no\nassumption about intensity relationship, only statistical dependence.**\n```\nMI(A,B) = H(A) + H(B) − H(A,B)\n```\n**⚠️ Practical requirements**: multi-resolution pyramids (avoids local minima), and\n**regularization to keep the deformation invertible** — an unregularized deformable\nregistration will happily fold tissue through itself.\n\n**Segmentation**: thresholding → region growing → **level sets \u002F active contours** →\n**atlas-based** → **deep learning**.\n⚠️ **nnU-Net remains the strong baseline that beats most novel architectures on medical\nsegmentation** — its contribution is automated configuration of preprocessing, patch size,\nand augmentation, which matters more than architecture.\n**Metrics**: **Dice** `2|A∩B|\u002F(|A|+|B|)`, **IoU**, **Hausdorff distance** (⚠️ **worst-case\nboundary error — the one that matters clinically, because Dice is insensitive to a small\nbut catastrophic boundary error**), and **surface Dice**.\n\n**⚠️ Class imbalance is severe** — a lesion may be 0.1% of voxels. **Dice loss or\nTversky loss rather than cross-entropy**, and patch sampling biased toward foreground.\n\n**Toolkits**: ITK\u002FSimpleITK, ANTs (registration), 3D Slicer, MONAI, nnU-Net, FSL and\nFreeSurfer (neuro), pydicom, dcm4che, OHIF, OpenSlide (pathology).\n",{"name":5,"description":7},"develop","ae32736a1aabddabca5d2c96d665aa0ebc7d8700","src\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fbiomedical-engineering-technical\u002Fskills\u002Fbiomed-signals-and-medical-imaging",3,"https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey","https:\u002F\u002Fthe-vibey-project.github.io\u002Fvibey\u002F","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project","https:\u002F\u002Fvibewithadam.matthewsteinberger.com","freedom for software engineers","2026-11-15 05:47:42",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add the-vibey-project\u002Fvibey --skill biomed-signals-and-medical-imaging",{"tool":40,"command":41},"bunx","bunx skills add the-vibey-project\u002Fvibey --skill biomed-signals-and-medical-imaging",{"tool":43,"command":44},"pnpm","pnpm dlx skills add the-vibey-project\u002Fvibey --skill biomed-signals-and-medical-imaging","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fbiomedical-engineering-technical\u002Fskills\u002Fbiomed-signals-and-medical-imaging\u002FSKILL.md",true,[],[49,56,63,70,77,84],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M7AT1FQJAE1FQYAMDTF490Y4","white-paper-writing","Use when writing white papers, technical reports, policy documents, thought leadership pieces, or any long-form authoritative document. Triggers on requests to write, structure, outline, or review white papers, technical reports, position papers, policy briefs, or evidence-driven arguments. Also use for B2B content marketing strategy, technical documentation requiring authority, academic-style reports, or any document that must educate while persuading. Use when someone asks \"how should I structure this\" for a long-form document.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Fwhite-paper-writing\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7AT16BJRJJKK2MASXRZS76G","prose-technical-mechanics","Use when editing or writing prose at a technical\u002Fmechanical level: choosing between Anglo-Saxon and Latinate diction, placing information in topic vs stress positions, writing periodic vs cumulative sentences, handling sentence rhythm, punctuation as logic, transitions, paragraph structure, or phonesthetics. Use when someone wants to understand WHY prose works or doesn't, not just surface-level style advice. Triggers on word choice, sentence structure, emphasis, rhythm, diction, or any deep writing mechanics question.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Fprose-technical-mechanics\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7AT0W9HT0ZZ9Y287NW99MR3","prose-mechanics","Use when writing, editing, or analyzing prose style; when trying to avoid generic AI-sounding writing; when applying specific prose styles such as journalistic, academic, narrative, KJV biblical, Hemingway plain, Latinate\u002FJamesian, Orwellian, Augustan, Victorian, Early Modern (Bacon, Browne, Milton), or free indirect discourse; or when coaching someone on writing voice and mechanics. Triggers on any request to improve, analyze, or write in a specific prose style, to fix \"AI-sounding\" writing, to make prose more vivid or concrete, to vary sentence rhythm, or to understand how a particular writer achieves their effects.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Fprose-mechanics\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7AT0KR635JX66X2X6F3E2CP","narrative-structure","Use when structuring stories, pitches, presentations, white papers, or any persuasive narrative; analyzing the hero's journey in fiction or non-fiction; applying StoryBrand for business communication; designing narrative arcs for thought leadership; or understanding Vogler, Snyder, Propp, or Campbell frameworks. Triggers on any narrative structure, storytelling, pitch structure, StoryBrand, hero's journey, three-act structure, Freytag, Save the Cat, narrative arc, or \"how should I structure this story\u002Fpitch\u002Fpresentation\" request.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Fnarrative-structure\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7AT0AKGW09NKKZDYBT8VRDE","legal-brief-writing","Use when writing legal briefs, motions, or any court filing; when analyzing judicial cognition and persuasion; when applying elite brief-writing techniques from Roberts, Clement, Kagan, Garner; or when structuring legal arguments for maximum persuasion. Also use for autistic\u002Fneurodivergent advocates who need to understand how their natural communication style maps to elite legal advocacy. Triggers on any legal writing, brief drafting, motion preparation, or legal argument structuring request.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Flegal-brief-writing\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7AT00VWPS4Q8B5VEMXX9NQT","journal-publishability-criteria","Use whenever a research paper, article or preprint is being written, revised, reviewed or published, and specifically before every publication of docs\u002Fpaper.md. Covers what legitimate journals actually gate on, in order of gating — the editor's desk screen (scope, novelty, package problems), what reviewers judge (methodological soundness, claims the evidence can carry, statistical and qualitative reporting), EQUATOR reporting guidelines, the ICMJE authorship criteria, COPE's view of text recycling, the near-universal generative-AI policy (no AI author, disclosure, author responsibility), TOP 2025 transparency standards, how to verify a journal is legitimate, submitting without an institution, and a pre-submission checklist. Triggers on requests to evaluate, review, prepare or submit a paper, to judge publishability, to write a declarations or data-availability section, to disclose AI use, or to check a journal.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Fjournal-publishability-criteria\u002FSKILL.md",[],[]]