Algorithm Search⌘K

Algorithmadvanced

Coherent plane-wave compounding

Also called plane-wave compounding.

Transmit unfocused plane waves at a few tilt angles, beamform each one at every pixel, and add the complex images. N angles give a synthetic transmit focus at a high frame rate, for O(N M n^2) work.

Time
O(N M n^2) worst
Space
O(M) extra
Where
M = the number of array elements; N = the number of plane-wave angles; n = the number of pixels along one side of the image
Properties
deterministicnot exactlinear in dataiterative
Origin
Gabriel Montaldo, Mickael Tanter, Jeremy Bercoff, Nicolas Benech, Mathias Fink, 2009

Coherent plane-wave compounding forms an ultrasound image from a few unfocused transmissions. All elements of the array fire together, with small delays that tilt the wavefront by an angle α\alpha, so a plane wave crosses the whole field at once. Every pixel is then beamformed on receive with the exact two-way time: the plane wave reaches (x,z)(x, z) at (zcos⁡α+xsin⁡α)/c(z \cos\alpha + x \sin\alpha)/c, and the echo goes back to element jj in z2+(x−xj)2/c\sqrt{z^2 + (x - x_j)^2}/c. One plane wave gives a full image that is focused on receive only. The complex images of NN angles are added before the envelope, which builds a transmit focus after the fact, as synthetic transmit aperture does with single elements. Since each firing covers the whole field, a frame needs NN firings, often 5 to 40, against one firing per line for focused imaging. The receive step is delay-and-sum beamforming with dynamic receive focusing.

In plain words

Instead of sending a narrow beam down one line at a time, the whole array sends one flat wave that lights up the entire picture at once. Listening to the echoes, you can already work out an image, but it is blurry, because the light was not focused. Now send the flat wave a few more times, each time a little tilted. Each tilt gives another blurry image, and the blur is different each time. Add the images while they are still waves, before taking the brightness, and the parts that agree add up while the blur cancels. A few flat waves give an image almost as sharp as the slow, focused one.

The problem

The input is, for each angle αa\alpha_a, a=1,…,Na = 1, \ldots, N, the MM traces of the array as complex baseband (IQ) samples at t0+k/fst_0 + k/f_s, with the analytic RF signal raj(t)=baj(t)ei2πf0tr_{aj}(t) = b_{aj}(t) e^{i 2\pi f_0 t}. The array lies on z=0z = 0 with element jj at (xj,0)(x_j, 0), and the medium has the speed of sound cc. The time origin of angle aa is the moment when its wavefront passes (0,0)(0, 0). The output is an image on an n×nn \times n grid, as large as possible where a scatterer is. An optional receive f-number FF limits element jj to the pixels with ∣x−xj∣≤z/(2F)|x - x_j| \le z/(2F).

The algorithm

  1. COMPOUND(r, α_1 … α_N, x_1 … x_M, pixels, c, F) ▷ returns the image I
  2. 1for each pixel p = (x, z) do
  3. 2ρ_j ← √(z² + (x - x_j)²) / c for j = 1 … M ▷ receive times
  4. 3acc ← 0
  5. 4for a ← 1 to N do
  6. 5τ ← (z cos α_a + x sin α_a) / c ▷ transmit time of the tilted wave
  7. 6for j ← 1 to M do
  8. 7if F is not given or |x - x_j| ≤ z/(2F) then
  9. 8acc ← acc + SAMPLE(r_aj, τ + ρ_j)
  10. 9I(p) ← |acc|

SAMPLE is the same as on the TFM page: linear interpolation of the baseband trace and the carrier phase at the exact time. Line L5 is the only new part. The receive times of L2 do not depend on the angle, so they are computed once per pixel. Line L9 takes the modulus after the sum over all angles; this is what makes the compounding coherent.

Example

The tests use M=16M = 16 elements with pitch 0.3 mm, c=1.54c = 1.54 mm/us, f0=5f_0 = 5 MHz, fs=40f_s = 40 MHz and a Gaussian pulse envelope with σt=0.1\sigma_t = 0.1 us. One scatterer of amplitude 1 is at (0,6)(0, 6) mm.

