---
title: 'The-Bodega: ULM Simulation Toolbox'
url: https://www.emergentmind.com/topics/the-bodega
type: topic
---

# The-Bodega: ULM Simulation Toolbox

Searching arXiv for the exact topic and closely related work to ground the article.
The-Bodega is an open-source, MATLAB-based simulation toolbox for Ultrasound Localization Microscopy (ULM), designed to generate ground-truth datasets that mimic realistic in vivo ULM acquisitions while preserving exact knowledge of vessel architecture, microbubble positions, velocities, and hemodynamic conditions [2509.08149]. It links a hemodynamic graph model of the microvasculature, a sequential Monte Carlo microbubble simulator, an ultrasound forward model via SIMUS3 or other simulators, and ULM processing and benchmarking tools. Its stated scope includes anatomically realistic microvascular networks, biophysically plausible blood flow and pulsatility, stochastic microbubble trajectories, and corresponding ultrasound RF/IQ data with tissue and skull clutter and motion, thereby addressing a central limitation of in vivo validation: the absence of observable “true” microbubble trajectories and vessel geometry [2509.08149].

## 1. Definition, scope, and nomenclature

The-Bodega is presented as a modular, object-oriented MATLAB framework for simulating realistic hemodynamic microvascular graphs and the microbubble and ultrasound data derived from them. Its purpose is not merely image synthesis, but the construction of truth-known digital phantoms for benchmarking localization, tracking, clutter filtering, motion correction, and functional ULM metrics under controlled but physiologically informed conditions [2509.08149]. The framework is explicitly organ-agnostic provided that a directed vascular graph is available, and the included defaults span mouse brain cortex, human left ventricle coronary vasculature, and a synthetic capillary network.

The name is potentially ambiguous in the contemporary literature. “The-Bodega” in this sense refers specifically to the ULM simulation toolbox [2509.08149]. It is distinct from BODEGA, a benchmark for adversarial example generation in credibility assessment and misinformation classification [2303.08032; 2506.23661], and from Bodega, a consensus protocol for local linearizable reads in distributed systems [2509.07158]. The ULM toolbox is therefore best understood as a hemodynamic and ultrasound simulation platform rather than a text-robustness benchmark or a distributed systems protocol.

## 2. Hemodynamic graph formalism and microbubble dynamics

At the core of The-Bodega is a directed-graph representation of the vasculature. Nodes encode branch points, inlets, and outlets; edges encode vessel segments and are annotated with radius from `.rad` files, baseline flow or velocity from `.flo`, optional pulse pressure from `.pul`, and spatial coordinates from `.pos` [2509.08149]. The directedness is functionally important: it enforces physiologic flow direction, avoids cycles, and enables MATLAB `allpaths`, so that every unique path through the network can be treated as a potential microbubble trajectory. Included defaults comprise half and whole mouse brain cortex graphs of approximately \(2.1\) million nodes and \(2.8\) million edges from Linninger et al., a human left ventricle coronary network from Schwarz et al., and a synthetic capillary network [2509.08149].

Microbubble motion is simulated with a sequential Monte Carlo procedure. The framework precomputes all plausible paths \(T\) through the graph, biases trajectory sampling toward higher-flow inlets, chooses a seed point along the sampled path using a radius-based PDF, and forward-propagates each bubble with time step \(dt\) using precomputed steady-state velocity with pulsatile modulation and size effects [2509.08149]. Microbubble size is sampled by default from a Definity-like distribution,
\[
d \sim \mathcal{N}(\mu = 2~\mu\text{m},\, \sigma = 3~\mu\text{m}),
\]
and passage through a vessel depends on bubble diameter relative to vessel radius; bubbles larger than the vessel are slowed and may shrink, disappear, or be removed entirely in very small capillaries [2509.08149].

