Coherence-based image quality metrics for ultrasound.
This module implements coherence factor calculations for beamformed ultrasound data.
The coherence factor quantifies the degree of coherence between signals received
from different elements.
High coherence typically indicates good focusing and strong scattering,
while low coherence may indicate aberrations, noise, or weak scattering.
For applications in aberration correction, see [3].
Parameters:
channel_images – Complex-valued beamformed data before summation across receive elements.
The first dimension corresponds to individual receive elements (M),
and remaining dimensions represent the image coordinates.
Can be 2D (receive_elements, pixels) or higher dimensional
(receive_elements, height, width, …).
power_based – If False, uses amplitude-based coherence as in [2].
If True, uses power-based coherence with element normalization [5],
similar to vbeam implementation [4].
Returns:
Coherence factor values ranging from 0 to 1. Higher values indicate
better coherence between receive elements. Shape matches the image
dimensions of the input (all dimensions except the first).
Return type:
ndarray
Notes
For ultrasound applications, the coherence factor is useful for:
Assessing focusing quality and aberration detection
Adaptive beamforming weight calculation
Sound speed estimation and correction
Tissue characterization based on scattering properties
Compute the generalized coherence factor (GCF) of beamformed ultrasound data.
The generalized coherence factor [4] is a more robust version of the standard
coherence factor that uses spatial DFT across steering angles to reduce
sensitivity to incoherent noise:
where \(X[k] = \sum_{m} x_{m}[n] \cdot e^{-j2\pi km/M}\) is the spatial DFT across elements,
and the sum over k includes only the low-frequency region from -M0 to +M0.
The low-frequency region can be viewed as the received signal from the angles
around the transmit beam direction.
Parameters:
channel_images – Complex-valued beamformed data before summation across receive elements.
m0 –
Cutoff frequency for the low-frequency region. The GCF uses spatial
frequencies from -m0 to +m0. Must be >= 0 and < num_elements/2.
Compute the phase coherence factor (PCF) of beamformed ultrasound data.
The phase coherence factor [6] measures coherence based on phase alignment
of aperture data. This implementation uses the magnitude of the mean unit
phasor, which is equivalent to phase coherence:
This is a simplified but mathematically equivalent implementation of the
phase coherence factor that avoids issues with phase wrapping around ±π.
The PCF is amplitude-independent and focuses purely on phase alignment.
The PCF provides similar benefits to the standard coherence factor but is
more robust in the presence of amplitude variations, making it particularly
useful for suppressing side lobes and improving lateral resolution.
Parameters:
channel_images – Complex-valued beamformed data before summation across receive elements.
power – Exponential parameter p ≥ 0 to adjust sensitivity. Higher values provide
more aggressive suppression of phase-incoherent signals.
Returns:
Phase coherence factor values ranging from 0 to 1.
Return type:
ndarray
Notes
The PCF is maximum (1.0) when all signals have identical phases,
and approaches 0 when phases are randomly distributed. Unlike amplitude-based
coherence factors, PCF is insensitive to magnitude variations across elements.
Compute the sign coherence factor (SCF) of beamformed ultrasound data.
The sign coherence factor [5] uses only the polarity (sign) of signals,
making it extremely efficient for hardware implementation:
\[\text{SCF}^p[k] = |1 - \sigma|^p\]
where \(\sigma = \sqrt{1 - |\frac{1}{M} \sum b_{i}[k]|^2}\) and
\(b_{i}[k] = \text{sign}(\text{real}(x_{i}[k]))\).
The sign bit \(b_{i}[k]\) is +1 if \(\text{real}(x_{i}[k]) \geq 0\)
and -1 if \(\text{real}(x_{i}[k]) < 0\).
The SCF considers signals fully coherent when all have the same polarity
(strict coherence criterion) and completely incoherent when half are
positive and half are negative.
This can be considered a particular case of the phase coherence factor (PCF)
where phase is quantized to just 1 bit (sign), making it highly efficient
for hardware implementation while maintaining good performance.
Parameters:
channel_images – Complex-valued beamformed data before summation across receive elements.
Real part is used for sign computation.
power – Exponential parameter p ≥ 0 to adjust sensitivity. Higher values provide
more aggressive suppression of incoherent signals.
Returns:
Sign coherence factor values ranging from 0 to 1.
Return type:
ndarray
Notes
The SCF is maximum (1.0) when all aperture data have the same polarity,
and minimum (0.0) when half are positive and half are negative.