Pavel B Rosnitskiy, Oleg A Sapozhnikov, Tatiana D Khokhlova, Vera A Khokhlova
Numerical modeling of high-intensity and low-intensity focused ultrasound (HIFU and LIFU) fields in heterogeneous tissues is essential for medical ultrasound research and treatment planning. A widely used tool is the open-source k-Wave toolbox, which provides MATLAB interfaces for C++ CPU/GPU simulation cores. Despite its flexible pseudospectral formulation, k-Wave has limitations, including high RAM/VRAM usage and errors when spherically focused sources are mapped onto a Cartesian grid. Here, we present a memory-saving k-Wave update, developed as an LGPL-3.0-compliant fork, with new CPU/GPU cores for single-frequency simulations. These cores use an amplitude-phase source representation instead of the conventional transient representation, reducing RAM/VRAM use. To simplify the workflow, the updated k-Wave toolbox was combined with the xDDx toolbox to create the "xDDx add-on" for k-Wave. The add-on introduces an adaptive boundary condition (ABC), which projects the field from the spherical transducer surface onto an automatically selected flat ABC plane in front of the body model with Cartesian grid, reducing simulation volume and memory use. The toolbox was tested using an acoustic model of a uterine fibroids case and a 1.2-MHz, 200-mm-aperture, 150 mm radius of curvature Fully Populated Random Array (FPRA). The ABC reduced the simulation volume by 71% compared with imposing the boundary condition at the transducer surface. The new core provided additional RAM/VRAM savings of 27-75% relative to the conventional core, depending on discretization. A resolution of 2.5 points per wavelength (PPW) was sufficient to produce accurate results relative to a 10-PPW reference case. The toolbox is available for Windows, Linux, and macOS through the forked k-Wave repository: https://github.com/pavrosni/k-wave/releases.