Welcome to k-Wave-python’s documentation!#

k-Wave is an open source acoustics toolbox for MATLAB and C++ developed by Bradley Treeby and Ben Cox (University College London) and Jiri Jaros (Brno University of Technology). The software is designed for time domain acoustic and ultrasound simulations in complex and tissue-realistic media. The simulation functions are based on the k-space pseudospectral method and are both fast and easy to use.

Mission#

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.

Installation#

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.

Getting started#

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.0
pip install '.[example]'
python3 examples/bmode_reconstruction_example.py

This example file steps through the process of:

  1. Generating a simulation medium

  2. Configuring a transducer

  3. Running the simulation

  4. Reconstructing the simulation

Requirements#

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 30 of ``bmode_reconstruction_example.py` <https://github.com/waltsims/k-wave-python/blob/master/examples/bmode_reconstruction_example.py#L30>`_ to True, and the example will run without the pre-computed data.

Development#

If you’re enjoying k-Wave-python and want to contribute, development instructions can be found here.