zea.beamform.lens_correction¶
Lens corrected delay computation for ultrasound beamforming.
Functions
|
Compute the lens corrected delays IN SAMPLES for a given grid and transmit scheme. |
|
Compute the travel time of the shortest path between the element and the pixel. |
|
Compute the travel time between two points. |
|
Computes the lateral point on the lens that the shortest path goes through based on Fermat's principle. |
|
Computes the update step for the lateral point on the lens that the shortest path using the Newton-Raphson method. |
- zea.beamform.lens_correction.calculate_lens_corrected_delays(grid, t0_delays, tx_apodizations, probe_geometry, initial_times, sampling_frequency, sound_speed, n_tx, n_el, focus_distances, polar_angles, lens_sound_speed=1000, lens_thickness=0.001, n_iter=2)[source]¶
Compute the lens corrected delays IN SAMPLES for a given grid and transmit scheme.
- Parameters:
grid (ndarray) – The grid of shape (n_pixels, 3).
t0_delays (ndarray) – The t0 delays of shape (n_tx, n_el).
tx_apodizations (ndarray) – The transmit apodizations of shape (n_tx, n_el).
probe_geometry (ndarray) – The probe geometry of shape (n_el, 3).
initial_times (ndarray) – The initial times of shape (n_tx,).
sampling_frequency (float) – The sampling frequency in Hz.
sound_speed (float) – The speed of sound in the medium in m/s.
n_tx (int) – The number of transmits.
n_el (int) – The number of elements.
focus_distances (ndarray) – The focus distances of shape (n_tx,).
polar_angles (ndarray) – The polar angles of shape (n_tx,).
lens_sound_speed (float) – The speed of sound in the lens in m/s.
lens_thickness (float) – The thickness of the lens in meters.
n_iter (int) – The number of iterations to run the Newton-Raphson method.
- Returns:
The transmit delays in samples of shape (n_pixels, n_tx). ndarray: The receive delays in samples of shape (n_pixels, n_el).
- Return type:
ndarray
- zea.beamform.lens_correction.compute_lens_corrected_travel_times(element_pos, pixel_pos, lens_thickness, c_lens, c_medium, n_iter=1)[source]¶
Compute the travel time of the shortest path between the element and the pixel.
- Parameters:
element_pos (ndarray) – The position of the element of shape (n_elements, 3).
pixel_pos (ndarray) – The position of the pixel of shape (n_pixels, 3).
lens_thickness (float) – The thickness of the lens in meters.
c_lens (float) – The speed of sound in the lens in m/s.
c_medium (float) – The speed of sound in the medium in m/s.
n_iter (int) – The number of iterations to run the Newton-Raphson method.
- Returns:
The travel times of shape (n_pixels, n_elements).
- Return type:
ndarray
- zea.beamform.lens_correction.compute_travel_time(pos_a, pos_b, c)[source]¶
Compute the travel time between two points.
- zea.beamform.lens_correction.compute_xl(element_pos_2d, pixel_pos_2d, lens_thickness, c_lens, c_medium, n_iter)[source]¶
Computes the lateral point on the lens that the shortest path goes through based on Fermat’s principle.
- Parameters:
element_pos_2d (float) – The 2D position of the element.
pixel_pos_2d (float) – The 2D position of the pixel.
lens_thickness (float) – The thickness of the lens in meters.
c_lens (float) – The speed of sound in the lens in m/s.
c_medium (float) – The speed of sound in the medium in m/s.
n_iter (int) – The number of iterations to run the Newton-Raphson method.
- Returns:
The x-coordinate of the lateral point on the lens.
- Return type:
float
- zea.beamform.lens_correction.dxl(xe, ze, xl, xs, zs, zl, c_lens, c_medium)[source]¶
Computes the update step for the lateral point on the lens that the shortest path using the Newton-Raphson method.
Notes
This result was derived by defining the total travel time through the lens and the medium as a function of the lateral point on the lens and then taking the derivative. We then have a function whose root is the lateral point on the lens that the shortest path goes through. We then compute the derivative and update the lateral point on the lens using the Newton-Raphson method: x_new = x - f(x) / f’(x).