A Bug That Doesn't Crash Is Worse Than One That Does — Building a QUS Python Refresher
Описание и применение
Скрытая ошибка в длине импульса в симуляции количественной ультразвуковой диагностики приводила к тому, что все рассеиватели не размещались, а массив RF оставался нулевым. Исправление привело к корректному построению сигнала.
Задача
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.
Результат
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.
Рабочий процесс
- 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.
Доказательства
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.
- Дата записи: 2026-09-08T11:01:08.636Z