add_circles_to_mask#

diffsims.utils.mask_utils.add_circles_to_mask(mask, coords, r, fill=False)[source]#

Add a circle on a mask at each (x, y) coordinate with a radius r

Parameters:
  • mask ((H, W) array of dtype bool) – boolean mask for an image

  • coords ((N, 2) array) – (x, y) coordinates of circle centers

  • r (float or (N,) array) – radii of the circles

  • fill (int, optional) – Fill value. 0 is black (negative, False) and 1 is white (True)

Returns:

the mask is adjusted inplace

Return type:

None