For a wave tilted by α=10\alpha = 10 degrees and the pixel (0.3,6)(0.3, 6) mm, line L5 gives τ=(6cos⁡10°+0.3sin⁡10°)/1.54=3.8707\tau = (6 \cos 10° + 0.3 \sin 10°)/1.54 = 3.8707 us, and for the outer element at xj=−2.25x_j = -2.25 mm, L2 gives 36+2.552/1.54=4.2334\sqrt{36 + 2.55^2}/1.54 = 4.2334 us. With a scatterer at that pixel, the peak of the image of this single tilted wave is at (0.3,6)(0.3, 6), as the test checks for ±10\pm 10 degrees. A sign error in L5 moves the peak.

Lateral profiles at z=6z = 6 mm, normalized to the peak, with the largest side lobe at ∣x∣≥0.6|x| \ge 0.6 mm:

angles peak (N M) x = -0.3 -0.2 -0.1 0 0.1 0.2 0.3 side lobe
1 (0°) 15.92 (16) 0.315 0.625 0.893 1 0.893 0.625 0.315 0.076
3 (-4° to 4°) 47.74 (48) 0.305 0.610 0.887 1 0.887 0.610 0.305 0.054
9 (-8° to 8°, step 2°) 143.24 (144) 0.289 0.588 0.878 1 0.878 0.588 0.289 0.026
11 (-15° to 15°, step 3°) 175.06 (176) 0.235 0.508 0.842 1 0.842 0.508 0.235 0.037

The peak is NMN M times the amplitude up to the interpolation loss, as Theorem 2 of the proof says. A wider span of angles narrows the main lobe, and more angles in a span lower the side lobes. The table is a measurement on this small simulation; the numbers depend on the array, the depth and the pulse.

Correctness

The compounded image is linear in the data before the modulus, the code checks it against its exact adjoint, and it equals the sum of the complex single-angle images. For a point scatterer and exact samples, every term at the scatterer equals the amplitude times g(0)g(0), so the pixel value there is NM∣a∣g(0)N M |a| g(0) (or NN times the number of elements in the aperture), and the triangle inequality shows that no pixel is larger. The transmit time of L5 is exact for a plane wave that passes the origin at time 00. The proofs are in proofs/correctness.md.

These are results for the model: ideal plane waves, point scatterers, single scattering and a known constant cc. A real array of finite width makes an imperfect plane wave with edge waves, and the image near the edges of the insonified region is worse.

Proof: Coherent plane-wave compounding is linear, equals the sum of the single-angle images, and puts a maximum of height N M at a point scattererfull

We prove four facts about the algorithm on the main page (lines L1 to L9) for the pulse-echo model of the page: a linear array on z=0z = 0, plane waves that are exact in the medium, point scatterers, constant speed of sound cc, and no spreading loss or directivity.

Setting. Angle aa has the tilt αa\alpha_a, a=1,…,Na = 1, \ldots, N. The wavefront of angle aa passes the origin at t=0t = 0, so it reaches the point p=(x,z)p = (x, z) at Ta(p)=(zcos⁡αa+xsin⁡αa)/cT_a(p) = (z \cos\alpha_a + x \sin\alpha_a)/c (line L5). The echo from pp reaches element jj at ej=(xj,0)e_j = (x_j, 0) after a further ∣p−ej∣/c|p - e_j|/c (line L2). SAMPLE returns the analytic value r~aj(t)\tilde r_{aj}(t) of trace (a,j)(a, j) with linear interpolation of the baseband samples, and 00 outside the window. Let J(p)J(p) be the set of elements that pass line L7. The complex image is S(p)=∑a∑j∈J(p)r~aj(Ta(p)+∣p−ej∣/c)S(p) = \sum_a \sum_{j \in J(p)} \tilde r_{aj}(T_a(p) + |p - e_j|/c) and the output is ∣S(p)∣|S(p)|.

Lemma (the transmit time). For a plane wave with the unit direction na=(sin⁡αa,cos⁡αa)n_a = (\sin\alpha_a, \cos\alpha_a) that passes the origin at time 00, the time at which it reaches pp is ⟨na,p⟩/c=Ta(p)\langle n_a, p \rangle / c = T_a(p).

