k-wave-python
k-wave-python copied to clipboard
Fix apply apodization
This pull request includes significant changes to the check_source method in the kwave/kWaveSimulation.py file to improve the handling of transducer input signals and apodization. The most important changes include renaming a parameter, reshaping the input signal, and enhancing the apodization process. closes #518
Parameter renaming:
- Renamed
kgrid_dimtok_dimin the method arguments for clarity.
Input signal handling:
- Changed
self.transducer_input_signalto a local variabletransducer_input_signaland ensured it has the correct shape by reshaping it if necessary. - Added steps to ensure the final transducer input signal has a leading singleton dimension and transposed the last two axes for compatibility.
Apodization processing:
- Enhanced the apodization process by using the
get_transmit_apodization()method and applying the apodization to the reshaped input signal. - Stored the apodized input signal in
self.transducer_input_signalfor later use.