Many examples from k-wave-python are Python mirrors of the large collection of great examples from the original k-wave project. All examples are included as python files or notebooks in a subdirectory of the example directory. When running the examples in Google Colab, remember to select a GPU runtime for GPU simulations. Every example has a short readme.md file which briefly describes the purpose of the example.
-
Defining An Ultrasound Transducer Example (original example, )
-
Circular piston transducer (axisymmetric) (original example, )
-
Modelling Sensor Directivity In 2D Example (original example, )
When adding a new example notebook, follow these steps:
- Search the list of examples to find an open example.
- Claim your example by opening an "Example" issue on GitHub.
- Fork and clone the repository and create a branch for your new example.
- Create an example sub-directory using the name from the hyperlink of the original k-wave example if it exists (e.g. for http://www.k-wave.org/documentation/example_ivp_loading_external_image.php name the directory "ivp_loading_external_image).
- Add your example notebook to your example directory.
- Create a Python script that mirrors your example notebook in the same directory. Using
nbconvert
is an easy way to convert to a Python script usingjupyter nbconvert --to python --RegexRemovePreprocessor.patterns="^%" <notebook_path>
- Add a README.md file to your example directory briefly describing the concept or principle the example is meant to display and linking to the origonal k-wave example page if it exists.
- Include a link in the
README.md
in the examples directory to a colab notebook for your example. - Add a your example to the list on this
README.md
and add a colab badge using html OR copy the pure markdown version above. - Open a pull request that closes the open issue from your forked example branch and name pull request "[Example] <name of your example>".
Thanks for contributing to k-wave-python!