diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index e3bf6c03..8102415f 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -16,7 +16,7 @@ jobs: - name: Build and Commit uses: sphinx-notes/pages@v2 with: - requirements_path: ./docs_requirements.txt + requirements_path: ./requirements/docs.txt - name: Push changes uses: ad-m/github-push-action@master with: diff --git a/README.md b/README.md index c5d8eda0..9ac9dcf4 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,15 @@ # k-Wave-python -This project is a Python interface to the pre-compiled v1.3 of [k-Wave simulation binaries](http://www.k-wave.org/download.php) which support NVIDIA sm 3.0 to sm 7.5. +This project is a Python implementation of most of the [MATLAB toolbox k-Wave](http://www.k-wave.org/) as well as an interface to the pre-compiled v1.3 of k-Wave simulation binaries which support NVIDIA sm 3.0 to sm 7.5. + +## Mission + +With this project, we hope to increase accessibility and reproducablitiy of [k-Wave](http://www.k-wave.org/) simulations for medical imaging, algorithmic prototyping and testing. Many tools and methods of [k-Wave](http://www.k-wave.org/) can be found here, but this project has and will continue to diverge from the original [k-Wave](http://www.k-wave.org/) APIs in order to leverage pythonic practices. + +## Documentation + +The documentation for k-wave-python can be found [here](http://waltersimson.com/k-wave-python/) -The documentation for this Python interface is compiled in a Read the Docs page [here](http://waltersimson.com/k-wave-python/) ## Installation ```bash @@ -10,7 +17,7 @@ pip install k-wave-python ``` Currently, we are looking for beta testers on Windows. -If you would like to get involved, open an issue letting us know, or message us on the [k-Wave-python Telegram chat](https://t.me/+ILL4yGgcX0A2Y2Y6). + ## Getting started ![](docs/images/example_bmode.png) @@ -19,7 +26,8 @@ After installation, run the B-mode reconstruction example in the `examples` dire ```bash git clone https://github.com/waltsims/k-wave-python -pip install -r example_requirements.txt +cd k-wave-python +pip install -r ./requirements/example.txt python3 examples/bmode_reconstruction_example.py ``` @@ -37,3 +45,7 @@ To test the reconstruction on a machine without a GPU, set `RUN_SIMULATION` [on ## Development If you're enjoying k-Wave-python and want to contribute, development instructions can be found [here](https://waltersimson.com/k-wave-python/development/development_environment.html). +If you would like to get involved, open an issue letting us know, or message us on the [k-Wave-python Telegram chat](https://t.me/+ILL4yGgcX0A2Y2Y6) + +## Contact +e-mail [walter.simson@tum.de](mailto:walter.simson@tum.de). diff --git a/requirements.txt b/requirements.txt index 9a360111..d2b526f9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1 @@ -h5py==3.6.0 -scipy==1.7.3 -opencv-python==4.4.0.46 -deepdiff==5.2.3 -matplotlib==3.3.4 -numpy~=1.21.6 -gdown==4.4.0 -UFF.py @ git+https://github.com/waltsims/uff.py@a672319b5cfbe3a676837e47c5958a3fdea12fa7 +-r ./requirements/base.txt \ No newline at end of file diff --git a/requirements/base.txt b/requirements/base.txt new file mode 100644 index 00000000..282dddd6 --- /dev/null +++ b/requirements/base.txt @@ -0,0 +1,7 @@ +h5py==3.6.0 +scipy==1.7.3 +opencv-python==4.4.0.46 +deepdiff==5.2.3 +matplotlib==3.3.4 +numpy~=1.21.6 +UFF.py @ git+https://github.com/waltsims/uff.py@a672319b5cfbe3a676837e47c5958a3fdea12fa7 diff --git a/docs_requirements.txt b/requirements/docs.txt similarity index 61% rename from docs_requirements.txt rename to requirements/docs.txt index 2eb5d760..3feb663d 100644 --- a/docs_requirements.txt +++ b/requirements/docs.txt @@ -1,3 +1,3 @@ --r requirements.txt +-r base.txt sphinx_rtd_theme sphinx-toolbox diff --git a/example_requirements.txt b/requirements/example.txt similarity index 53% rename from example_requirements.txt rename to requirements/example.txt index 00f2629a..c1422fdb 100644 --- a/example_requirements.txt +++ b/requirements/example.txt @@ -1,3 +1,3 @@ --r requirements.txt +k-wave-python>=0.1.0 git+https://github.com/waltsims/uff.py -gdown \ No newline at end of file +gdown==4.4.0 diff --git a/requirements/test.txt b/requirements/test.txt new file mode 100644 index 00000000..718cf7a8 --- /dev/null +++ b/requirements/test.txt @@ -0,0 +1,2 @@ +-r base.txt +phantominator \ No newline at end of file diff --git a/tests/test_binary_present.py b/tests/test_binary_present.py index df7b8048..90662565 100644 --- a/tests/test_binary_present.py +++ b/tests/test_binary_present.py @@ -1,25 +1,72 @@ -import setup_test import os +import os.path +os.chdir('..') -def test_linux_binaries_present(): - assert os.path.exists('kwave/bin/linux/acousticFieldPropagator-OMP') - assert os.path.exists('kwave/bin/linux/kspaceFirstOrder-OMP') - assert os.path.exists('kwave/bin/linux/kspaceFirstOrder-CUDA') - - -def test_windows_binaries_present(): - assert os.path.exists('kwave/bin/windows/acousticFieldPropagator-OMP.exe') - assert os.path.exists('kwave/bin/windows/kspaceFirstOrder-CUDA.exe') - assert os.path.exists('kwave/bin/windows/kspaceFirstOrder-OMP.exe') - assert os.path.exists('kwave/bin/windows/hdf5.dll') - assert os.path.exists('kwave/bin/windows/hdf5_hl.dll') - assert os.path.exists('kwave/bin/windows/cufft64_10.dll') - assert os.path.exists('kwave/bin/windows/libiomp5md.dll') - assert os.path.exists('kwave/bin/windows/libmmd.dll') - assert os.path.exists('kwave/bin/windows/msvcp140.dll') - assert os.path.exists('kwave/bin/windows/svml_dispmd.dll') - assert os.path.exists('kwave/bin/windows/szip.dll') - assert os.path.exists('kwave/bin/windows/vcruntime140.dll') - assert os.path.exists('kwave/bin/windows/zlib.dll') - assert os.path.exists('kwave/bin/windows/cufft64_10.dll') + +def test_linux_afp_binaries_present(): + assert os.path.exists(os.path.join(os.getcwd(), 'kwave', 'bin', 'linux', 'acousticFieldPropagator-OMP')) + + +def test_linux_omp_binaries_present(): + assert os.path.exists(os.path.join(os.getcwd(), 'kwave', 'bin', 'linux', 'kspaceFirstOrder-OMP')) + + +def test_linux_cuda_binaries_present(): + assert os.path.exists(os.path.join(os.getcwd(), 'kwave', 'bin', 'linux', 'kspaceFirstOrder-CUDA')) + + +def test_windows_afp_binaries_present(): + assert os.path.exists(os.path.join(os.getcwd(), 'kwave', 'bin', 'windows', 'acousticFieldPropagator-OMP.exe')) + + +def test_windows_cuda_binaries_present(): + assert os.path.exists(os.path.join(os.getcwd(), 'kwave', 'bin', 'windows', 'kspaceFirstOrder-CUDA.exe')) + + +def test_windows_omp_binaries_present(): + assert os.path.exists(os.path.join(os.getcwd(), 'kwave', 'bin', 'windows', 'kspaceFirstOrder-OMP.exe')) + + +def test_windows_hdf5_binaries_present(): + assert os.path.exists(os.path.join(os.getcwd(), 'kwave', 'bin', 'windows', 'hdf5.dll')) + + +def test_windows_hdf5hl_binaries_present(): + assert os.path.exists(os.path.join(os.getcwd(), 'kwave', 'bin', 'windows', 'hdf5_hl.dll')) + + +def test_windows_cufft64_binaries_present(): + assert os.path.exists(os.path.join(os.getcwd(), 'kwave', 'bin', 'windows', 'cufft64_10.dll')) + + +def test_windows_libiomp_binaries_present(): + assert os.path.exists(os.path.join(os.getcwd(), 'kwave', 'bin', 'windows', 'libiomp5md.dll')) + + +def test_windows_libmmd_binaries_present(): + assert os.path.exists(os.path.join(os.getcwd(), 'kwave', 'bin', 'windows', 'libmmd.dll')) + + +def test_windows_msvcp_binaries_present(): + assert os.path.exists(os.path.join(os.getcwd(), 'kwave', 'bin', 'windows', 'msvcp140.dll')) + + +def test_windows_svmldispmd_binaries_present(): + assert os.path.exists(os.path.join(os.getcwd(), 'kwave', 'bin', 'windows', 'svml_dispmd.dll')) + + +def test_windows_szip_binaries_present(): + assert os.path.exists(os.path.join(os.getcwd(), 'kwave', 'bin', 'windows', 'szip.dll')) + + +def test_windows_vcruntime140_binaries_present(): + assert os.path.exists(os.path.join(os.getcwd(), 'kwave', 'bin', 'windows', 'vcruntime140.dll')) + + +def test_windows_zlib_binaries_present(): + assert os.path.exists(os.path.join(os.getcwd(), 'kwave', 'bin', 'windows', 'zlib.dll')) + + +def test_windows_cufft6410_binaries_present(): + assert os.path.exists(os.path.join(os.getcwd(), 'kwave', 'bin', 'windows', 'cufft64_10.dll'))