tomodrgn.utils.calc_lowpass_filter_mask#
- calc_lowpass_filter_mask(boxsize: int, angpix: float, lowpass: float, device: device | None = None) ndarray | Tensor [source]#
Calculate a binary mask to later be multiplied into a fourier space volume to lowpass filter said volume. Useful to pre-cache a lowpass filter mask that will be used repeatedly (e.g. evaluating many volumes with eval_vol.py)
- Parameters:
boxsize – number of voxels along one side of the Fourier space symmetrized (DC is box center) volume
angpix – Pixel size of the volume in Ångstroms per pixel.
lowpass – Resolution to filter volume in Ångstroms.
device – device of the volume to be lowpass filtered. None corresponds to a numpy array, otherwise specify a torch.Tensor device to produce a Tensor mask on said device.
- Returns:
Volume binary mask as a numpy array or torch tensor, shape (boxsize, boxsize, boxsize)