BandPass#
- class BandPass(lowpass=None, highpass=None, sampling_rate=1, use_gaussian=True, angles=None, tilt_axis=0, opening_axis=2)[source]#
Bases:
ComposableFilter
Generate per-tilt Bandpass filter.
Examples
The following creates an instance of
BandPass
>>> from tme.filters import BandPass >>> bpf_instance = BandPass( >>> angles=(-70, 0, 30), >>> lowpass=30, >>> sampling_rate=10 >>> )
Differently from
tme.filters.BandPassReconstructed
, the filter masks are intended to be used in subsequent reconstruction usingtme.filters.ReconstructFromTilt
.The
opening_axis
,tilt_axis
andangles
parameter are used to determine the correct frequencies for non-cubical input shapes. Theshape
argument contains the shape of the reconstruction.>>> ret = bpf_instance(shape=(50,50,25)) >>> mask = ret["data"] >>> mask.shape # 3, 50, 50
Note that different from its reconstructed counterpart, the DC component is at the center of the array.
>>> import matplotlib.pyplot as plt >>> fix, ax = plt.subplots(nrows=1, ncols=3) >>> _ = [ax[i].imshow(mask[i]) for i in range(mask.shape[0])] >>> plt.show()
Attributes
The tilt angles in degrees.
The highpass cutoff, defaults to None.
The lowpass cutoff, defaults to None.
The projection axis, defaults to 2 (z).
The sampling rate, defaults to 1 Ångstrom / voxel.
Axis the plane is tilted over, defaults to 0 (x).
Whether to use Gaussian bandpass filter, defaults to True.
Methods
BandPass.__call__
([return_real_fourier])This method provides the standard interface for creating of composable filter masks.