zea.inverse.inversionΒΆ
High-level drivers for inverting the DAS beamformer.
Recovers pre-beamformed channel data from a post-beamformed (DAS) image. Two inversions are provided:
invert_direct()β solve for the full channel-data cube directly with CGLS. The DAS operator is massively underdetermined, so this yields the minimum-norm least-squares (pseudo-inverse) solution: it reproduces the image almost exactly but recovers the physical channel data poorly.invert_scatterers()β fit point-scatterer magnitudes (positions seeded from the image, shared across transmits) whose simulated channel data reproduces the image. The scatterer parameterization regularizes the nullspace of the DAS operator and recovers channel data far better on point-target scans. Optionally refines positions and magnitudes jointly with Adam.
Functions
|
Recover channel data from a beamformed image by pseudo-inversion. |
|
Recover channel data from a beamformed image with a scatterer prior. |
Classes
|
Result of a DAS inversion. |
- class zea.inverse.inversion.InversionResult(channel_data, image, positions=None, magnitudes=None)[source]ΒΆ
Bases:
objectResult of a DAS inversion.
- Parameters:
channel_data (
object) β Recovered pre-beamformed channel data of shape(n_tx, n_ax, n_el).image (
object) β Re-beamformed image of the recovered channel data, flattened to shape(n_pix,). Compare against the measured image to assess the data fit.positions (
object) β Scatterer positions(n_scat, 3). Only set byinvert_scatterers().magnitudes (
object) β Scatterer magnitudes(n_scat,). Only set byinvert_scatterers().
- channel_data: objectΒΆ
- image: objectΒΆ
- magnitudes: object = NoneΒΆ
- positions: object = NoneΒΆ
- zea.inverse.inversion.invert_direct(operator, image, n_iter=50, jit=True, verbose=False)[source]ΒΆ
Recover channel data from a beamformed image by pseudo-inversion.
Solves
min ||operator(channel_data) - image||^2over the full channel data cube with CGLS starting from zero, which converges to the minimum-norm (Moore-Penrose) solution. This fits the image essentially perfectly but, because the DAS operator has a large nullspace, the minimum-norm solution is generally not the physical channel data β seeinvert_scatterers()for a regularized alternative.- Parameters:
operator (DASOperator) β The beamforming operator to invert.
image (Tensor) β Measured beamformed image, flattened
(n_pix,)or shaped(grid_size_z, grid_size_x).n_iter (int, optional) β CGLS iterations. Defaults to
50.jit (bool, optional) β JIT-compile the operator applications (JAX and TensorFlow backends). Defaults to
True.verbose (bool, optional) β Log CGLS progress. Defaults to
False.
- Returns:
Recovered channel data and its re-beamformed image.
- Return type:
- zea.inverse.inversion.invert_scatterers(operator, image, n_scatterers=5000, n_iter=50, prob_exponent=2.5, uniform_frac=0.3, refine_iters=0, refine_step_size=0.05, simulator=None, seed=None, jit=True, verbose=False)[source]ΒΆ
Recover channel data from a beamformed image with a scatterer prior.
Seeds point scatterers from the image envelope, then solves the convex subproblem for their magnitudes with CGLS (positions fixed):
min ||operator(simulate(positions, magnitudes)) - image||^2. Optionally refines positions and magnitudes jointly with Adam afterwards (refine_iters > 0); positions are optimized in units of wavelength so a single step size applies to both variables.The scatterer parameterization regularizes the nullspace of the DAS operator: unlike
invert_direct(), the recovered channel data is constrained to physically consistent point-scatterer echoes.- Parameters:
operator (DASOperator) β The beamforming operator to invert.
image (Tensor) β Measured beamformed image, flattened
(n_pix,)or shaped(grid_size_z, grid_size_x).n_scatterers (int, optional) β Number of scatterers. Defaults to
5000.n_iter (int, optional) β CGLS iterations for the magnitudes. Defaults to
50.prob_exponent (float, optional) β Seeding sharpness, see
zea.inverse.seed_scatterers(). Defaults to2.5.uniform_frac (float, optional) β Fraction of uniformly seeded scatterers, see
zea.inverse.seed_scatterers(). Defaults to0.3.refine_iters (int, optional) β Adam iterations jointly refining positions and magnitudes. Defaults to
0(disabled).refine_step_size (float, optional) β Adam step size (wavelengths for positions). Defaults to
0.05.simulator (ScattererSimulator, optional) β Custom simulator. Defaults to
ScattererSimulator(operator.parameters).seed (int, optional) β Seed for reproducible scatterer placement.
jit (bool, optional) β JIT-compile the operator applications (JAX and TensorFlow backends). Defaults to
True.verbose (bool, optional) β Log progress. Defaults to
False.
- Returns:
Recovered channel data, its re-beamformed image, and the scatterer positions and magnitudes.
- Return type: