add_band_to_mask#

diffsims.utils.mask_utils.add_band_to_mask(mask, x, y, theta, width, fill=False)[source]#

Add a straight band to a mask

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

  • x (float) – x-coordinate of point that the center of the band must pass through in pixels

  • y (float) – y-coordinate of point that the center of the band must pass through in pixels

  • theta (float) – angle in degrees of the band relative to the x-axis

  • width (float) – width of the band in pixels

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

Returns:

the mask is adjusted inplace

Return type:

None