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
|
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_fracof the scatterers is drawn from the image envelope with probability proportional toenvelope**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
Falsewhenimageis already an envelope/B-mode image. Defaults toTrue.seed (int, optional) β Seed for reproducible sampling.
- Returns:
Scatterer positions
(x, y, z)of shape(n_scatterers, 3), float32.- Return type:
ndarray