Proof. The wavefront at time tt is the line {p:⟨na,p⟩=ct}\{p : \langle n_a, p \rangle = c t\}, because it moves along nan_a at speed cc and contains the origin at t=0t = 0. Solve for tt. □\square

With this origin of time, element jj fires at xjsin⁡αa/cx_j \sin\alpha_a / c, which is negative for some elements; only the common time origin matters for the image. Adding the receive time gives the delay τ=(zcos⁡α+xsin⁡α+z2+(x−xj)2)/c\tau = (z \cos\alpha + x \sin\alpha + \sqrt{z^2 + (x - x_j)^2})/c of Montaldo et al. (2009).

Theorem 1 (linearity and decomposition). SS is linear in the data, its exact adjoint spreads each pixel value back with the conjugate weights of SAMPLE, and S=∑aSaS = \sum_a S_a, where SaS_a is the image of angle aa alone.

Proof. Each term is a linear form in one trace with weights that depend only on the geometry. The outer sum over aa in L4 adds the per-angle sums, and nothing in the inner loops depends on other angles. The adjoint of a sum of linear forms is the sum of their adjoints. □\square

So coherent compounding is the same as forming one complex image per angle and adding them. The modulus must come after the sum; adding the moduli is incoherent compounding, a different method.

Theorem 2 (a point scatterer). Let the data be exact samples of one scatterer a0a_0 at p0=(x0,z0)p_0 = (x_0, z_0), z0>0z_0 > 0: trace (a,j)(a, j) holds the echo with the delay τaj=Ta(p0)+∣p0−ej∣/c\tau_{aj} = T_a(p_0) + |p_0 - e_j|/c and a real envelope gg with ∣g(s)∣≤g(0)|g(s)| \le g(0), and SAMPLE reads it without interpolation error. Then

S(p)=a0∑a∑j∈J(p)g(Δaj) ei2πf0Δaj,Δaj=Ta(p)−Ta(p0)+∣p−ej∣−∣p0−ej∣c,S(p) = a_0 \sum_a \sum_{j \in J(p)} g(\Delta_{aj})\, e^{i 2\pi f_0 \Delta_{aj}}, \qquad \Delta_{aj} = T_a(p) - T_a(p_0) + \frac{|p - e_j| - |p_0 - e_j|}{c},

∣S(p0)∣=∣a0∣ g(0) N ∣J(p0)∣|S(p_0)| = |a_0|\, g(0)\, N\, |J(p_0)|, and ∣S(p)∣≤∣a0∣ g(0) N ∣J(p)∣|S(p)| \le |a_0|\, g(0)\, N\, |J(p)| for every pp. Without an f-number, ∣J(p)∣=M|J(p)| = M, so p0p_0 is a global maximum of the image with the value NM∣a0∣g(0)N M |a_0| g(0).

Proof. At the read time t=Ta(p)+∣p−ej∣/ct = T_a(p) + |p - e_j|/c the analytic value is a0 g(t−τaj)ei2πf0(t−τaj)a_0\, g(t - \tau_{aj}) e^{i 2\pi f_0 (t - \tau_{aj})}, and t−τaj=Δajt - \tau_{aj} = \Delta_{aj}. At p0p_0 every Δaj\Delta_{aj} is 00, so all N∣J(p0)∣N |J(p_0)| terms equal a0g(0)a_0 g(0). The bound is the triangle inequality with ∣g∣≤g(0)|g| \le g(0). □\square

We do not prove that the maximum is unique for every geometry. The tests check that the peak is at the scatterer on the grid, for the compounded image and for single tilted waves.

Theorem 3 (the receive f-number). With an f-number FF, line L7 keeps the elements with ∣x−xj∣≤z/(2F)|x - x_j| \le z/(2F), an aperture of width z/Fz/F centered under the pixel. For an array of pitch dd the number of elements in the sum is at most ⌊z/(Fd)⌋+1\lfloor z/(F d) \rfloor + 1, and the set grows with zz.

Proof. The condition defines a closed interval of length z/Fz/F that contains the interval for any smaller zz. An interval of length LL holds at most ⌊L/d⌋+1\lfloor L/d \rfloor + 1 points of a grid with step dd. □\square

