This project is a Python implementation of v1.4.0 of the MATLAB toolbox k-Wave as well as an interface to the pre-compiled v1.3 of k-Wave simulation binaries, which support NVIDIA sm 5.0 (Maxwell) to sm 9.0a (Hopper) GPUs.
With this project, we hope to increase the accessibility and reproducibility of k-Wave simulations for medical imaging, algorithmic prototyping, and testing. Many tools and methods of k-Wave can be found here, but this project has and will continue to diverge from the original k-Wave APIs to leverage pythonic practices.
To install the most recent build of k-Wave-python from PyPI, run:
pip install k-wave-python
After installing the Python package, the required binaries will be downloaded and installed the first time you run a simulation.
After installation, run the B-mode reconstruction example in the examples
directory of the repository:
git clone https://github.com/waltsims/k-wave-python
cd k-wave-python
git checkout v0.3.3
pip install '.[example]'
python3 examples/us_bmode_linear_transducer/us_bmode_linear_transducer.py
This example file steps through the process of:
- Generating a simulation medium
- Configuring a transducer
- Running the simulation
- Reconstructing the simulation
This example expects an NVIDIA GPU by default to simulate with k-Wave.
To test the reconstruction on a machine with a GPU,
set RUN_SIMULATION
on line 29 of us_bmode_linear_transducer.py
to True
, and the example will run without the pre-computed data.
If you're enjoying k-Wave-python and want to contribute, development instructions can be found here.
- k-Wave: A MATLAB toolbox for the time-domain simulation of acoustic wave fields.
- j-wave: Differentiable acoustic simulations in JAX.
- ADSeismic.jl: a finite difference acoustic simulator with support for AD and JIT compilation in Julia.
- stride: a general optimisation framework for medical ultrasound tomography.
The documentation for k-wave-python can be found here.
@software{k-Wave-Python,
author = {Yagubbbayli, Farid and Sinden, David and Simson, Walter},
license = {GPL-3.0},
title = {{k-Wave-Python}},
url = {https://github.com/waltsims/k-wave-python}
}
e-mail [email protected].