Skip to content

Spatial Bandpass Filter

Compute Credits

This tool uses 2.0 compute credits per hour.

The spatial filter algorithm removes low and high spatial frequency content from microscope movies.

This should be used after your microscope movie has been preprocessed. Low spatial frequency components that do not correspond to in-focus cells may confound motion correction and cell segmentation. High spatial frequency components may cause the movie to appear less smooth.

Inputs

Parameter Required? Default Description
Input movies files True N/A The file paths of the movies to filter.
Low Cutoff False 0.005 If not None, then the low cutoff for the spatial filter.
High Cutoff False 0.5 If not None, then the high cutoff for the spatial filter.
Retain Mean Pixel Intensity True False If True, retain the mean pixel intensity for each frame (the DC component).
Subtract Global Minimum True True If True, compute the minimum pixel intensity across all movies, and subtract this after frame-by-frame mean subtraction. By doing this, all pixel intensities will stay positive valued, and integer-valued movies can stay that way.

File Inputs

Source Parameter File Type File Format
Input movies files miniscope_movie, miniscope_movie isxd, isxc

Description

Each frame of the movie is filtered individually. In general, bandpass filtering is performed by subtracting a smoothed version of the frame from a less smoothed version of the frame:

\[ \mathbf{M}^\text{bandpass}_f = \text{GaussianBlur}(\mathbf{M}_f, \sigma_{\text{high}}) - \text{GaussianBlur}(\mathbf{M}_f, \sigma_{\text{low}}). \]

The function \(\text{GaussianBlur}(\mathbf{M}_f, \sigma)\) represents a 2D spatial convolution of a Gaussian kernel with a standard deviation in the X and Y dimensions specified by \(\sigma\), where \(\mathbf{M}_f\) represents frame \(f\) of movie \(\mathbf{M}\).

If a Low cut-off is not used, high-pass filtering is performed by taking the less smoothed version of the frame:

\[ \mathbf{M}^\text{highpass}_f = \text{GaussianBlur}(\mathbf{M}_f, \sigma_{\text{high}}). \]

If a High cut-off is not used, low-pass filtering is performed by subtracting the less smoothed version of the frame from the original frame:

\[ \mathbf{M}^\text{lowpass}_f = \mathbf{M}_f - \text{GaussianBlur}(\mathbf{M}_f, \sigma_{\text{low}}). \]

The values of \(\sigma_{\text{high}}\) and \(\sigma_{\text{low}}\) are computed from the cut-off parameter values as:

\[ \sigma_i = \frac{\sqrt{2 \: ln(2)}}{2 \: \pi \: \lambda_i} \]

where \(\lambda_\text{high}\) is the High cut-off and \(\lambda_\text{low}\) is the Low cut-off. Note that \(\lambda_\text{high} > \lambda_\text{low}\) but \(\sigma_\text{high} < \sigma_\text{low}\).

Each cut-off represents the frequency at which the respective Gaussian kernel is at half power in the frequency domain.

The units of the cut-offs are rates similar to Hz, except the reciprocal unit is a pixel rather than a second. The value is the fraction of a spatial oscillation completed in one pixel. Here, "pixel" refers to the physical pixel bucket on the Inscopix microscope image sensor, so this value will be independent of any spatial downsampling performed before this algorithm is run (e.g. using the Preprocessalgorithm or performing on-chip binning during acquisition).

Further reading