In the test, F=1.5F = 1.5 at z=6z = 6 mm gives a width of 4 mm and 14 of the 16 elements, and the peak is 14 up to the interpolation loss.

Theorem 4 (cost). Each pixel reads N∣J(p)∣≤NMN |J(p)| \le N M samples, so an n×nn \times n image costs O(NMn2)O(N M n^2) in the real-RAM model, with O(M)O(M) extra space for the receive times of line L2. The acquisition needs NN firings, against MM for full matrix capture.

Proof. Lines L4 to L8 run N∣J(p)∣N |J(p)| times per pixel at O(1)O(1) each, and L2 runs MM times per pixel. □\square

Complexity

In the real-RAM model, each pixel reads NMN M samples (fewer with an f-number), so an n×nn \times n image costs O(NMn2)O(N M n^2), and the extra space is O(M)O(M). This is M/NM/N times less work than TFM on the same grid.

The acquisition is the main gain. A frame needs NN firings, each one round trip to the deepest point. For a depth of 60 mm the round trip is 120/1.54=77.9120 / 1.54 = 77.9 us at 1.54 mm/us, so 9 angles take 0.70 ms per frame (about 1400 frames per second), against 9.97 ms for 128 focused lines (about 100 frames per second). These figures ignore dead time and processing.

Properties

  • Linear in the data before the modulus, with an exact adjoint; the compound is the sum of the angle images.
  • Every pixel is in the receive focus; the transmit focus is synthetic and improves with the number and span of the angles.
  • The transmitted energy of each firing comes from all elements, so the signal-to-noise ratio per firing is higher than for single-element synthetic aperture.
  • Motion between firings changes the phase of the angle images and lowers the gain of the coherent sum; with NN firings in a fraction of a millisecond this is small for most tissue.
  • The number of angles is a design choice. Montaldo et al. (2009) relate it to the aperture, the wavelength and the f-number, so that the compound matches focused imaging; this is a rule of thumb, not a theorem.

Variants and improvements

  • Diverging waves. For phased arrays with a small footprint, virtual point sources behind the array give a sector field of view; the transmit time is the distance to the virtual source.
  • Weights. Receive apodization, an f-number (line L7) and weights over the angles lower the side lobes.
  • Adaptive combination. The coherence factor, delay-multiply-and-sum and the Capon beamformer can replace the plain sum over elements or angles.
  • Ultrafast Doppler. The high frame rate allows long ensembles at every pixel, which SVD clutter filtering and the Kasai estimator use for blood flow.
  • Shear wave elastography. Frames thousands of times per second can follow a shear wave through tissue; this was a main motivation of Montaldo et al.

When to use it

Use plane-wave compounding when the frame rate matters: Doppler and functional imaging, elastography and fast moving organs. A focused transmit still gives a better signal-to-noise ratio at the focal depth for the same number of firings, and it is simpler on older hardware that cannot store all channel data.

Pitfalls

  • Time origin. The formula of L5 assumes that each wave passes (0,0)(0, 0) at t=0t = 0. If the hardware starts the clock when the first element fires, add the offset M−12d ∣sin⁡α∣/c\frac{M-1}{2} d\, |\sin\alpha| / c for a centered array of pitch dd, or the image shifts with the angle and the compounding blurs.
  • Incoherent sum. Taking the modulus of each angle image before the sum gives incoherent compounding: less speckle, but no gain in resolution.
  • Too few or too wide angles. Few angles leave high side lobes; large tilts with element directivity add little signal and cause grating lobes for a coarse pitch.
  • Motion. Fast motion during the NN firings dephases the angle images; motion compensation or fewer angles help.
  • Edges of the field. Pixels near the lateral edges are not lit by all tilted waves; limit the sum to the angles that cover the pixel.

Implementations

Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.

plane_wave_compounding.pyI0RawGitHub
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/plane-wave-compounding/. The authors are listed in prov/HTFN8H.jsonl.
"""Coherent plane-wave compounding (Montaldo et al. 2009).

Units: millimetres, microseconds and megahertz; 1540 m/s is 1.54 mm/us.
The array lies on z = 0 with element j at (x_j, 0), centered at x = 0. For the
steering angle alpha, the plane wave travels in the direction
(sin alpha, cos alpha), and the time origin is the moment its wavefront passes
the point (0, 0). The wave then reaches (x, z) at (z cos alpha + x sin alpha) / c.

data[a][j] is the complex baseband (IQ) trace of receive element j for angle a,
sampled at t0 + q / fs; the analytic RF signal is b(t) exp(i 2 pi f0 t).
For each angle the beamformer sums the receive elements at the transmit time
plus the receive time; compounding adds the complex images of all angles
before the modulus.
"""

