---
reliability: 4.7 # 5 − .8 vision-LLM read (the one generative stage; medical ACCURACY is the ceiling, not pipeline uptime) + .5 E2E radiology accuracy-audit showcase (#390); sam3/topaz stages optional; findings/impression are LLM text with deterministic gates
---

# Chest X-ray — AI second opinion (RESEARCH / EDUCATIONAL USE ONLY)

> **Read this first.** This playbook produces an AI-generated second opinion on a chest X-ray. It is **not a diagnostic device.** The output is for radiology learners, second-opinion triage, and research use only. Confirm every finding with a licensed radiologist before any clinical decision. **Do NOT upload PHI** — this deployment is not HIPAA-covered.

> Paste this whole file (with the BRIEF filled in) into Claude cowork, Claude Desktop, Claude Code, Cursor, Codex, or Antigravity — any surface where Storyboard MCP is connected and the medical-imaging domain is active (`set_active_domain({domain_id: "medical-imaging"})`).

## What you'll get

A structured radiology-style report on one chest X-ray, with:

- A **TECHNIQUE** line — modality, view, body part.
- A **FINDINGS** list — hedged anatomic observations, not diagnoses.
- An **IMPRESSION** — most likely interpretation + differential + recommended next step.
- The required disclaimer at the bottom.
- Optionally: a region overlay if you ask the agent to highlight a specific structure (uses `sam3`).
- Optionally: an upscaled view of a region of interest (uses `topaz-upscale`).

**Time:** ~3–5 minutes wall clock. **Your attention:** ~2 minutes across 3 approval gates. The agent stops for you at every meaningful step.

## Prep the image first

Before pasting this playbook, you need to upload one PNG of a chest X-ray. The agent's `dicom-prep` skill walks you through this if you ask, but the short version:

1. **De-identify the DICOM upstream** (strip name, MRN, DOB, dates, accession number; remove burned-in PHI). Open-source tool: `pydicom` Anonymizer, DicomCleaner, or `dcm2niix`.
2. **Convert to PNG** at native resolution (don't downsample below 1024×1024).
3. **Filename the modality:** e.g. `chest-xray-pa.png`, `chest-xray-ap-portable.png`.
4. **One view per card.** PA + lateral go as two separate uploads.

The agent will refuse to proceed if it sees obvious PHI burned into the image, or if the upload doesn't look like a chest X-ray.

## Tell the agent about the study

```yaml
view:           # PA | AP | lateral | AP-portable
patient_age:    # de-identified bucket, e.g. "adult", "elderly", "pediatric"
clinical_question:  # what the referring clinician asked. e.g. "rule out pneumonia",
                    # "evaluate for pneumothorax", "follow up known nodule".
                    # Hugely impacts what the agent looks for first.
priors_available:   # yes | no — if yes, upload them as separate cards
                    # (each as its own image upload) so the agent can compare.
known_history:  # one line, OPTIONAL, de-identified.
                # e.g. "30 pack-year smoker, chronic cough."
                # Skip if irrelevant or sensitive.
```

## How this works

Three gates. At each one the agent shows you what it found and asks one question. Answer in one word or one short phrase.

## How the agent should run this (interaction contract)

1. **CONFIRM (one message, ≤1 question):** restate in 1 line ("AI second opinion on a <view> chest X-ray, clinical question: <question> — educational use only, ~$0.05, ~3–5 min") + the disclaimer up front. The ONE question worth asking: the `clinical_question` if missing — it steers the whole read. Refuse immediately on PHI or wrong modality.
2. **PREVIEW CHECKPOINT:** the image QC + the structured **FINDINGS list** (cheap vision read) BEFORE the IMPRESSION — the user corrects/adds observations here, where a fix costs nothing; a wrong impression downstream of unchallenged findings is this playbook's worst failure.
3. **NARRATE:** each step is a fast synchronous read (~10–30s) — still say what's running ("ABCDE systematic read via gemini multimodal", "sam3 overlay on <region>") and report the verdict, never a silent gap.
4. **FAIL GRACEFULLY:** gemini multimodal refuses/returns a vague read → retry once with the systematic ABCDE framing → switch to `nemotron-omni`; `sam3` can't isolate a subtle opacity → skip the overlay (it's optional) and describe the localization in words; `topaz-upscale` fail → deliver the cropped region as-is. ≤2 retries; findings-without-overlay still ships.
5. **DELIVER:** TECHNIQUE/FINDINGS/IMPRESSION + the mandatory disclaimer + one honest line ("general-purpose vision model, not medical-trained — second-opinion-for-a-learner grade, n=1 read") + ONE next step ("upload the lateral view / a prior for comparison").

## The steps

### Step 0 — Confirm the image and the question

