A Bug That Doesn't Crash Is Worse Than One That Does — Building a QUS Python Refresher
Description and use
A silent shape mismatch in a QUS simulation caused all scatterers to be omitted, producing a zero RF array without raising an exception. Correcting the pulse length restored proper signal generation.
Problem
A silent shape mismatch in a quantitative ultrasound (QUS) simulation caused all scatterers to be omitted, producing a zero RF array without raising an exception.
Outcome
The bug was identified and fixed, restoring correct scatterer placement and RF signal generation. The repo now demonstrates a complete QUS pipeline with reproducible notebooks.
Workflow
- 1. Define short time axis for pulse generation.
- 2. Generate Gaussian envelope pulse on short axis.
- 3. Create long time axis covering full imaging depth.
- 4. Sum delayed, scaled copies of pulse onto RF array using correct bounds check.
- 5. Verify scatterer placement by counting added echoes.
Evidence
With a pulse the same length as rf, idx + len(pulse) >= len(rf) for every idx >= 0 — the condition can never be true.
0 out of 200 scatterers get placed with the buggy pulse, versus 200 out of 200 with the correctly‑scoped one.
- Record date: 2026-09-08T11:01:08.636Z