import cmath
import math

SOUND_SPEED = 1.54  # mm per microsecond


def element_positions(m_count, pitch):
    """x positions of a linear array of m_count elements, centered at x = 0."""
    return [(j - (m_count - 1) / 2) * pitch for j in range(m_count)]


def transmit_time(px, pz, alpha, c=SOUND_SPEED):
    """The time at which the plane wave of angle alpha reaches (px, pz)."""
    return (pz * math.cos(alpha) + px * math.sin(alpha)) / c


def simulate_plane_waves(elements, angles, scatterers, f0, sigma_t, fs, t0, ns, c=SOUND_SPEED):
    """data[a][j]: echoes of point scatterers (x, z, amp) for each plane wave."""
    data = []
    for alpha in angles:
        per_angle = []
        for xj in elements:
            tr = [0j] * ns
            for (sx, sz, amp) in scatterers:
                tau = transmit_time(sx, sz, alpha, c) + math.hypot(sx - xj, sz) / c
                rot = amp * cmath.exp(-2j * math.pi * f0 * tau)
                lo = max(0, math.ceil((tau - 5 * sigma_t - t0) * fs))
                hi = min(ns - 1, math.floor((tau + 5 * sigma_t - t0) * fs))
                for q in range(lo, hi + 1):
                    dt = t0 + q / fs - tau
                    tr[q] += rot * math.exp(-dt * dt / (2 * sigma_t * sigma_t))
            per_angle.append(tr)
        data.append(per_angle)
    return data


def sample(trace, t, t0, fs, f0):
    """The analytic RF value of a baseband trace at time t, by linear interpolation."""
    u = (t - t0) * fs
    q = math.floor(u)
    phi = u - q
    if q < 0 or q + 1 >= len(trace):
        return 0j
    return ((1 - phi) * trace[q] + phi * trace[q + 1]) * cmath.exp(2j * math.pi * f0 * t)


def _in_aperture(px, pz, xj, fnum):
    return fnum is None or abs(px - xj) <= pz / (2 * fnum)


def compound_complex(data, elements, angles, xs, zs, t0, fs, f0, fnum=None, c=SOUND_SPEED):
    """The complex compounded image; rows follow zs, columns follow xs."""
    image = []
    for pz in zs:  # @line L1
        row = []
        for px in xs:
            rx = [math.hypot(px - xj, pz) / c for xj in elements]  # @line L2
            acc = 0j  # @line L3
            for a, alpha in enumerate(angles):  # @line L4
                tx = transmit_time(px, pz, alpha, c)  # @line L5
                for j, xj in enumerate(elements):  # @line L6
                    if _in_aperture(px, pz, xj, fnum):  # @line L7
                        acc += sample(data[a][j], tx + rx[j], t0, fs, f0)  # @line L8
            row.append(acc)
        image.append(row)
    return image


def compound(data, elements, angles, xs, zs, t0, fs, f0, fnum=None, c=SOUND_SPEED):
    """The compounded image: the modulus of the coherent sum over angles and elements."""
    return [[abs(v) for v in row]
            for row in compound_complex(data, elements, angles, xs, zs, t0, fs, f0, fnum, c)]  # @line L9


def compound_adjoint(image, elements, angles, xs, zs, t0, fs, f0, ns, fnum=None, c=SOUND_SPEED):
    """The exact adjoint of compound_complex: a discrete plane-wave pulse-echo model."""
    data = [[[0j] * ns for _ in elements] for _ in angles]
    for iz, pz in enumerate(zs):
        for ix, px in enumerate(xs):
            v = image[iz][ix]
            for a, alpha in enumerate(angles):
                tx = transmit_time(px, pz, alpha, c)
                for j, xj in enumerate(elements):
                    if not _in_aperture(px, pz, xj, fnum):
                        continue
                    t = tx + math.hypot(px - xj, pz) / c
                    u = (t - t0) * fs
                    q = math.floor(u)
                    if q < 0 or q + 1 >= ns:
                        continue
                    phi = u - q
                    w = v * cmath.exp(-2j * math.pi * f0 * t)
                    data[a][j][q] += (1 - phi) * w
                    data[a][j][q + 1] += phi * w
    return data
