tomodrgn.dataset.window_mask#

window_mask(boxsize: int, in_rad: float = 0.75, out_rad: float = 0.95) ndarray[source]#

Create a 2-D circular mask with a soft edge falling as a cosine from in_rad to out_rad. Mask is defined as a circle inscribed within the (square) image box.

Parameters:
  • boxsize – the image box width in pixels

  • in_rad – the fraction of the image box radius at which to begin a falling cosine edge

  • out_rad – the fraction of the image box radius at which to end a falling cosine edge

Returns:

2-D mask as a 2-D numpy array of shape (boxsize, boxsize) of dtype float