The flow model combines Poiseuille assumptions with dynamic pulsatility. Within a vessel segment, the axial velocity profile is
\[
v(r) = v_{\max}\left(1 - \frac{r^2}{R^2}\right),
\]
with \(v_{\max} = 2\bar{v}\), and mean velocity and volumetric flow given by
\[
\bar{v} = \frac{\Delta P\,R^2}{8\,\mu\,L}, \qquad
Q = \frac{\pi R^4}{8 \mu L}\,\Delta P.
\]
Beyond steady-state flow, The-Bodega applies a modified Pulse Decomposition Analysis approach in which each edge receives a composite pulse waveform formed from five Gaussian components convolved with triangular windows, amplitude-scaled via
\[
\Delta V = C \cdot \Delta P,
\]
then time-shifted according to path length, cardiac cycle period, and effective pulse wave velocity [2509.08149]. The resulting edge-wise pulsatile profile is periodic over cardiac cycles, and microbubble velocity is represented as
\[
v_{\text{edge}}(t) = \bar{v}_{\text{edge}} \cdot \left(1 + \delta v_{\text{PDA}}(t)\right).
\]

To avoid non-physical kinks in raw centerlines, trajectories are Savitzky–Golay filtered with window 5 and second order, and a Rotation Minimizing Frame is computed via the double-reflection method [2509.08149]. This permits smooth radial displacement within vessels and yields smooth 3D trajectories. A plausible implication is that the framework is not limited to centerline occupancy models; it attempts to preserve local intraluminal geometry consistent with the assumed Poiseuille statistics.

## 3. From microbubble trajectories to ultrasound data

After simulation, the set of bubbles \(\mathcal{B} = \{b_1, b_2, \ldots, b_N\}\) is stored with attributes including position, velocity, radius, time, and trajectory ID, then subsampled into frame-wise microbubble sets and written to HDF5 with chunking and compression for efficient I/O and frame-by-frame access [2509.08149]. This data layout is meant to support interoperability with other languages and downstream pipelines while retaining exact trajectory-level provenance.

The ultrasound forward model is centered on SIMUS3, described as a frequency-domain, particle-based simulator that works directly on 3D scatterer lists rather than a Cartesian grid, supports arbitrary transducer geometries, and is GPU-accelerated with CUDA [2509.08149]. Microbubbles are treated as acoustic point scatterers with scattering amplitude, while skull and parenchyma are represented as scatterer clouds. The received RF signal for channel \(m\) is represented conceptually as
\[
s_m(t) = \sum_{i=1}^{N_{\text{scat}}} a_i \, h_m(t - \tau_{i,m}),
\]
and in beamformed space this is equivalent to convolution of the reflectivity map with the system PSF,
\[
I(\mathbf{x}) = \sum_i a_i \, \mathrm{PSF}(\mathbf{x} - \mathbf{x}_i).
\]
The paper notes that ULM processing can explicitly use this PSF, for example by correlation-based localization with row-column arrays [2509.08149].

Scene construction is block-wise. A tissue or skull clutter block seeds 3D scatterers according to intensity distributions from micro-CT or B-mode; a microbubble block places scatterers at \(\mathcal{B}_f\) positions in the field of view; additional blocks can represent separate tissue regions [2509.08149]. Each block is simulated independently and the RF/IQ buffers are summed. Temporal and acquisition parameters are controlled by JSON transducer configuration files, including center frequency, sampling rate, aperture geometry, focusing, plane-wave settings, medium attenuation, microjitter, and scatterer density. The framework explicitly supports microbubble sampling rates up to \(10\) kHz, even when the ultrasound frame rate is lower, enabling subsampling and aliasing analysis [2509.08149]. Beamforming is left to the user; the paper reports GPU-accelerated delay-and-sum, and in some row-column array examples uses autocorrelation and 3D Gaussian fitting for localization.

## 4. Anatomical domains and representative use cases

The-Bodega is described as organ-agnostic, but its canonical domains are the mouse brain and the human heart. The included examples show that the same pipeline is reused across these settings by changing vascular geometry and parameterization of viscosity, pressure drop, compliance, pulse wave velocity, and heart or respiratory rates, with graph-specific tuning to reproduce known in vivo flow and velocity ranges [2509.08149].