test_plane_wave_compounding.py 99 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/plane-wave-compounding/. The authors are listed in prov/HTFN8H.jsonl.

import cmath
import math
import random

from plane_wave_compounding import (compound, compound_adjoint, compound_complex, element_positions,
                                    simulate_plane_waves, transmit_time)

F0, SIGMA, FS, T0, NS = 5.0, 0.1, 40.0, 7.0, 120
M = 16
ELEMENTS = element_positions(M, 0.3)
DEG = math.pi / 180
NINE = [k * 2 * DEG for k in range(-4, 5)]
XS = [round(-1.5 + 0.1 * k, 10) for k in range(31)]


def test_peak_at_the_scatterer_with_gain_angles_times_elements() -> None:
    data = simulate_plane_waves(ELEMENTS, NINE, [(0.0, 6.0, 1.0)], F0, SIGMA, FS, T0, NS)
    zs = [5.9, 5.95, 6.0, 6.05, 6.1]
    img = compound(data, ELEMENTS, NINE, XS[10:21], zs, T0, FS, F0)
    v, i, j = max((v, i, j) for i, row in enumerate(img) for j, v in enumerate(row))
    assert (zs[i], XS[10 + j]) == (6.0, 0.0)
    assert abs(v - 9 * M) < 0.01 * 9 * M


def test_steered_wave_focuses_at_the_right_place() -> None:
    # a sign error in the transmit delay moves or smears the point for a tilted wave
    for alpha in (10 * DEG, -10 * DEG):
        data = simulate_plane_waves(ELEMENTS, [alpha], [(0.3, 6.0, 1.0)], F0, SIGMA, FS, T0, NS)
        zs = [5.9, 5.95, 6.0, 6.05, 6.1]
        img = compound(data, ELEMENTS, [alpha], XS, zs, T0, FS, F0)
        v, i, j = max((v, i, j) for i, row in enumerate(img) for j, v in enumerate(row))
        assert (zs[i], XS[j]) == (6.0, 0.3)
        assert abs(v - M) < 0.01 * M


def test_matches_the_analytic_sum_without_sampling() -> None:
    angs = [-5 * DEG, 0.0, 5 * DEG]
    scat = [(0.0, 6.0, 1.0), (0.4, 6.2, 0.5)]
    data = simulate_plane_waves(ELEMENTS, angs, scat, F0, SIGMA, FS, T0, NS)
    xs, zs = XS[10:21:3], [5.95, 6.0, 6.2]
    got = compound_complex(data, ELEMENTS, angs, xs, zs, T0, FS, F0)
    for a, pz in enumerate(zs):
        for b, px in enumerate(xs):
            want = 0j
            for alpha in angs:
                for xj in ELEMENTS:
                    t = transmit_time(px, pz, alpha) + math.hypot(px - xj, pz) / 1.54
                    for sx, sz, amp in scat:
                        dt = t - transmit_time(sx, sz, alpha) - math.hypot(sx - xj, sz) / 1.54
                        want += amp * math.exp(-dt * dt / (2 * SIGMA ** 2)) * cmath.exp(2j * math.pi * F0 * dt)
            assert abs(got[a][b] - want) < 0.01 * len(angs) * M


def test_compound_is_the_sum_of_the_single_angle_images() -> None:
    data = simulate_plane_waves(ELEMENTS, NINE, [(0.2, 6.1, 1.0), (-0.5, 6.0, 0.8)], F0, SIGMA, FS, T0, NS)
    xs, zs = XS[::5], [6.0, 6.1]
    total = compound_complex(data, ELEMENTS, NINE, xs, zs, T0, FS, F0)
    parts = [compound_complex([data[a]], ELEMENTS, [NINE[a]], xs, zs, T0, FS, F0) for a in range(len(NINE))]
    for i in range(len(zs)):
        for j in range(len(xs)):
            assert abs(total[i][j] - sum(p[i][j] for p in parts)) < 1e-9


