k-wave-python icon indicating copy to clipboard operation
k-wave-python copied to clipboard

Fix apply apodization

Open waltsims opened this issue 11 months ago • 0 comments

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_dim to k_dim in the method arguments for clarity.

Input signal handling:

  • Changed self.transducer_input_signal to a local variable transducer_input_signal and 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_signal for later use.

waltsims avatar Feb 10 '25 01:02 waltsims