-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Homogeneous_medium_for sensor only receive signal #46
Comments
Thanks for bringing this up. The project is by no means perfect and I will have a look at this case later this week. As far as running on windows, by cloning the current master branch and following the development instructions, you should be able to get k-wave-python running on Windows. Let me know if you have any troubles with that. I'm happy to try to help. |
with PR #174 the following example will run:
Hope this helps. -Walter |
Hi Walter,
Sorry to bother you again.
I would like to implement a project that only include k-wave simulation about the transducer/sensor receive the acoustic signal from source.
BTW, is this the definition of transducer in your code is the device can transmmit signal and sensor : the device only receive signal?
When I try to save the sensor_data in a similar way as your example in your 'bmode_reconstruction_example.py'
Some error retruns about 'kSensor' object has no attribute 'combine_sensor_data'
Code info:
`
import os
from tempfile import gettempdir
from kwave.ksource import kSource
from kwave.kspaceFirstOrder2D import kspaceFirstOrder2DC
from kwave.kspaceFirstOrder2D import kspaceFirstOrder2DG
from kwave.utils.maputils import makeDisc, makeCartCircle
from kwave.utils import dotdict
from kwave.ktransducer import *
from kwave.kmedium import kWaveMedium
from copy import deepcopy
pathname = '/home/wx/hdd1/k-wave-python/examples'
Nx = 128 # number of grid points in the x (row) direction
Ny = 128 # number of grid points in the y (column) direction
dx = 0.1e-3 # grid point spacing in the x direction [m]
dy = 0.1e-3 # grid point spacing in the y direction [m]
kgrid = kWaveGrid([Nx, Ny], [dx, dy])
t_end = (Nx * dx) * 2.2 / 1500 # [s]
kgrid.makeTime(1500, t_end=t_end)
medium = kWaveMedium(sound_speed=1500, alpha_coeff=0.75, alpha_power=1.5)
disc_magnitude = 5 # [Pa]
disc_x_pos = 50 # [grid points]
disc_y_pos = 50 # [grid points]
disc_radius = 8 # [grid points]
disc_1 = disc_magnitude * makeDisc(Nx, Ny, disc_x_pos, disc_y_pos, disc_radius)
disc_magnitude = 3 # [Pa]
disc_x_pos = 80 # [grid points]
disc_y_pos = 60 # [grid points]
disc_radius = 5 # [grid points]
disc_2 = disc_magnitude * makeDisc(Nx, Ny, disc_x_pos, disc_y_pos, disc_radius)
source = kSource()
source.p0 = disc_1 + disc_2
sensor_radius = 4e-3 # [m]
num_sensor_points = 50
sensor_mask = makeCartCircle(sensor_radius, num_sensor_points)
sensor = kSensor(sensor_mask)
input_filename = f'example_input.h5'
input_file_full_path = os.path.join(pathname, input_filename)
print(input_file_full_path)
input_args = {
'SaveToDisk':input_file_full_path,
'SaveToDiskExit': False
}
sensor_data = kspaceFirstOrder2DG(**{
'medium': medium,
'kgrid': kgrid,
'source': source,
'sensor': sensor,
**input_args
})
Error info:
File "/home/wx/anaconda3/envs/py39k-wave/lib/python3.9/site-packages/kwave/kspaceFirstOrder2D.py", line 386, in kspaceFirstOrder2Dreturn k_sim.sensor.combine_sensor_data(sensor_data)
AttributeError: 'kSensor' object has no attribute 'combine_sensor_data'`
Thanks for you help again, and I would like to become the beta tester of windows. Thank you agagin.
Best Regards
Chenzhe Li
The text was updated successfully, but these errors were encountered: