openlifu.sim.kwave_if

Functions

get_karray(arr[, bli_tolerance, ...])

get_kgrid(coords[, t_end, dt, ...])

get_medium(params[, ref_values_only])

get_sensor(kgrid[, record])

get_source(kgrid, karray, source_sig)

run_simulation(arr, params[, delays, apod, ...])

Run a k-wave simulation for the given transducer array and parameters. :param arr: The transducer array to simulate. :param params: The simulation parameters as an xarray Dataset. Must include 'sound_speed', ' :param density': :param and 'attenuation' variables with appropriate units.: :param delays: Optional array of time delays for each element in the transducer array, in seconds. If None, no delays will be applied. :param apod: Optional array of apodization values for each element in the transducer array. If None, no apodization will be applied. :param freq: The frequency of the input signal in Hz. Default is 1 MHz. :param cycles: The number of cycles in the input signal. Default is 20. :param amplitude: The amplitude of the input signal. Default is 1. :param dt: The time step for the simulation in seconds. If 0, it will be automatically calculated based on the CFL condition. :param t_end: The total time for the simulation in seconds. If 0, it will be automatically calculated based on the input signal duration and the CFL condition. :param cfl: The Courant-Friedrichs-Lewy (CFL) number for the simulation. Default is 0.5. :param bli_tolerance: The tolerance for the boundary layer integral method used in k-wave. Default is 0.05. :param upsampling_rate: The upsampling rate for the boundary layer integral method used in k-wave Default is 5. :param gpu: Whether to use GPU for the simulation. Default is True. If False, the simulation will run on the CPU. Note that running on CPU may be very slow for large simulations. :param ref_values_only: Whether to use only the reference values for the medium properties (sound speed, density, attenuation) instead of the full spatial maps. Default is False. Setting this to True can significantly speed up the simulation, but will not capture any spatial variations in the medium properties. :param return_kwave_outputs: Whether to return the raw outputs from k-wave in addition to the processed xarray Dataset. Default is False. :param return_kwave_inputs: Whether to return the inputs to k-wave (kgrid, source, sensor, medium) in addition to the processed xarray Dataset. Default is False. :param sensor_record: List of strings specifying which k-wave sensor outputs to record. Can include ' :param p_max': :param 'p_min': :param and 'p'. Default is ['p_max': :param 'p_min'].:.