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 using tme.filters.ReconstructFromTilt.

The opening_axis, tilt_axis and angles parameter are used to determine the correct frequencies for non-cubical input shapes. The shape 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

BandPass.angles

The tilt angles in degrees.

BandPass.highpass

The highpass cutoff, defaults to None.

BandPass.lowpass

The lowpass cutoff, defaults to None.

BandPass.opening_axis

The projection axis, defaults to 2 (z).

BandPass.sampling_rate

The sampling rate, defaults to 1 Ångstrom / voxel.

BandPass.tilt_axis

Axis the plane is tilted over, defaults to 0 (x).

BandPass.use_gaussian

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.