zea.beamform.pfield

Pressure field computation for ultrasound imaging.

This module provides routines for automatic computation of the acoustic pressure field used for compounding multiple transmit (Tx) events in ultrasound imaging.

The pressure field is computed by simulating the acoustic response of the probe and medium for each transmit event. The computation involves:

  • Subdividing each probe element into sub-elements to satisfy the Fraunhofer approximation.

  • Calculating the distances and angles between each grid point and each sub-element.

  • Computing the frequency response of the probe and the pulse spectrum.

  • Summing the contributions from all relevant frequencies, taking into account transmit delays, apodization, and directivity.

  • Optionally normalizing and thresholding the resulting field for use in transmit compounding or adaptive beamforming.

The main entry point is compute_pfield(), which returns a normalized pressure field array for all transmit events.

Functions

compute_pfield(sound_speed, ...[, ...])

Compute the pressure field for ultrasound imaging.

normalize_pressure_field(pfield)

Normalize a pressure field per pixel, over the transmit axis.

shape_pressure_field(pfield[, alpha, percentile])

Per-transmit shaping of a pressure field: floor the dim tail, sharpen the beam.

zea.beamform.pfield.compute_pfield(sound_speed, center_frequency, probe_bandwidth_percent, probe_geometry, tx_apodizations, grid, t0_delays, element_width=None, frequency_step=4, db_thresh=-1.0, downsample=10, downmix=4, alpha=1, percentile=10, norm=True, point_batch_size=2048, interpolation='bilinear', attenuation_coef=0.0)[source]

Compute the pressure field for ultrasound imaging.

This implements PFIELD from MUST in its two-dimensional form: element height and elevation focus are taken to infinity, so the elevation term of the 3-D theory drops out and the Green’s function is 1 / sqrt(r) instead of 1 / r (Eqs. 36-37). Equation numbers in this module refer to the reference below.

Reference

Garcia, D. (2022). SIMUS: An open-source simulator for medical ultrasound imaging. Part I: Theory & examples. Computer Methods and Programs in Biomedicine, 218, 106726. https://www.biomecardio.com/publis/cmpb22.pdf

Only linear (and phased) arrays are supported: all elements must lie on the x-axis and face +z.

Parameters:
  • sound_speed (float) – Speed of sound in the medium.

  • center_frequency (float) – Center frequency of the transmit pulse in Hz.

  • probe_bandwidth_percent (float) – Bandwidth of the probe, pulse-echo 6dB fractional bandwidth (%)

  • probe_geometry (array) – Geometry of the probe elements of shape (n_el, 3).

  • tx_apodizations (array) – Transmit apodizations of shape (n_tx, n_el).

  • grid (array) – Grid points where the pressure field is computed of shape (grid_size_z, grid_size_x, 3).

  • t0_delays (array) – Transmit delays for each transmit event.

  • element_width (float, optional) – Width of a single element in metres. Default is None, which infers it as 90% of the pitch.

  • frequency_step (int, optional) – Frequency step. Default is 4. Higher is faster but less accurate.

  • db_thresh (float, optional) – dB threshold. Default is -1.0 Higher is faster but less accurate.

  • downsample (int, optional) – Downsample the grid for faster computation. Default is 10. Higher is faster but less accurate.

  • downmix (int, optional) – Downmixing the frequency to facilitate a smaller grid. Default is 4. Higher requires lower number of grid points but is less accurate.

  • alpha (float, optional) – Exponent to ‘sharpen or smooth’ the weighting. Higher is sharper. Default is 1. Values above roughly 10 can overflow float32, giving NaN.

  • percentile (int, optional) – minimum percentile threshold to keep in the weighting. Higher is more aggressive. Default is 10.

  • norm (bool, optional) – per pixel normalization over the transmit axis (True) or unnormalized (False).

  • point_batch_size (int, optional) – Batch size for the pressure field computation. Higher is slightly faster, but requires more memory. Default is 2048.

  • interpolation (str, optional) – Interpolation used to resize the pressure field from the downsampled grid back to the full grid. “nearest” is fastest but imprints the downsampled blocks on the weighting, which can cause visible steps at the edges of each transmit’s insonified region; “bilinear” (default) removes those steps at a small extra cost and is recommended for display-quality images.

  • attenuation_coef (float, optional) – Frequency-dependent attenuation of the medium in dB/(cm·MHz), applied one-way along the transmit path (Eq. 40) at the true frequency, regardless of downmix. Default is 0 (lossless). Soft tissue is ~0.5; with it the high end of the band, which focuses hardest, is lost with depth, so the focus is wider and weaker than in the lossless field.

Returns:

The (normalized) pressure field (across tx events)

of shape (n_tx, grid_size_z, grid_size_x).

Return type:

ops.array

zea.beamform.pfield.normalize_pressure_field(pfield)[source]

Normalize a pressure field per pixel, over the transmit axis.

Turns the field into compounding weights that sum to 1 at every pixel.

Parameters:

pfield (array) – Pressure field of shape (n_tx, grid_size_z, grid_size_x).

Returns:

Normalized intensity array.

Return type:

ops.array

zea.beamform.pfield.shape_pressure_field(pfield, alpha=1.0, percentile=10.0)[source]

Per-transmit shaping of a pressure field: floor the dim tail, sharpen the beam.

Parameters:
  • pfield (array) – Pressure field of shape (n_tx, grid_size_z, grid_size_x).

  • alpha (float) – Exponent to ‘sharpen or smooth’ the weighting. Higher values result in sharper weighting. Default is 1.0 (no change).

  • percentile (float) – minimum percentile threshold to keep in the weighting, per transmit. Higher is more aggressive. Default is 10.

Returns:

Shaped pressure field, same shape.

Return type:

ops.array