zea.inverse.seedingΒΆ

Scatterer seeding for the scatterer-prior inversion.

Samples initial scatterer positions from a beamformed image so that bright regions receive more scatterers, optionally mixed with a uniform floor over the field of view. Runs on the host in NumPy; the returned positions are fed to zea.inverse.ScattererSimulator.

Functions

seed_scatterers(image, grid, n_scatterers[, ...])

Sample scatterer positions from a beamformed image.

zea.inverse.seeding.seed_scatterers(image, grid, n_scatterers, prob_exponent=2.5, uniform_frac=0.3, envelope=True, seed=None)[source]ΒΆ

Sample scatterer positions from a beamformed image.

A fraction 1 - uniform_frac of the scatterers is drawn from the image envelope with probability proportional to envelope**prob_exponent (bright pixels seed more scatterers; a lower exponent is more generous to dim regions), jittered uniformly within each pixel cell. The remaining fraction is placed uniformly over the field of view, which lets the subsequent optimization assign energy to regions the image misses.

Parameters:
  • image (Tensor or ndarray) – Beamformed image of shape (grid_size_z, grid_size_x).

  • grid (Tensor or ndarray) – Pixel positions of shape (grid_size_z, grid_size_x, 3), e.g. parameters.grid.

  • n_scatterers (int) – Total number of scatterers to sample.

  • prob_exponent (float, optional) – Sharpness of the envelope-based sampling. Defaults to 2.5.

  • uniform_frac (float, optional) – Fraction of scatterers placed uniformly over the field of view. Defaults to 0.3.

  • envelope (bool, optional) – Detect the envelope of the (RF) image along depth before sampling. Set to False when image is already an envelope/B-mode image. Defaults to True.

  • seed (int, optional) – Seed for reproducible sampling.

Returns:

Scatterer positions (x, y, z) of shape (n_scatterers, 3), float32.

Return type:

ndarray