| Domain | Default graph or input | Representative uses |
|---|---|---|
| Mouse brain | Whole and half cortex graphs from Linninger et al. | Capillary imaging, saturation analysis, transcranial ULM, 3D dynamic ULM, neurovascular responses |
| Human heart | Left ventricle coronary network from Schwarz et al. with real B-mode short-axis acquisitions and motion fields | Myocardial ULM under motion and clutter, motion correction, clutter filtering stress-tests |
| Synthetic network | Synthetic capillary graph | Testing and checksums |

In the mouse cortex setting, the framework has been used for capillary imaging and saturation analysis on a \(2 \times 2\) mm cortical patch with multiple microbubble concentrations, for transcranial ULM with skull clutter, for 3D dynamic ULM using row-column arrays, and for simulation of neurovascular responses in barrel field cortex [2509.08149]. With microbubble-only data, the reported saturation behavior is that \(80\)–\(90\%\) of large vessels are traversed in about \(3\) minutes, whereas only about \(50\%\) of capillaries are traversed in the same interval, consistent with in vivo observations [2509.08149]. The study further defines weighted node importance as a linear combination of betweenness centrality and PageRank, and reports that these critical capillary nodes saturate faster, around \(2\)–\(3\) minutes.

In the cardiac setting, a coronary arterial graph is combined with real B-mode short-axis sequences and motion fields derived from Doppler, so that tissue scatterers and microbubbles undergo synchronized systolic and diastolic motion [2509.08149]. This permits controlled separation of motion, clutter, and clutter filtering. The reported qualitative finding is that without motion the vasculature is reconstructed accurately; motion alone with perfect motion correction preserves much of the vasculature; but motion plus tissue clutter plus SVD leads to significant vessel loss and false tracks, indicating that clutter filtering is the dominant challenge in moving organs [2509.08149].

The functional ULM example uses a whole mouse brain graph co-registered to the Allen Brain Atlas, extracts barrel field masks, and defines two flow states—baseline and full whisker activation—with increased CBV and CBF inside S1BF [2509.08149]. A stimulus train of \(15\) s on and \(15\) s off for five repeats drives a hemodynamic response function based on a simple excitatory-inhibitory neural response convolved with a gamma-variate hemodynamic impulse of FWHM about \(4\) s and about \(1\) s delay per Buxton et al. The HRF is then used as a time-varying CDF for mixture sampling between baseline and activated microbubble distributions. The reported outputs include contrast-enhanced power Doppler versus ULM density and velocity comparisons, voxel-wise Pearson correlations using a \(4\) s sliding window with \(0.4\) s stride, and activation maps consistent with in vivo fULM results [2509.08149].

## 5. Benchmarking ULM algorithms and methodological studies

A principal function of The-Bodega is quantitative benchmarking under full ground truth. Because both the vascular graph and the time-resolved microbubble trajectories are known, users can compute localization error as the distance between estimated \(\hat{\mathbf{x}}_i\) and true \(\mathbf{x}_i\), assess tracking fidelity through linking correctness and fragmentation, and measure velocity estimation error relative to truth [2509.08149]. The paper explicitly uses the toolbox to benchmark SVD spatiotemporal filtering, Fourier Ring Correlation, a TAL “Tracking-before-Localization” algorithm with Kalman filtering and radial symmetry, ULM with row-column arrays and lag-1 autocorrelation, dynamic ULM, and functional ULM.

SVD spatiotemporal filtering is described by the standard decomposition
\[
D = U \Sigma V^T,
\]
with low-rank components associated with coherent tissue signals and higher-rank components with microbubbles and noise, then filtered via
\[
D_{\text{filtered}} = U \Sigma' V^T,
\]
where selected singular values are zeroed or retained [2509.08149]. The-Bodega allows comparison of filtered reconstructions against both microbubble-only data and the ground-truth graph, using Dice, Jaccard, sensitivity, specificity, and FRC. In the cortical capillary example, two filters removing the first \(5/500\) and \(25/500\) components are compared, and more aggressive filtering produces clear capillary loss, especially in slow-flow capillaries overlapping tissue motion space.

FRC is used as a resolution estimator by correlating the Fourier transforms of two independent reconstructions and identifying the intersection with the half-bit threshold [2509.08149]. The reported FRC-based resolutions are approximately \(9.7~\mu\text{m}\) for microbubble-only data, degrading to \(14~\mu\text{m}\) and \(24~\mu\text{m}\) under increasingly aggressive SVD filtering. The paper interprets this as direct evidence that capillary loss reduces ULM resolution. A common misconception is that clutter filtering is a neutral preprocessing step whose only effect is tissue suppression; the examples here indicate that aggressive clutter removal can also ablate true capillary signal and therefore alter the effective operating point of the entire ULM pipeline [2509.08149].

## 6. Computational profile, assumptions, and significance

The-Bodega is engineered for large-scale simulations and automatically leverages available CPU and GPU parallelization. The reported test platform is an 8-core CPU system with \(256\) GB RAM and an NVIDIA RTX 3090 with \(24\) GB, using MATLAB `parpool` for edge-wise PDA and per-bubble simulations, GPU arrays for sorting and vector operations, and GPU-accelerated SIMUS for ultrasound generation [2509.08149]. For a representative workload of \(32{,}000\) bubbles at \(10\) kHz sampling over \(180\) s, reported memory and runtime are about \(55\) GB and \(2845\) s for the whole mouse brain cortex, \(10.6\) GB and \(3024\) s for the half brain, \(4.6\) GB and \(2090\) s for the human heart, and \(4.3\) GB and \(797\) s for the toy network [2509.08149]. Major bottlenecks are graph `allpaths` computation in dense cortical graphs, edge-wise PDA pulsatility computation, and 3D ultrasound simulation with dense skull or tissue clutter. Disk I/O, particularly NVMe SSD versus HDD, materially affects runtime because bubbles and frames are stored as separate HDF5 chunks.

The framework also states its assumptions clearly. Accuracy depends on the fidelity of the underlying vascular graph and hemodynamic solution; where in vivo calibration is unavailable, approximate scaling such as Murray’s law reduces realism [2509.08149]. Flow is modeled with laminar, cylindrical, Newtonian Poiseuille assumptions; non-Newtonian effects, red blood cell interactions, and complex rheology are not explicitly modeled. Microbubbles are passive point scatterers by default, without shell dynamics or nonlinear scattering, although integration with PROTEUS or k-Wave is noted as a route to richer physics. SIMUS is linear, so nonlinear propagation and harmonic imaging are not included in the default pipeline. Neurovascular activation is intentionally simplified, and redistribution of flow during activation is not globally rebalanced unless a full hemodynamic re-solve is performed [2509.08149]. These constraints are substantive rather than incidental: “ground truth” here means truth-known with respect to the simulator, not direct in vivo observability.

Within those limits, the paper positions The-Bodega as the first open, modular MATLAB toolbox to couple realistic validated hemodynamic graphs, stochastic microbubble Monte Carlo simulation with Poiseuille and pulsatile flow, 3D ultrasound forward modeling, and end-to-end ULM processing and evaluation in a single framework [2509.08149]. Its significance lies in supporting dynamic rather than static occupancy simulations, preserving full ground truth from vessel architecture to time-resolved bubble trajectories and clutter-contaminated ultrasound data, and enabling controlled studies of localization, tracking, resolution, motion compensation, and functional imaging. The same properties also make it suitable as a data engine for deep learning, since it can generate arbitrarily large annotated datasets across multiple organs and acquisition conditions [2509.08149].

Source: https://www.emergentmind.com/topics/the-bodega