k-Wave-python 0.2.1__tar.gz → 0.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/.gitignore +6 -0
- k_wave_python-0.3.1/.pre-commit-config.yaml +23 -0
- k_wave_python-0.3.1/.pytest_cache/v/cache/lastfailed +1 -0
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/.pytest_cache/v/cache/nodeids +13 -80
- k_wave_python-0.3.1/.readthedocs.yaml +14 -0
- k_wave_python-0.3.1/.ruff_cache/.gitignore +1 -0
- k_wave_python-0.3.1/.ruff_cache/CACHEDIR.TAG +1 -0
- k_wave_python-0.3.1/.ruff_cache/content/13487435192755641643 +0 -0
- k_wave_python-0.3.1/.ruff_cache/content/1921099194987439213 +0 -0
- k_wave_python-0.3.1/.ruff_cache/content/5526710289020645422 +0 -0
- k_wave_python-0.3.1/.ruff_cache/content/5950811561636507670 +0 -0
- k_wave_python-0.3.1/.ruff_cache/content/655415607675938108 +0 -0
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/Dockerfile +2 -1
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/PKG-INFO +31 -26
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/docs/README.md +14 -12
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/__init__.py +6 -8
- k_wave_python-0.3.1/kwave/data.py +120 -0
- k_wave_python-0.3.1/kwave/executor.py +102 -0
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/kWaveSimulation.py +164 -161
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/kWaveSimulation_helper/create_absorption_variables.py +4 -2
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/kWaveSimulation_helper/create_storage_variables.py +15 -13
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/kWaveSimulation_helper/data_cast.py +9 -5
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/kWaveSimulation_helper/display_simulation_params.py +14 -9
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/kWaveSimulation_helper/expand_grid_matrices.py +14 -10
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/kWaveSimulation_helper/retract_transducer_grid_size.py +2 -1
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/kWaveSimulation_helper/save_to_disk_func.py +19 -13
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/kWaveSimulation_helper/scale_source_terms_func.py +49 -38
- k_wave_python-0.3.1/kwave/kWaveSimulation_helper/set_sound_speed_ref.py +94 -0
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/kgrid.py +100 -86
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/kmedium.py +43 -28
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/ksensor.py +17 -12
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/ksource.py +90 -49
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/kspaceFirstOrder2D.py +89 -27
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/kspaceFirstOrder3D.py +132 -73
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/kspaceFirstOrderAS.py +57 -22
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/ktransducer.py +78 -36
- k_wave_python-0.3.1/kwave/options/simulation_execution_options.py +155 -0
- k_wave_python-0.2.1/kwave/options.py → k_wave_python-0.3.1/kwave/options/simulation_options.py +153 -85
- k_wave_python-0.3.1/kwave/reconstruction/beamform.py +154 -0
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/reconstruction/tools.py +5 -13
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/recorder.py +2 -2
- k_wave_python-0.3.1/kwave/utils/__init__.py +0 -0
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/utils/angular_spectrum.py +34 -26
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/utils/angular_spectrum_cw.py +32 -23
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/utils/atten_comp.py +50 -39
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/utils/checks.py +5 -3
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/utils/colormap.py +13 -5
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/utils/conversion.py +152 -10
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/utils/data.py +19 -6
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/utils/filters.py +21 -13
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/utils/interp.py +74 -10
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/utils/io.py +14 -10
- k_wave_python-0.3.1/kwave/utils/kwave_array.py +881 -0
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/utils/mapgen.py +837 -197
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/utils/math.py +157 -0
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/utils/matlab.py +32 -2
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/utils/matrix.py +115 -14
- k_wave_python-0.3.1/kwave/utils/plot.py +43 -0
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/utils/signals.py +98 -76
- k_wave_python-0.3.1/kwave/utils/typing.py +20 -0
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/pyproject.toml +33 -14
- k_wave_python-0.2.1/.pytest_cache/v/cache/lastfailed +0 -111
- k_wave_python-0.2.1/htmlcov/.gitignore +0 -2
- k_wave_python-0.2.1/htmlcov/coverage_html.js +0 -604
- k_wave_python-0.2.1/htmlcov/d_008abe0f134486c2___init___py.html +0 -113
- k_wave_python-0.2.1/htmlcov/d_008abe0f134486c2_abcdata_py.html +0 -107
- k_wave_python-0.2.1/htmlcov/d_008abe0f134486c2_checkutils_py.html +0 -175
- k_wave_python-0.2.1/htmlcov/d_008abe0f134486c2_colormap_py.html +0 -158
- k_wave_python-0.2.1/htmlcov/d_008abe0f134486c2_conversionutils_py.html +0 -458
- k_wave_python-0.2.1/htmlcov/d_008abe0f134486c2_datautils_py.html +0 -114
- k_wave_python-0.2.1/htmlcov/d_008abe0f134486c2_dotdictionary_py.html +0 -126
- k_wave_python-0.2.1/htmlcov/d_008abe0f134486c2_filterutils_py.html +0 -861
- k_wave_python-0.2.1/htmlcov/d_008abe0f134486c2_interputils_py.html +0 -577
- k_wave_python-0.2.1/htmlcov/d_008abe0f134486c2_ioutils_py.html +0 -609
- k_wave_python-0.2.1/htmlcov/d_008abe0f134486c2_kutils_py.html +0 -1100
- k_wave_python-0.2.1/htmlcov/d_008abe0f134486c2_maputils_py.html +0 -2486
- k_wave_python-0.2.1/htmlcov/d_008abe0f134486c2_mathutils_py.html +0 -185
- k_wave_python-0.2.1/htmlcov/d_008abe0f134486c2_matrixutils_py.html +0 -437
- k_wave_python-0.2.1/htmlcov/d_008abe0f134486c2_misc_py.html +0 -272
- k_wave_python-0.2.1/htmlcov/d_008abe0f134486c2_osutils_py.html +0 -102
- k_wave_python-0.2.1/htmlcov/d_008abe0f134486c2_pmlutils_py.html +0 -248
- k_wave_python-0.2.1/htmlcov/d_008abe0f134486c2_tictoc_py.html +0 -113
- k_wave_python-0.2.1/htmlcov/d_08ccaf6f6fd0d069___init___py.html +0 -106
- k_wave_python-0.2.1/htmlcov/d_08ccaf6f6fd0d069_create_absorption_variables_py.html +0 -202
- k_wave_python-0.2.1/htmlcov/d_08ccaf6f6fd0d069_create_storage_variables_py.html +0 -479
- k_wave_python-0.2.1/htmlcov/d_08ccaf6f6fd0d069_data_cast_py.html +0 -281
- k_wave_python-0.2.1/htmlcov/d_08ccaf6f6fd0d069_display_simulation_params_py.html +0 -179
- k_wave_python-0.2.1/htmlcov/d_08ccaf6f6fd0d069_expand_grid_matrices_py.html +0 -395
- k_wave_python-0.2.1/htmlcov/d_08ccaf6f6fd0d069_retract_transducer_grid_size_py.html +0 -120
- k_wave_python-0.2.1/htmlcov/d_08ccaf6f6fd0d069_save_to_disk_func_py.html +0 -596
- k_wave_python-0.2.1/htmlcov/d_08ccaf6f6fd0d069_scale_source_terms_func_py.html +0 -485
- k_wave_python-0.2.1/htmlcov/d_08ccaf6f6fd0d069_set_sound_speed_ref_py.html +0 -188
- k_wave_python-0.2.1/htmlcov/d_c3dba8f0d3a212d1___init___py.html +0 -101
- k_wave_python-0.2.1/htmlcov/d_c3dba8f0d3a212d1_data_py.html +0 -168
- k_wave_python-0.2.1/htmlcov/d_c3dba8f0d3a212d1_enums_py.html +0 -119
- k_wave_python-0.2.1/htmlcov/d_c3dba8f0d3a212d1_executor_py.html +0 -155
- k_wave_python-0.2.1/htmlcov/d_c3dba8f0d3a212d1_kWaveSimulation_py.html +0 -1563
- k_wave_python-0.2.1/htmlcov/d_c3dba8f0d3a212d1_kgrid_py.html +0 -783
- k_wave_python-0.2.1/htmlcov/d_c3dba8f0d3a212d1_kmedium_py.html +0 -311
- k_wave_python-0.2.1/htmlcov/d_c3dba8f0d3a212d1_ksensor_py.html +0 -213
- k_wave_python-0.2.1/htmlcov/d_c3dba8f0d3a212d1_ksource_py.html +0 -431
- k_wave_python-0.2.1/htmlcov/d_c3dba8f0d3a212d1_kspaceFirstOrder2D_py.html +0 -483
- k_wave_python-0.2.1/htmlcov/d_c3dba8f0d3a212d1_kspaceFirstOrder3D_py.html +0 -510
- k_wave_python-0.2.1/htmlcov/d_c3dba8f0d3a212d1_kspaceFirstOrderAS_py.html +0 -417
- k_wave_python-0.2.1/htmlcov/d_c3dba8f0d3a212d1_kspaceFirstOrder_py.html +0 -383
- k_wave_python-0.2.1/htmlcov/d_c3dba8f0d3a212d1_ktransducer_py.html +0 -799
- k_wave_python-0.2.1/htmlcov/d_c3dba8f0d3a212d1_options_py.html +0 -415
- k_wave_python-0.2.1/htmlcov/d_c3dba8f0d3a212d1_recorder_py.html +0 -225
- k_wave_python-0.2.1/htmlcov/d_c6e89a0ff279d0c3___init___py.html +0 -97
- k_wave_python-0.2.1/htmlcov/d_c6e89a0ff279d0c3_beamform_py.html +0 -216
- k_wave_python-0.2.1/htmlcov/d_c6e89a0ff279d0c3_converter_py.html +0 -271
- k_wave_python-0.2.1/htmlcov/d_c6e89a0ff279d0c3_shifted_transform_py.html +0 -108
- k_wave_python-0.2.1/htmlcov/d_c6e89a0ff279d0c3_tools_py.html +0 -168
- k_wave_python-0.2.1/htmlcov/favicon_32.png +0 -0
- k_wave_python-0.2.1/htmlcov/index.html +0 -438
- k_wave_python-0.2.1/htmlcov/keybd_closed.png +0 -0
- k_wave_python-0.2.1/htmlcov/keybd_open.png +0 -0
- k_wave_python-0.2.1/htmlcov/status.json +0 -1
- k_wave_python-0.2.1/htmlcov/style.css +0 -311
- k_wave_python-0.2.1/kwave/data.py +0 -71
- k_wave_python-0.2.1/kwave/executor.py +0 -65
- k_wave_python-0.2.1/kwave/kWaveSimulation_helper/set_sound_speed_ref.py +0 -91
- k_wave_python-0.2.1/kwave/kspaceFirstOrder.py +0 -263
- k_wave_python-0.2.1/kwave/reconstruction/beamform.py +0 -272
- k_wave_python-0.2.1/kwave/reconstruction/converter.py +0 -175
- k_wave_python-0.2.1/kwave/reconstruction/shifted_transform.py +0 -11
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/.pytest_cache/.gitignore +0 -0
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/.pytest_cache/CACHEDIR.TAG +0 -0
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/.pytest_cache/README.md +0 -0
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/.pytest_cache/v/cache/stepwise +0 -0
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/LICENSE +0 -0
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/enums.py +0 -0
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/kWaveSimulation_helper/__init__.py +0 -0
- {k_wave_python-0.2.1/kwave/reconstruction → k_wave_python-0.3.1/kwave/options}/__init__.py +0 -0
- {k_wave_python-0.2.1/kwave/utils → k_wave_python-0.3.1/kwave/reconstruction}/__init__.py +0 -0
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/utils/dotdictionary.py +0 -0
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/utils/pml.py +0 -0
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/kwave/utils/tictoc.py +0 -0
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/make_docs.sh +0 -0
- {k_wave_python-0.2.1 → k_wave_python-0.3.1}/run_tests.sh +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/srstevenson/nb-clean.git
|
|
3
|
+
rev: 3.2.0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: nb-clean
|
|
6
|
+
name: nb-clean
|
|
7
|
+
entry: nb-clean clean
|
|
8
|
+
language: python
|
|
9
|
+
types_or: [jupyter]
|
|
10
|
+
minimum_pre_commit_version: 2.9.2
|
|
11
|
+
# - repo: https://github.com/pre-commit/pre-commit-hooks
|
|
12
|
+
# rev: v4.5.0 # Use the ref you want to point at
|
|
13
|
+
# hooks:
|
|
14
|
+
# - id: trailing-whitespace
|
|
15
|
+
# - repo: https://github.com/nbQA-dev/nbQA
|
|
16
|
+
# rev: 1.7.1
|
|
17
|
+
# hooks:
|
|
18
|
+
# - id: nbqa-ruff
|
|
19
|
+
# name: nbqa-ruff
|
|
20
|
+
# entry: nbqa ruff
|
|
21
|
+
# language: python
|
|
22
|
+
# types_or: [jupyter]
|
|
23
|
+
# minimum_pre_commit_version: 2.9.2
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -1,60 +1,34 @@
|
|
|
1
1
|
[
|
|
2
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/cart2grid_test.py::test_cart2grid",
|
|
3
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/expandMatrix_test.py::test_expand_matrix_test",
|
|
4
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/fourierShift_test.py::test_fourier_shift",
|
|
5
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/gaussianFilter_test.py::test_gaussianFilter",
|
|
6
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/getColorMap_test.py::test_get_color_map",
|
|
7
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/getWin_test.py::test_get_win",
|
|
8
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/h5io_test.py::test_writeGrid",
|
|
9
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/h5io_test.py::test_write_attributes",
|
|
10
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/h5io_test.py::test_write_flags",
|
|
11
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/h5io_test.py::test_write_matrix",
|
|
12
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/makeArc_test.py::test_makeArc",
|
|
13
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/makeBall_test.py::test_makeBall",
|
|
14
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/makeBowl_test.py::test_makeBowl",
|
|
15
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/makeCartCircle_test.py::test_makeCartCircle",
|
|
16
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/makeCartSphere_test.py::test_makeCartSphere",
|
|
17
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/makeCircle_test.py::test_makeCircle",
|
|
18
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/makeDisc_test.py::test_makeDisc",
|
|
19
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/makeLine_test.py::test_makeLine",
|
|
20
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/makeMultiArc_test.py::test_makeMultiArc",
|
|
21
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/makeMultiBowl_test.py::test_makeMultiBowl",
|
|
22
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/makeSphere_test.py::test_makeSphere",
|
|
23
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/makeSphericalSection_test.py::test_makeSphericalSection",
|
|
24
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/maxND_test.py::test_maxND",
|
|
25
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/minND_test.py::test_minND",
|
|
26
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/reorderBinarySensorData_test.py::test_binary_sensor_data",
|
|
27
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/reorderSensorData_test.py::test_reorderSensorData",
|
|
28
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/revolve2D_test.py::test_revolve2D",
|
|
29
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/scaleSI_test.py::test_scale_si",
|
|
30
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/scaleTime_test.py::test_scale_time",
|
|
31
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/scanConversion_test.py::test_scanConversion",
|
|
32
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/test_interpcartdata.py::test_interpcartdata",
|
|
33
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/test_resize.py::test_resize",
|
|
34
|
-
"tests/k-wave-python/tests/matlab_test_data_collectors/python_testers/unmaskSensorData_test.py::test_unmask_sensor_data",
|
|
35
2
|
"tests/matlab_test_data_collectors/python_testers/angularSpectrumCW_test.py::test_angular_spectrum_cw",
|
|
36
3
|
"tests/matlab_test_data_collectors/python_testers/angularSpectrum_test.py::test_angular_spectrum",
|
|
37
4
|
"tests/matlab_test_data_collectors/python_testers/attenComp_test.py::test_atten_comp",
|
|
38
5
|
"tests/matlab_test_data_collectors/python_testers/cart2grid_test.py::test_cart2grid",
|
|
6
|
+
"tests/matlab_test_data_collectors/python_testers/computeLinearTransform_test.py::test_compute_linear_transform",
|
|
39
7
|
"tests/matlab_test_data_collectors/python_testers/create_cw_signals_test.py::test_create_cw_signals",
|
|
40
8
|
"tests/matlab_test_data_collectors/python_testers/expandMatrix_test.py::test_expand_matrix_test",
|
|
9
|
+
"tests/matlab_test_data_collectors/python_testers/focusBowlONeil_test.py::test_focused_bowl_oneil",
|
|
41
10
|
"tests/matlab_test_data_collectors/python_testers/fourierShift_test.py::test_fourier_shift",
|
|
42
11
|
"tests/matlab_test_data_collectors/python_testers/gaussianFilter_test.py::test_gaussianFilter",
|
|
43
12
|
"tests/matlab_test_data_collectors/python_testers/gaussian_test.py::test_gaussian",
|
|
13
|
+
"tests/matlab_test_data_collectors/python_testers/getAffineMatrix_test.py::test_get_affine_matrix",
|
|
44
14
|
"tests/matlab_test_data_collectors/python_testers/getColorMap_test.py::test_get_color_map",
|
|
15
|
+
"tests/matlab_test_data_collectors/python_testers/getDeltaBLI_test.py::test_get_delta_bli",
|
|
45
16
|
"tests/matlab_test_data_collectors/python_testers/getWin_test.py::test_get_win",
|
|
46
|
-
"tests/matlab_test_data_collectors/python_testers/h5io_test.py::test_writeGrid",
|
|
47
17
|
"tests/matlab_test_data_collectors/python_testers/h5io_test.py::test_write_attributes",
|
|
48
18
|
"tests/matlab_test_data_collectors/python_testers/h5io_test.py::test_write_flags",
|
|
49
19
|
"tests/matlab_test_data_collectors/python_testers/h5io_test.py::test_write_grid",
|
|
50
20
|
"tests/matlab_test_data_collectors/python_testers/h5io_test.py::test_write_matrix",
|
|
51
|
-
"tests/matlab_test_data_collectors/python_testers/
|
|
21
|
+
"tests/matlab_test_data_collectors/python_testers/kWaveArray_test.py::test_kwave_array",
|
|
52
22
|
"tests/matlab_test_data_collectors/python_testers/kWaveGrid_test.py::test_kwave_grid",
|
|
53
23
|
"tests/matlab_test_data_collectors/python_testers/makeArc_test.py::test_makeArc",
|
|
54
24
|
"tests/matlab_test_data_collectors/python_testers/makeBall_test.py::test_makeBall",
|
|
55
25
|
"tests/matlab_test_data_collectors/python_testers/makeBowl_test.py::test_makeBowl",
|
|
26
|
+
"tests/matlab_test_data_collectors/python_testers/makeCartArc_test.py::test_makeCartArc",
|
|
27
|
+
"tests/matlab_test_data_collectors/python_testers/makeCartBowl_test.py::test_make_cart_bowl",
|
|
56
28
|
"tests/matlab_test_data_collectors/python_testers/makeCartCircle_test.py::test_makeCartCircle",
|
|
29
|
+
"tests/matlab_test_data_collectors/python_testers/makeCartRect_test.py::test_make_cart_rect",
|
|
57
30
|
"tests/matlab_test_data_collectors/python_testers/makeCartSphere_test.py::test_makeCartSphere",
|
|
31
|
+
"tests/matlab_test_data_collectors/python_testers/makeCartSphericalSegment_test.py::test_make_cart_spherical_segments",
|
|
58
32
|
"tests/matlab_test_data_collectors/python_testers/makeCircle_test.py::test_makeCircle",
|
|
59
33
|
"tests/matlab_test_data_collectors/python_testers/makeDisc_test.py::test_makeDisc",
|
|
60
34
|
"tests/matlab_test_data_collectors/python_testers/makeLine_test.py::test_makeLine",
|
|
@@ -65,40 +39,27 @@
|
|
|
65
39
|
"tests/matlab_test_data_collectors/python_testers/maxND_test.py::test_maxND",
|
|
66
40
|
"tests/matlab_test_data_collectors/python_testers/minND_test.py::test_minND",
|
|
67
41
|
"tests/matlab_test_data_collectors/python_testers/reorderBinarySensorData_test.py::test_binary_sensor_data",
|
|
68
|
-
"tests/matlab_test_data_collectors/python_testers/reorderSensorData_test.py::test_reorderSensorData",
|
|
69
42
|
"tests/matlab_test_data_collectors/python_testers/reorderSensorData_test.py::test_reorder_sensor_data",
|
|
70
43
|
"tests/matlab_test_data_collectors/python_testers/revolve2D_test.py::test_revolve2D",
|
|
71
44
|
"tests/matlab_test_data_collectors/python_testers/scaleSI_test.py::test_scale_si",
|
|
72
45
|
"tests/matlab_test_data_collectors/python_testers/scaleTime_test.py::test_scale_time",
|
|
73
46
|
"tests/matlab_test_data_collectors/python_testers/scanConversion_test.py::test_scanConversion",
|
|
74
|
-
"tests/matlab_test_data_collectors/python_testers/sharpness_test.py::test_brenner",
|
|
75
47
|
"tests/matlab_test_data_collectors/python_testers/sharpness_test.py::test_brenner2d",
|
|
76
48
|
"tests/matlab_test_data_collectors/python_testers/sharpness_test.py::test_brenner3d",
|
|
77
49
|
"tests/matlab_test_data_collectors/python_testers/sharpness_test.py::test_normvar",
|
|
78
|
-
"tests/matlab_test_data_collectors/python_testers/sharpness_test.py::test_tannenbaum",
|
|
79
|
-
"tests/matlab_test_data_collectors/python_testers/sharpness_test.py::test_tennenbaum",
|
|
80
50
|
"tests/matlab_test_data_collectors/python_testers/sharpness_test.py::test_tennenbaum2d",
|
|
81
51
|
"tests/matlab_test_data_collectors/python_testers/sharpness_test.py::test_tennenbaum3d",
|
|
82
|
-
"tests/matlab_test_data_collectors/python_testers/smooth_test.py::test_brenner2d",
|
|
83
|
-
"tests/matlab_test_data_collectors/python_testers/smooth_test.py::test_brenner3d",
|
|
84
|
-
"tests/matlab_test_data_collectors/python_testers/smooth_test.py::test_normvar",
|
|
85
52
|
"tests/matlab_test_data_collectors/python_testers/smooth_test.py::test_smooth",
|
|
86
|
-
"tests/matlab_test_data_collectors/python_testers/smooth_test.py::test_tennenbaum3d",
|
|
87
53
|
"tests/matlab_test_data_collectors/python_testers/test_interpcartdata.py::test_interpcartdata",
|
|
54
|
+
"tests/matlab_test_data_collectors/python_testers/test_make_cart_disc.py::test_make_cart_disc",
|
|
88
55
|
"tests/matlab_test_data_collectors/python_testers/test_resize.py::test_resize",
|
|
89
|
-
"tests/matlab_test_data_collectors/python_testers/test_resize.py::test_revolve2D",
|
|
90
56
|
"tests/matlab_test_data_collectors/python_testers/toneBurst_test.py::test_tone_burst",
|
|
57
|
+
"tests/matlab_test_data_collectors/python_testers/trimCartPoints_test.py::test_trim_cart_points",
|
|
91
58
|
"tests/matlab_test_data_collectors/python_testers/unmaskSensorData_test.py::test_unmask_sensor_data",
|
|
92
|
-
"tests/matlab_test_data_collectors/python_testers/writeMatrix_test.py::test_writeAttributes",
|
|
93
|
-
"tests/matlab_test_data_collectors/python_testers/writeMatrix_test.py::test_writeFlags",
|
|
94
|
-
"tests/matlab_test_data_collectors/python_testers/writeMatrix_test.py::test_writeGrid",
|
|
95
|
-
"tests/matlab_test_data_collectors/python_testers/writeMatrix_test.py::test_writeMatrix",
|
|
96
59
|
"tests/test_binary_present.py::test_linux_afp_binaries_present",
|
|
97
|
-
"tests/test_binary_present.py::test_linux_binaries_present",
|
|
98
60
|
"tests/test_binary_present.py::test_linux_cuda_binaries_present",
|
|
99
61
|
"tests/test_binary_present.py::test_linux_omp_binaries_present",
|
|
100
62
|
"tests/test_binary_present.py::test_windows_afp_binaries_present",
|
|
101
|
-
"tests/test_binary_present.py::test_windows_binaries_present",
|
|
102
63
|
"tests/test_binary_present.py::test_windows_cuda_binaries_present",
|
|
103
64
|
"tests/test_binary_present.py::test_windows_cufft6410_binaries_present",
|
|
104
65
|
"tests/test_binary_present.py::test_windows_cufft64_binaries_present",
|
|
@@ -115,17 +76,8 @@
|
|
|
115
76
|
"tests/test_cpp_io_in_parts.py::test_cpp_io_in_parts",
|
|
116
77
|
"tests/test_cpp_running_simulations.py::test_cpp_running_simulations",
|
|
117
78
|
"tests/test_executor.py::TestExecutor::test_system_call_correct",
|
|
118
|
-
"tests/test_filterutils.py::test_brenner_sharpness2",
|
|
119
|
-
"tests/test_filterutils.py::test_brenner_sharpness3",
|
|
120
|
-
"tests/test_filterutils.py::test_create_cw_signals",
|
|
121
79
|
"tests/test_filterutils.py::test_envelope_detection",
|
|
122
80
|
"tests/test_filterutils.py::test_fwhm",
|
|
123
|
-
"tests/test_filterutils.py::test_gaussian",
|
|
124
|
-
"tests/test_filterutils.py::test_gaussian_filter",
|
|
125
|
-
"tests/test_filterutils.py::test_norm_var_sharpness",
|
|
126
|
-
"tests/test_filterutils.py::test_smooth",
|
|
127
|
-
"tests/test_filterutils.py::test_tannenbaum_sharpness2",
|
|
128
|
-
"tests/test_filterutils.py::test_tannenbaum_sharpness3",
|
|
129
81
|
"tests/test_ivp_3D_simulation.py::test_ivp_3D_simulation",
|
|
130
82
|
"tests/test_ivp_axisymmetric_simulation.py::test_ivp_axisymmetric_simulation",
|
|
131
83
|
"tests/test_ivp_binary_sensor_mask.py::test_ivp_binary_sensor_mask",
|
|
@@ -139,24 +91,20 @@
|
|
|
139
91
|
"tests/test_kutils.py::test_check_stability",
|
|
140
92
|
"tests/test_kutils.py::test_focus",
|
|
141
93
|
"tests/test_kutils.py::test_get_alpha_filters_1D",
|
|
142
|
-
"tests/test_kutils.py::test_get_alpha_filters_2D",
|
|
143
94
|
"tests/test_kutils.py::test_get_alpha_filters_2d",
|
|
95
|
+
"tests/test_kutils.py::test_make_time",
|
|
144
96
|
"tests/test_kutils.py::test_prime_factors",
|
|
145
97
|
"tests/test_misc.py::test_find_closest",
|
|
146
|
-
"tests/test_misc.py::test_focused_bowl_oneil",
|
|
147
98
|
"tests/test_misc.py::test_round_even_down",
|
|
148
99
|
"tests/test_misc.py::test_round_even_up",
|
|
149
100
|
"tests/test_misc.py::test_round_odd_down",
|
|
150
101
|
"tests/test_misc.py::test_round_odd_up",
|
|
151
|
-
"tests/test_na_controlling_the_PML.py::test_na_controlling_the_PML",
|
|
152
102
|
"tests/test_na_controlling_the_PML.py::test_na_controlling_the_pml",
|
|
153
103
|
"tests/test_na_optimising_performance.py::test_na_optimising_performance",
|
|
154
|
-
"tests/test_pmlutils.py::test_get_optimal_pml_size_1D",
|
|
155
104
|
"tests/test_pmlutils.py::test_get_optimal_pml_size_1d",
|
|
156
105
|
"tests/test_pmlutils.py::test_get_optimal_pml_size_2D",
|
|
157
106
|
"tests/test_pmlutils.py::test_get_optimal_pml_size_3D",
|
|
158
107
|
"tests/test_pr_2D_FFT_line_sensor.py::test_pr_2D_FFT_line_sensor",
|
|
159
|
-
"tests/test_pr_2D_TR_circular_sensor.py::test_pr_2D_TR_circular_sensor",
|
|
160
108
|
"tests/test_pr_2D_TR_circular_sensor.py::test_pr_2d_tr_circular_sensor",
|
|
161
109
|
"tests/test_pr_2D_TR_directional_sensors.py::test_pr_2D_TR_directional_sensors",
|
|
162
110
|
"tests/test_pr_2D_TR_line_sensor.py::test_pr_2D_TR_line_sensor",
|
|
@@ -166,7 +114,6 @@
|
|
|
166
114
|
"tests/test_sd_directional_array_elements.py::test_sd_directional_array_elements",
|
|
167
115
|
"tests/test_sd_directivity_modelling_2D.py::test_sd_directivity_modelling_2D",
|
|
168
116
|
"tests/test_sd_directivity_modelling_3D.py::test_sd_directivity_modelling_3D",
|
|
169
|
-
"tests/test_sd_focussed_detector_2D.py::test_sd_focussed_detector_2D",
|
|
170
117
|
"tests/test_sd_focussed_detector_2D.py::test_sd_focussed_detector_2d",
|
|
171
118
|
"tests/test_sd_sensor_directivity_2D.py::test_sd_sensor_directivity_2D",
|
|
172
119
|
"tests/test_tvsp_3D_simulation.py::test_tvsp_3D_simulation",
|
|
@@ -179,7 +126,6 @@
|
|
|
179
126
|
"tests/test_us_defining_transducer.py::test_us_defining_transducer",
|
|
180
127
|
"tests/test_us_transducer_as_sensor.py::test_us_transducer_as_sensor",
|
|
181
128
|
"tests/test_utils.py::test_add_noise",
|
|
182
|
-
"tests/test_utils.py::test_add_noise_peak",
|
|
183
129
|
"tests/test_utils.py::test_apply_filter_bandpass",
|
|
184
130
|
"tests/test_utils.py::test_apply_filter_highpass",
|
|
185
131
|
"tests/test_utils.py::test_apply_filter_lowpass",
|
|
@@ -194,16 +140,6 @@
|
|
|
194
140
|
"tests/test_utils.py::test_gradient_spacing_ndim",
|
|
195
141
|
"tests/test_utils.py::test_gradient_spect_1D",
|
|
196
142
|
"tests/test_utils.py::test_gradient_spect_2D",
|
|
197
|
-
"tests/test_utils.py::test_grid2cart",
|
|
198
|
-
"tests/test_utils.py::test_grid2cart_1D",
|
|
199
|
-
"tests/test_utils.py::test_grid2cart_2D",
|
|
200
|
-
"tests/test_utils.py::test_grid2cart_3D",
|
|
201
|
-
"tests/test_utils.py::test_hounsfield2soundspeed",
|
|
202
|
-
"tests/test_utils.py::test_interpCartData",
|
|
203
|
-
"tests/test_utils.py::test_interp_cart_data",
|
|
204
|
-
"tests/test_utils.py::test_interpftn",
|
|
205
|
-
"tests/test_utils.py::test_make_cart_circle",
|
|
206
|
-
"tests/test_utils.py::test_make_cart_sphere",
|
|
207
143
|
"tests/test_utils.py::test_nepers2db",
|
|
208
144
|
"tests/test_utils.py::test_num_dim",
|
|
209
145
|
"tests/test_utils.py::test_power_kramers_kronig",
|
|
@@ -212,14 +148,11 @@
|
|
|
212
148
|
"tests/test_utils.py::test_resize_2D_nearest_larger",
|
|
213
149
|
"tests/test_utils.py::test_resize_2D_nearest_smaller",
|
|
214
150
|
"tests/test_utils.py::test_resize_2D_splinef2d",
|
|
215
|
-
"tests/test_utils.py::test_ring_up_down",
|
|
216
151
|
"tests/test_utils.py::test_signal_length",
|
|
217
152
|
"tests/test_utils.py::test_signal_offset",
|
|
218
153
|
"tests/test_utils.py::test_spect",
|
|
219
|
-
"tests/test_utils.py::test_tone_burst_gaussian",
|
|
220
|
-
"tests/test_utils.py::test_tone_burst_rectangular",
|
|
221
|
-
"tests/test_utils.py::test_tone_burst_ring",
|
|
222
154
|
"tests/test_utils.py::test_tone_error",
|
|
155
|
+
"tests/test_utils.py::test_trim_zeros",
|
|
223
156
|
"tests/test_water.py::test_water_absorption",
|
|
224
157
|
"tests/test_water.py::test_water_density",
|
|
225
158
|
"tests/test_water.py::test_water_non_linearity",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Signature: 8a477f597d28d172789f06886806bc55
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -4,7 +4,8 @@ RUN apt-get update
|
|
|
4
4
|
RUN apt-get install -y gfortran libopenblas-dev liblapack-dev libgl1-mesa-glx libglib2.0-0 libgl1-mesa-glx libglib2.0-0 git
|
|
5
5
|
RUN pip install --upgrade pip
|
|
6
6
|
COPY pyproject.toml .
|
|
7
|
-
COPY README.md .
|
|
7
|
+
#COPY README.md .
|
|
8
|
+
COPY docs/ docs
|
|
8
9
|
COPY LICENSE .
|
|
9
10
|
COPY kwave/ kwave
|
|
10
11
|
RUN pip install '.[test]'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: k-Wave-python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: Acoustics toolbox for time domain acoustic and ultrasound simulations in complex and tissue-realistic media.
|
|
5
5
|
Project-URL: Homepage, http://www.k-wave.org/
|
|
6
6
|
Project-URL: Documentation, https://waltersimson.com/k-wave-python/
|
|
@@ -687,38 +687,42 @@ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
|
687
687
|
Classifier: Operating System :: OS Independent
|
|
688
688
|
Classifier: Programming Language :: Python :: 3
|
|
689
689
|
Requires-Python: >=3.8
|
|
690
|
-
Requires-Dist:
|
|
691
|
-
Requires-Dist:
|
|
692
|
-
Requires-Dist:
|
|
693
|
-
Requires-Dist:
|
|
694
|
-
Requires-Dist:
|
|
695
|
-
Requires-Dist:
|
|
696
|
-
Requires-Dist:
|
|
697
|
-
Requires-Dist:
|
|
690
|
+
Requires-Dist: beartype==0.16.4
|
|
691
|
+
Requires-Dist: deepdiff==6.7.1
|
|
692
|
+
Requires-Dist: h5py==3.10.0
|
|
693
|
+
Requires-Dist: matplotlib==3.7.2
|
|
694
|
+
Requires-Dist: nptyping==2.5.0
|
|
695
|
+
Requires-Dist: numpy<1.27.0,>=1.22.2
|
|
696
|
+
Requires-Dist: opencv-python==4.9.0.80
|
|
697
|
+
Requires-Dist: scipy==1.10.1
|
|
698
|
+
Provides-Extra: dev
|
|
699
|
+
Requires-Dist: pre-commit==3.5.0; extra == 'dev'
|
|
698
700
|
Provides-Extra: docs
|
|
699
|
-
Requires-Dist: furo==
|
|
701
|
+
Requires-Dist: furo==2023.9.10; extra == 'docs'
|
|
700
702
|
Requires-Dist: m2r2==0.3.2; extra == 'docs'
|
|
701
|
-
Requires-Dist: sphinx-copybutton==0.5.
|
|
702
|
-
Requires-Dist: sphinx-tabs==3.4.
|
|
703
|
-
Requires-Dist: sphinx-toolbox==3.
|
|
703
|
+
Requires-Dist: sphinx-copybutton==0.5.2; extra == 'docs'
|
|
704
|
+
Requires-Dist: sphinx-tabs==3.4.4; extra == 'docs'
|
|
705
|
+
Requires-Dist: sphinx-toolbox==3.5.0; extra == 'docs'
|
|
704
706
|
Provides-Extra: example
|
|
705
|
-
Requires-Dist: gdown==4.
|
|
707
|
+
Requires-Dist: gdown==4.7.3; extra == 'example'
|
|
706
708
|
Provides-Extra: test
|
|
707
709
|
Requires-Dist: phantominator; extra == 'test'
|
|
708
710
|
Requires-Dist: pytest; extra == 'test'
|
|
711
|
+
Requires-Dist: requests==2.31.0; extra == 'test'
|
|
709
712
|
Description-Content-Type: text/markdown
|
|
710
713
|
|
|
711
714
|
# k-Wave-python
|
|
715
|
+
[](https://k-wave-python.readthedocs.io/en/latest/?badge=latest)
|
|
712
716
|
|
|
713
|
-
This project is a Python implementation of
|
|
714
|
-
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.
|
|
717
|
+
This project is a Python implementation of v1.4.0 of the [MATLAB toolbox k-Wave](http://www.k-wave.org/) as well as an
|
|
718
|
+
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.
|
|
715
719
|
|
|
716
720
|
## Mission
|
|
717
721
|
|
|
718
|
-
With this project, we hope to increase accessibility and reproducibility of [k-Wave](http://www.k-wave.org/) simulations
|
|
719
|
-
for medical imaging, algorithmic prototyping and testing. Many tools and methods of [k-Wave](http://www.k-wave.org/) can
|
|
722
|
+
With this project, we hope to increase the accessibility and reproducibility of [k-Wave](http://www.k-wave.org/) simulations
|
|
723
|
+
for medical imaging, algorithmic prototyping, and testing. Many tools and methods of [k-Wave](http://www.k-wave.org/) can
|
|
720
724
|
be found here, but this project has and will continue to diverge from the original [k-Wave](http://www.k-wave.org/) APIs
|
|
721
|
-
|
|
725
|
+
to leverage pythonic practices.
|
|
722
726
|
|
|
723
727
|
## Installation
|
|
724
728
|
|
|
@@ -728,7 +732,7 @@ To install the most recent build of k-Wave-python from PyPI, run:
|
|
|
728
732
|
pip install k-wave-python
|
|
729
733
|
```
|
|
730
734
|
|
|
731
|
-
After installing the
|
|
735
|
+
After installing the Python package, the required binaries will be downloaded and installed the first time you run a
|
|
732
736
|
simulation.
|
|
733
737
|
|
|
734
738
|
## Getting started
|
|
@@ -740,8 +744,9 @@ After installation, run the B-mode reconstruction example in the `examples` dire
|
|
|
740
744
|
```bash
|
|
741
745
|
git clone https://github.com/waltsims/k-wave-python
|
|
742
746
|
cd k-wave-python
|
|
747
|
+
git checkout v0.3.0
|
|
743
748
|
pip install '.[example]'
|
|
744
|
-
python3 examples/
|
|
749
|
+
python3 examples/us_bmode_linear_transducer/us_bmode_linear_transducer.py
|
|
745
750
|
```
|
|
746
751
|
|
|
747
752
|
This example file steps through the process of:
|
|
@@ -754,13 +759,13 @@ This example file steps through the process of:
|
|
|
754
759
|
This example expects an NVIDIA GPU by default to simulate with k-Wave.
|
|
755
760
|
|
|
756
761
|
To test the reconstruction on a machine with a GPU,
|
|
757
|
-
set `RUN_SIMULATION` [on line
|
|
758
|
-
to `True
|
|
762
|
+
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)
|
|
763
|
+
to `True`, and the example will run without the pre-computed data.
|
|
759
764
|
|
|
760
765
|
## Development
|
|
761
766
|
|
|
762
767
|
If you're enjoying k-Wave-python and want to contribute, development instructions can be
|
|
763
|
-
found [here](https://
|
|
768
|
+
found [here](https://k-wave-python.readthedocs.io/en/latest/development/development_environment.html).
|
|
764
769
|
|
|
765
770
|
## Related Projects
|
|
766
771
|
|
|
@@ -772,8 +777,8 @@ found [here](https://waltersimson.com/k-wave-python/development/development_envi
|
|
|
772
777
|
|
|
773
778
|
## Documentation
|
|
774
779
|
|
|
775
|
-
The documentation for k-wave-python can be found [here](
|
|
780
|
+
The documentation for k-wave-python can be found [here](https://k-wave-python.readthedocs.io/en/latest/).
|
|
776
781
|
|
|
777
782
|
## Contact
|
|
778
783
|
|
|
779
|
-
e-mail [
|
|
784
|
+
e-mail [wsimson@stanford.edu](mailto:wsimson@stanford.edu).
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
# k-Wave-python
|
|
2
|
+
[](https://k-wave-python.readthedocs.io/en/latest/?badge=latest)
|
|
2
3
|
|
|
3
|
-
This project is a Python implementation of
|
|
4
|
-
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.
|
|
4
|
+
This project is a Python implementation of v1.4.0 of the [MATLAB toolbox k-Wave](http://www.k-wave.org/) as well as an
|
|
5
|
+
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.
|
|
5
6
|
|
|
6
7
|
## Mission
|
|
7
8
|
|
|
8
|
-
With this project, we hope to increase accessibility and reproducibility of [k-Wave](http://www.k-wave.org/) simulations
|
|
9
|
-
for medical imaging, algorithmic prototyping and testing. Many tools and methods of [k-Wave](http://www.k-wave.org/) can
|
|
9
|
+
With this project, we hope to increase the accessibility and reproducibility of [k-Wave](http://www.k-wave.org/) simulations
|
|
10
|
+
for medical imaging, algorithmic prototyping, and testing. Many tools and methods of [k-Wave](http://www.k-wave.org/) can
|
|
10
11
|
be found here, but this project has and will continue to diverge from the original [k-Wave](http://www.k-wave.org/) APIs
|
|
11
|
-
|
|
12
|
+
to leverage pythonic practices.
|
|
12
13
|
|
|
13
14
|
## Installation
|
|
14
15
|
|
|
@@ -18,7 +19,7 @@ To install the most recent build of k-Wave-python from PyPI, run:
|
|
|
18
19
|
pip install k-wave-python
|
|
19
20
|
```
|
|
20
21
|
|
|
21
|
-
After installing the
|
|
22
|
+
After installing the Python package, the required binaries will be downloaded and installed the first time you run a
|
|
22
23
|
simulation.
|
|
23
24
|
|
|
24
25
|
## Getting started
|
|
@@ -30,8 +31,9 @@ After installation, run the B-mode reconstruction example in the `examples` dire
|
|
|
30
31
|
```bash
|
|
31
32
|
git clone https://github.com/waltsims/k-wave-python
|
|
32
33
|
cd k-wave-python
|
|
34
|
+
git checkout v0.3.0
|
|
33
35
|
pip install '.[example]'
|
|
34
|
-
python3 examples/
|
|
36
|
+
python3 examples/us_bmode_linear_transducer/us_bmode_linear_transducer.py
|
|
35
37
|
```
|
|
36
38
|
|
|
37
39
|
This example file steps through the process of:
|
|
@@ -44,13 +46,13 @@ This example file steps through the process of:
|
|
|
44
46
|
This example expects an NVIDIA GPU by default to simulate with k-Wave.
|
|
45
47
|
|
|
46
48
|
To test the reconstruction on a machine with a GPU,
|
|
47
|
-
set `RUN_SIMULATION` [on line
|
|
48
|
-
to `True
|
|
49
|
+
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)
|
|
50
|
+
to `True`, and the example will run without the pre-computed data.
|
|
49
51
|
|
|
50
52
|
## Development
|
|
51
53
|
|
|
52
54
|
If you're enjoying k-Wave-python and want to contribute, development instructions can be
|
|
53
|
-
found [here](https://
|
|
55
|
+
found [here](https://k-wave-python.readthedocs.io/en/latest/development/development_environment.html).
|
|
54
56
|
|
|
55
57
|
## Related Projects
|
|
56
58
|
|
|
@@ -62,8 +64,8 @@ found [here](https://waltersimson.com/k-wave-python/development/development_envi
|
|
|
62
64
|
|
|
63
65
|
## Documentation
|
|
64
66
|
|
|
65
|
-
The documentation for k-wave-python can be found [here](
|
|
67
|
+
The documentation for k-wave-python can be found [here](https://k-wave-python.readthedocs.io/en/latest/).
|
|
66
68
|
|
|
67
69
|
## Contact
|
|
68
70
|
|
|
69
|
-
e-mail [
|
|
71
|
+
e-mail [wsimson@stanford.edu](mailto:wsimson@stanford.edu).
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
+
import logging
|
|
1
2
|
import os
|
|
2
3
|
import sys
|
|
3
4
|
import urllib.request
|
|
4
5
|
from os import environ
|
|
5
6
|
from pathlib import Path
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
from kwave.options import SimulationOptions
|
|
11
|
-
|
|
12
|
-
VERSION = '0.2.1'
|
|
8
|
+
# Test installation with:
|
|
9
|
+
# python3 -m pip install -i https://test.pypi.org/simple/ --extra-index-url=https://pypi.org/simple/ k-Wave-python==0.3.0
|
|
10
|
+
VERSION = '0.3.1'
|
|
13
11
|
# Set environment variable to binaries to get rid of user warning
|
|
14
12
|
# This code is a crutch and should be removed when kspaceFirstOrder
|
|
15
13
|
# is refactored
|
|
@@ -61,7 +59,7 @@ def binaries_present() -> bool:
|
|
|
61
59
|
|
|
62
60
|
for binary in binary_list[system]:
|
|
63
61
|
if not os.path.exists(os.path.join(binary_path, binary)):
|
|
64
|
-
|
|
62
|
+
logging.log(logging.WARN, f"{binary} not found")
|
|
65
63
|
return False
|
|
66
64
|
return True
|
|
67
65
|
|
|
@@ -98,7 +96,7 @@ def download_binaries(system_os: str, bin_type: str):
|
|
|
98
96
|
# Extract the file name from the GitHub release URL
|
|
99
97
|
filename = url.split("/")[-1]
|
|
100
98
|
|
|
101
|
-
|
|
99
|
+
logging.log(logging.INFO, f"Downloading {filename} to {binary_path}...")
|
|
102
100
|
|
|
103
101
|
# Create the directory if it does not yet exist
|
|
104
102
|
os.makedirs(binary_path, exist_ok=True)
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
import numpy as np
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Vector(np.ndarray):
|
|
8
|
+
def __new__(cls, elements: list):
|
|
9
|
+
assert 1 <= len(elements) <= 3
|
|
10
|
+
elements = list(elements)
|
|
11
|
+
obj = np.array(elements).view(cls)
|
|
12
|
+
return obj
|
|
13
|
+
|
|
14
|
+
@property
|
|
15
|
+
def x(self):
|
|
16
|
+
return self[0]
|
|
17
|
+
|
|
18
|
+
@x.setter
|
|
19
|
+
def x(self, value):
|
|
20
|
+
self[0] = value
|
|
21
|
+
|
|
22
|
+
@property
|
|
23
|
+
def y(self):
|
|
24
|
+
if self.shape[0] > 1:
|
|
25
|
+
return self[1]
|
|
26
|
+
return np.nan
|
|
27
|
+
|
|
28
|
+
@y.setter
|
|
29
|
+
def y(self, value):
|
|
30
|
+
if self.shape[0] > 1:
|
|
31
|
+
self[1] = value
|
|
32
|
+
|
|
33
|
+
@property
|
|
34
|
+
def z(self):
|
|
35
|
+
if self.shape[0] > 2:
|
|
36
|
+
return self[2]
|
|
37
|
+
return np.nan
|
|
38
|
+
|
|
39
|
+
@z.setter
|
|
40
|
+
def z(self, value):
|
|
41
|
+
if self.shape[0] > 2:
|
|
42
|
+
self[2] = value
|
|
43
|
+
|
|
44
|
+
def assign_dim(self, dim: int, val: Any):
|
|
45
|
+
self[dim - 1] = val
|
|
46
|
+
|
|
47
|
+
def append(self, value):
|
|
48
|
+
new_coordinates = list(self) + [value]
|
|
49
|
+
return Vector(new_coordinates)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
@dataclass
|
|
53
|
+
class FlexibleVector(object):
|
|
54
|
+
"""
|
|
55
|
+
This class is very similar to Numpy.ndarray but there are differences:
|
|
56
|
+
- It can have 3 elements at max
|
|
57
|
+
- Its elements can be anything
|
|
58
|
+
- The elements do not have to be same type,
|
|
59
|
+
e.g. this is valid: Array([<scalar>, <List>, <Tuple of Tuples>])
|
|
60
|
+
|
|
61
|
+
WARNING: The class will be deprecated once we refactor the kWaveGrid class to use the Vector class instead!
|
|
62
|
+
"""
|
|
63
|
+
data: list
|
|
64
|
+
|
|
65
|
+
def __post_init__(self):
|
|
66
|
+
assert 1 <= len(self) <= 3
|
|
67
|
+
|
|
68
|
+
def __len__(self):
|
|
69
|
+
return len(self.data)
|
|
70
|
+
|
|
71
|
+
def __getitem__(self, item):
|
|
72
|
+
return self.data[item]
|
|
73
|
+
|
|
74
|
+
def __setitem__(self, key, value):
|
|
75
|
+
self.data[key] = value
|
|
76
|
+
|
|
77
|
+
@property
|
|
78
|
+
def x(self):
|
|
79
|
+
return self[0]
|
|
80
|
+
|
|
81
|
+
@x.setter
|
|
82
|
+
def x(self, val):
|
|
83
|
+
self[0] = val
|
|
84
|
+
|
|
85
|
+
@property
|
|
86
|
+
def y(self):
|
|
87
|
+
return self[1] if len(self) >= 2 else np.nan
|
|
88
|
+
|
|
89
|
+
@y.setter
|
|
90
|
+
def y(self, val):
|
|
91
|
+
assert len(self) >= 2
|
|
92
|
+
self[1] = val
|
|
93
|
+
|
|
94
|
+
@property
|
|
95
|
+
def z(self):
|
|
96
|
+
"""
|
|
97
|
+
:return: 3rd dimension element. 0 if not defined
|
|
98
|
+
"""
|
|
99
|
+
return self[2] if len(self) == 3 else np.nan
|
|
100
|
+
|
|
101
|
+
@z.setter
|
|
102
|
+
def z(self, val):
|
|
103
|
+
assert len(self) == 3
|
|
104
|
+
self[2] = val
|
|
105
|
+
|
|
106
|
+
def numpy(self):
|
|
107
|
+
return np.asarray(self.data)
|
|
108
|
+
|
|
109
|
+
def assign_dim(self, dim, val):
|
|
110
|
+
if dim == 1:
|
|
111
|
+
self.x = val
|
|
112
|
+
if dim == 2:
|
|
113
|
+
self.y = val
|
|
114
|
+
if dim == 3:
|
|
115
|
+
self.z = val
|
|
116
|
+
|
|
117
|
+
def append(self, val):
|
|
118
|
+
assert len(self.data) <= 2
|
|
119
|
+
self.data.append(val)
|
|
120
|
+
return self
|