The agent reads back your BRIEF, confirms the uploaded image is a chest X-ray of the claimed view, and flags any issues (PHI artifacts, wrong modality, image too small, motion blur, underpenetration).

**STOP**: "Image and brief look right? (approve / re-upload / cancel)"

### Step 1 — Structured findings (no diagnosis yet)

The agent reads the uploaded X-ray with a multimodal vision model (`gemini-text` multimodal, or `nemotron-omni`) — NOT an object detector; pathology reads need a vision-language model, not YOLO. It works through the image systematically — the standard "ABCDE" radiology approach (Airway, Bones, Cardiac silhouette, Diaphragm, Effusions; plus lung fields, mediastinum, soft tissues, devices). Each finding is a single anatomic observation, hedged language, specific localization.

Example output style:
```
TECHNIQUE: PA chest radiograph, adequate inspiration, no rotation.

FINDINGS:
- Heart size at the upper limit of normal (cardiothoracic ratio ~0.50).
  Cannot reliably assess chamber enlargement on a single PA view.
- Patchy opacity in the right lower lobe, partially obscuring the right
  hemidiaphragm. Localization consistent with right lower lobe or right
  middle lobe involvement; cannot fully distinguish on this single view.
- No definite pleural effusion. Costophrenic angles sharp bilaterally.
- No pneumothorax visible.
- Mediastinum unremarkable.
- Bony thorax intact; no obvious fractures.
- No surgical devices or lines.
```

**STOP**: "Findings shown. Anything to add, expand, or correct? (approve / add [observation] / expand [finding] / disagree [finding])"

### Step 2 — Optional: highlight a region or upscale

If the user wants to focus on a specific structure, the agent can:
- **Outline** the structure with `create_media({ model_override: "sam3", source_url: <xray_url>, prompt: "right lower lobe opacity" })`. Returns the original image with a colored overlay on the segmented region. Useful for showing learners what the agent is referring to.
- **Upscale** a cropped region with `create_media({ model_override: "topaz-upscale", source_url: <crop_url> })`. Useful when the original image is small or underpenetrated.

If the user says "no, just give me the impression", skip this step.

**STOP**: "Want any overlays or upscales? (overlay [region] / upscale [region] / skip)"

### Step 3 — Impression + differential

The agent synthesizes the findings into an interpretation. Hedged language. Differential is ordered by likelihood. Recommended next step is always included.

Example:
```
IMPRESSION:
1. Right lower lobe / right middle lobe opacity, most consistent with
   focal pneumonia in the appropriate clinical context (e.g. fever,
   cough, sputum production).
2. Differential includes:
   - Atelectasis (less likely without volume loss signs)
   - Aspiration (if posterior segment of RLL on lateral view)
   - Less likely: pulmonary infarct, neoplasm
3. Recommended:
   - Clinical correlation with vitals, labs (CBC, CRP), and symptoms.
   - Lateral chest X-ray for better lobar localization, if not already obtained.
   - Follow-up imaging in 4–6 weeks (post-treatment) to confirm resolution
     and exclude an underlying lesion if symptoms persist.

────────────────────────────────────────────────────────────────────
AI-generated suggestion for educational / triage / second-opinion use
only. NOT a medical diagnosis. Confirm with a licensed clinician before
any clinical decision. PHI must NOT be uploaded — this deployment is
not HIPAA-covered.
────────────────────────────────────────────────────────────────────
```

**STOP**: "Impression complete. Approve as-is, or revise? (approve / revise [direction])"

## After the playbook finishes

The final report is in the chat thread. Copy / paste into your notes / teaching materials / second-opinion review. The agent does NOT push to any EHR, PACS, or external system.

## When the agent should refuse

- Image is not a chest X-ray → reframe and ask for the right modality.
- Image has obvious PHI → refuse, ask user to de-identify first.
- User asks for a definitive diagnosis ("just tell me if they have cancer") → reframe to the hedged finding + recommended next step pattern.
- User asks for treatment recommendations → out of scope. This playbook is imaging interpretation only.
- User asks to compare to an external database / patient registry → no such database exists; the agent is stateless beyond this session.

## Phase-2 extensions (not in this playbook)

When the network adds medical-trained capabilities (`chexnet-classify`, RadImageNet-derived models), this playbook will:
- Auto-classify the 14 standard CheXNet findings (pneumonia, cardiomegaly, effusion, etc.) and surface confidence scores.
- Compare to a patient's prior studies when uploaded together (no external database needed; just compare-card-to-card).
- Generate a structured BI-RADS-style impression for mammography (separate playbook).

Until then, the agent uses general-purpose vision (gemini-text multimodal) plus segmentation/upscaling tools. Quality is "useful as a second opinion for a learner" — not "diagnostic-grade."