def test_compounding_lowers_the_sidelobes() -> None:
    def side(angs):
        data = simulate_plane_waves(ELEMENTS, angs, [(0.0, 6.0, 1.0)], F0, SIGMA, FS, T0, NS)
        prof = compound(data, ELEMENTS, angs, XS, [6.0], T0, FS, F0)[0]
        return max(v for x, v in zip(XS, prof) if abs(x) >= 0.6) / max(prof)
    assert side(NINE) < 0.5 * side([0.0])


def test_receive_f_number_limits_the_aperture() -> None:
    data = simulate_plane_waves(ELEMENTS, [0.0], [(0.0, 6.0, 1.0)], F0, SIGMA, FS, T0, NS)
    used = sum(1 for xj in ELEMENTS if abs(xj) <= 6.0 / (2 * 1.5))
    assert used == 14
    v = compound(data, ELEMENTS, [0.0], [0.0], [6.0], T0, FS, F0, fnum=1.5)[0][0]
    assert abs(v - used) < 0.01 * used


def test_adjoint() -> None:
    rng = random.Random(7303)
    el = element_positions(5, 0.4)
    angs = [-6 * DEG, 0.0, 6 * DEG]
    ns, t0 = 50, 5.0
    xs, zs = [-0.3, 0.0, 0.2], [4.0, 4.1]
    data = [[[complex(rng.gauss(0, 1), rng.gauss(0, 1)) for _ in range(ns)] for _ in el] for _ in angs]
    img = [[complex(rng.gauss(0, 1), rng.gauss(0, 1)) for _ in xs] for _ in zs]
    for fnum in (None, 2.0):
        a = compound_complex(data, el, angs, xs, zs, t0, FS, F0, fnum)
        b = compound_adjoint(img, el, angs, xs, zs, t0, FS, F0, ns, fnum)
        lhs = sum(a[i][j].conjugate() * img[i][j] for i in range(len(zs)) for j in range(len(xs)))
        rhs = sum(data[p][j][q].conjugate() * b[p][j][q]
                  for p in range(len(angs)) for j in range(len(el)) for q in range(ns))
        na = math.sqrt(sum(abs(v) ** 2 for row in a for v in row))
        ni = math.sqrt(sum(abs(v) ** 2 for row in img for v in row))
        assert abs(lhs - rhs) <= 1e-10 * na * ni

History

Synthetic aperture imaging in medical ultrasound used single elements or small groups of elements and coherent sums after the scan (Jensen, Nikolov, Gammelmark and Pedersen 2006 give an overview). Plane-wave transmissions for very high frame rates were used for transient elastography. Montaldo, Tanter, Bercoff, Benech and Fink (2009) showed that a coherent sum of a small number of tilted plane-wave images matches the quality of conventional focused imaging at much higher frame rates. This made ultrafast imaging, with thousands of frames per second, a standard tool for Doppler, elastography and functional ultrasound.

References

  1. Gabriel Montaldo, Mickael Tanter, Jeremy Bercoff, Nicolas Benech and Mathias Fink, Coherent plane-wave compounding for very high frame rate ultrasonography and transient elastography, IEEE Transactions on Ultrasonics, Ferroelectrics, and Frequency Control 56(3), 2009, 489 to 506, the beamforming of tilted plane waves, the coherent sum over angles, the choice of the number of angles, and the comparison with focused imaging (general locator)
  2. Jorgen Arendt Jensen, Svetoslav Ivanov Nikolov, Kim Lokke Gammelmark and Morten Hogholm Pedersen, Synthetic aperture ultrasound imaging, Ultrasonics 44 (supplement), 2006, e5 to e15, synthetic aperture imaging and its relation to the transmit focus (general locator)
  3. Thomas L. Szabo, Diagnostic Ultrasound Imaging: Inside Out, 2nd edition, Academic Press, 2014, Chapter 7, Array beamforming (transmit and receive focusing of arrays)

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH1 sketch
  • a full proof of time.worst
  • a full proof of space.extra
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
Code (python)I0 not checked yet
  • the tests did not run in this build
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • a scene preset for the example